feat: unify note display using virtual lines - #10
Merged
Conversation
Change M.refresh_buffer to use M.display_note_as_virtual_line instead of M.display_note, ensuring consistent display behavior between unnamed sessions and retrace mode. Notes now appear above the target line in both modes, improving visual consistency. This change: - Uses virt_lines_above for all note displays - Removes the eol (end-of-line) display mode - Shares the same rendering logic between sessions and retrace mode
Update note_lifecycle_spec.lua to verify virt_lines instead of virt_text, aligning test expectations with the new unified display behavior. Tests now check for virt_lines_above implementation in both note creation and update scenarios. Changes: - Replace virt_text checks with virt_lines checks - Update extmark data access pattern (virt_lines[1][1][1]) - Maintain test coverage for display functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR unifies the note display behavior between unnamed sessions and retrace mode by using virtual lines above the target line for both modes.
Previously, unnamed sessions displayed notes at the end of line (eol), while retrace mode displayed them above the target line using virtual lines. This inconsistency has been resolved by standardizing on the virtual lines approach.
Changes
Removed
display_notefunctionM.display_notefunction that displayed notes as end-of-line virtual textnote_moduledependencyM.refresh_bufferto useM.display_note_as_virtual_linefor all displaysUpdated tests
virt_linesinstead ofvirt_textdisplay_notefunctionclear_buffertests to usedisplay_note_as_virtual_lineBenefits
display_note_as_virtual_line)Test Results
All 307 tests pass:
Checklist