diff --git a/TODO.md b/TODO.md index 2f06912..ebf88e3 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,8 @@ - [x] jj conflict resolution with ui akin to the diff viewer - [x] make selecting a file in the diff view file picker focus the after buffer instead of the before buffer -- [ ] improve the lsp hover floating window: +- [x] improve the lsp hover floating window: - it should be taller +- [ ] add support for zig syntax highlighting - [ ] add the `*` action from vim on word to highlights and searches in buffer in one action. - [ ] diff view: github integration (code review) - add comments on a pr, add review comments at specific lines of files, request changes, approve pr, etc. - [ ] diff view: local review comments (same features as for github reviews) that allows review of local changes to deliver specific reviews to ai agents used for coding. diff --git a/docs/configuration.md b/docs/configuration.md index 1ce804d..85c8fce 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -407,7 +407,7 @@ Insert mode hides all diagnostic gutter colors, underlines, counts, and caret me `:lsp.hover` or a configured hover action requests information at the primary caret once, regardless of count or selection count. The response opens a read-only floating popup: arrows/Ctrl+h/j/k/l scroll vertically/horizontally, Home/End select the first/last logical line, and Escape dismisses without collapsing carets. Other input dismisses and continues normal editing. Changes to the source buffer/revision/caret, intervening input, or newer requests prevent pending hover replies from reopening it. -Hover accepts plaintext/Markdown MarkupContent and string/code MarkedString forms, including arrays. The popup grows up to 100 columns and 24 rows, clamped to the available document workspace and content height. Multiline content and Markdown markers remain visible, with the same Markdown syntax colors as document buffers; named fenced code blocks use their language's bundled highlighter. Highlighting is cached across scrolling and redraws. Horizontal scrolling exposes long lines without splitting graphemes. Missing/unsupported/invalid hover results report a message without changing text, selections, or undo history. Content is bounded to 4 MiB and terminal controls are sanitized. +Hover accepts plaintext/Markdown MarkupContent and string/code MarkedString forms, including arrays. The popup grows up to 100 columns and 40 rows, clamped to the available document workspace and content height. Multiline content and Markdown markers remain visible, with the same Markdown syntax colors as document buffers; named fenced code blocks use their language's bundled highlighter. Highlighting is cached across scrolling and redraws. Horizontal scrolling exposes long lines without splitting graphemes. Missing/unsupported/invalid hover results report a message without changing text, selections, or undo history. Content is bounded to 4 MiB and terminal controls are sanitized. Completion is manual and uses only the primary insertion caret. Ctrl+n requests it; the first candidate replaces text immediately. While the list is open Ctrl+n/Ctrl+j selects next and Ctrl+k previous, including an Original text row that restores the original document and carets. Other keys close the list with no accept key. Snippets expand the whole template and highlight the first argument: typing replaces it and its mirrors, Tab/Shift+Tab moves next/previous, and the final `$0` ends navigation. Outside a snippet Tab inserts a tab; Escape returns to Normal keeping the displayed text. Secondary carets are translated, not completed independently. Cycling and argument edits belong to the pending Insert undo group; repeat records resolved text and caret placement. Rebind the Insert-only `config.core.snippet.next` / `config.core.snippet.previous` actions normally. See [editing behavior](editing.md#manual-lsp-completion). diff --git a/src/tui.rs b/src/tui.rs index 7f2cea8..5679108 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -5168,7 +5168,7 @@ fn draw_hover(frame: &mut Frame, hover: &Hover, area: Rect, panels: &mut WheelPa Constraint::Fill(1), Constraint::Length( area.height - .min(hover.lines().len().saturating_add(3).min(24) as u16), + .min(hover.lines().len().saturating_add(3).min(40) as u16), ), Constraint::Fill(1), ]) @@ -13510,7 +13510,7 @@ end fn hover_shows_more_documentation_with_markdown_and_fenced_code_colors() { let mut editor = Editor::open(None, vec![]).unwrap(); let title = format!("# {}TAIL", "Heading ".repeat(11)); - let details = (5..36) + let details = (5..60) .map(|row| format!("detail-{row:02}")) .collect::>() .join("\n"); @@ -13519,13 +13519,14 @@ end "{title}\n\n```rust\nfn answer() -> i32 {{ 42 }}\n```\n{details}" )) .unwrap(); - let mut terminal = Terminal::new(ratatui::backend::TestBackend::new(120, 32)).unwrap(); + let mut terminal = Terminal::new(ratatui::backend::TestBackend::new(120, 48)).unwrap(); let mut panels = WheelPanels::default(); terminal .draw(|frame| draw_hover(frame, editor.hover().unwrap(), frame.area(), &mut panels)) .unwrap(); assert!(screen_text(&terminal).contains("TAIL")); - assert!(screen_text(&terminal).contains("detail-20")); + assert!(screen_text(&terminal).contains("detail-36")); + assert!(!screen_text(&terminal).contains("detail-37")); let (panel, _) = panels.hover.unwrap(); let (x, y) = (panel.x + 1, panel.y + 1); let buffer = terminal.backend().buffer();