#3426·fresh

editor.highlight_current_line: false is ignored for unnamed buffers restored by hot exit

Author: neatsorgCreated Sep 28, 2026Updated Sep 30, 2026
Labelsbugreproduced

Description

With "highlight_current_line": false in config.json, the current line is not highlighted in file buffers or in a new unnamed buffer (Ctrl+N). But once an unnamed buffer is restored by hot exit on the next launch, its current line is highlighted, as if the setting were true.

File-backed buffers restored in the same session are not affected. The file extension doesn't matter (.txt, .sh, … all behave correctly).

Steps to reproduce

  1. Set "editor": { "highlight_current_line": false } in ~/.config/fresh/config.json (hot_exit left at its default true).
  2. Start fresh in an empty directory.
  3. Press Ctrl+N and type a few lines. The current line is not highlighted (correct).
  4. Quit with "Quit (recoverable)" (q in the unsaved-changes prompt, or force_quit).
  5. Start fresh again in the same directory. The unnamed buffer is restored.
  6. Move the cursor. The current line is highlighted.

Expected

The restored unnamed buffer follows editor.highlight_current_line, like file buffers and freshly created unnamed buffers do.

Actual

The restored unnamed buffer always highlights the current line.

Likely cause (from reading the v0.5.1 source)

  • BufferViewState::new defaults to highlight_current_line: true (crates/fresh-editor/src/view/split.rs:279).
  • File buffers get the config applied through apply_config_defaults when they are opened, and new_buffer does the same for Ctrl+N (crates/fresh-editor/src/app/buffer_management.rs:730).
  • When restoring a workspace, unnamed buffers come from restore_unnamed_buffers (crates/fresh-editor/src/app/workspace.rs:2317), and their per-split view state is created with view_state.ensure_buffer_state(buffer_id) (workspace.rs:1465 / 1551). As far as I can tell, apply_config_defaults is never called for them, so they keep the hard-coded default.
  • Only an explicit per-buffer override (file_state.highlight_current_line) is restored. The global config value is not applied.

Other settings that apply_config_defaults stamps (e.g. line_numbers, wrap_column, rulers) may be affected in the same way, but I only verified highlight_current_line.

Workaround

A user plugin that runs toggle_current_line_highlight twice when an unnamed, non-virtual buffer is activated, and again on plugins_loaded. The latter is needed because the post-restore buffer_activated fires before user plugins are loaded. Running the toggle twice re-stamps the active split's view state from the config without changing the setting.

Environment

  • Fresh 0.5.1 (fresh-editor-bin, Manjaro Linux)
  • Terminal: WezTerm with enable_kitty_keyboard = true, COSMIC (Wayland)
  • Relevant config: "highlight_current_line": false, hot_exit default (true)