diff --git a/TODO.md b/TODO.md index 47ffb9d..e017529 100644 --- a/TODO.md +++ b/TODO.md @@ -32,7 +32,7 @@ - [x] buffer picker (with search). - `:buffers` / Space b l opens a searchable picker; shared selection bindings, stable IDs, dirty/active marks, cross-tab buffers, and cancellation without switching. - [x] improve buffer picker and align with the rest of the editor ui/design language. - - shared floating-panel geometry, cyan border, padded search, aligned normal-brightness IDs/status columns, cyan `●` active/yellow `+` dirty marks, home-abbreviated paths, blue selection, and dimmed controls; preserve tiny-terminal navigation and switching. + - shared floating-panel geometry, cyan border, padded search, aligned normal-brightness IDs/status columns, cyan `*` before the active ID/yellow `+` dirty marks, home-abbreviated paths, blue selection, and dimmed controls; preserve tiny-terminal navigation and switching. - [ ] sandboxed, revision-specific LSP analysis for historical diff states and historical tabs. - current limitation: immutable snapshot buffers still use the live repository as their LSP workspace; cross-file analysis can mix historical text with current disk contents. - lazily materialize the complete selected revision, including unchanged files, manifests, and project configuration; run a separate LSP instance rooted in that snapshot. diff --git a/docs/editing.md b/docs/editing.md index 4ac3274..f362bed 100644 --- a/docs/editing.md +++ b/docs/editing.md @@ -278,7 +278,7 @@ Each buffer retains its shared text, path, saved state, and undo/redo history. V | Command | Behavior | | --- | --- | | `:edit PATH` | Switch to an already-loaded file, or read and validate a new buffer; a nonexistent file opens empty | -| `:buffers` | Open the searchable buffer picker; stable IDs and paths, `●` active, `+` dirty | +| `:buffers` | Open the searchable buffer picker; stable IDs and paths, `*` before the active buffer ID, `+` dirty | | `:buffer N` | Switch to buffer ID `N` | | `:buffer_next` / `:buffer_previous` | Switch in ascending-ID order, wrapping at either end | | `:buffer_delete [N]` | Close the active or named buffer; refuse unsaved changes | @@ -290,7 +290,7 @@ Switching from Insert commits its pending undo group and parks that view in Norm **Space b l**, `:buffers`, or the **Buffers** command-palette action opens the picker. Type to filter IDs and paths with case-insensitive, whitespace-separated substring tokens; every token must match. Results retain ascending ID order. Ctrl+j/Ctrl+n/Down and Ctrl+k/Up select with wraparound, using the shared Selection bindings and overrides. Backspace edits the query; Ctrl+u clears it. Enter switches only the focused pane to the selected buffer without saving or discarding edits; no matches leave the picker open. Esc or Ctrl+p cancels without switching. Printable keys, including `:` and leader keys, belong to the query. -The picker uses the file explorer's centered floating-panel geometry, a cyan border, padded search input, and dimmed controls. Buffer IDs and status columns align across rows: IDs use the normal text foreground, `●` is cyan for the active buffer, `+` is yellow for unsaved changes, and the selected row is blue. Paths under the home directory display as `~/…`, using the same component-aware abbreviation as the status bar; searching and file operations retain the original paths. Narrow or short terminals drop padding/borders as needed while keeping the query cursor and selected result visible whenever a result row fits. +The picker uses the file explorer's centered floating-panel geometry, a cyan border, padded search input, and dimmed controls. Buffer IDs and status columns align across rows: IDs use the normal text foreground, a cyan `*` before the ID marks the active buffer, `+` is yellow for unsaved changes, and the selected row is blue. Paths under the home directory display as `~/…`, using the same component-aware abbreviation as the status bar; searching and file operations retain the original paths. Narrow or short terminals drop padding/borders as needed while keeping the query cursor and selected result visible whenever a result row fits. The picker includes ordinary buffers from every tab and unnamed buffers as `[No Name]`; immutable diff snapshots are excluded. Labels sanitize path control characters, but selection uses stable buffer IDs, so displayed-name collisions still select the correct buffer. Switching out of a diff follows ordinary `:buffer N` behavior. diff --git a/src/tui.rs b/src/tui.rs index 7b0af6d..2b14769 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -4458,11 +4458,11 @@ fn draw_palette( } else { " " }), - Span::raw(format!("{:>id_width$} ", buffer.id)), Span::styled( - if buffer.active { "●" } else { " " }, + if buffer.active { "* " } else { " " }, Style::default().fg(Color::Cyan), ), + Span::raw(format!("{:>id_width$} ", buffer.id)), Span::styled( if buffer.dirty { "+ " } else { " " }, Style::default().fg(Color::Yellow), @@ -14497,13 +14497,13 @@ end .contains("picker-12.txt") }) .unwrap(); - assert_eq!(buffer[(area.x + 7, selected_y)].fg, Color::Cyan); - assert_eq!(buffer[(area.x + 8, selected_y)].symbol(), "+"); - assert_eq!(buffer[(area.x + 8, selected_y)].fg, Color::Yellow); - assert_eq!(buffer[(area.x + 10, selected_y)].bg, Color::Blue); + assert_eq!(buffer[(area.x + 4, selected_y)].fg, Color::Cyan); + assert_eq!(buffer[(area.x + 9, selected_y)].symbol(), "+"); + assert_eq!(buffer[(area.x + 9, selected_y)].fg, Color::Yellow); + assert_eq!(buffer[(area.x + 11, selected_y)].bg, Color::Blue); assert_eq!( - buffer[(area.x + 4, selected_y)].fg, - buffer[(area.x + 10, selected_y)].fg, + buffer[(area.x + 6, selected_y)].fg, + buffer[(area.x + 11, selected_y)].fg, ); assert!( pane_screen(&terminal, Rect::new(area.x, selected_y, width, 1))