Skip to content

feat: Align note display with code indentation#14

Merged
ushmz merged 1 commit into
mainfrom
feat/align-note-display-with-indent
Dec 13, 2025
Merged

feat: Align note display with code indentation#14
ushmz merged 1 commit into
mainfrom
feat/align-note-display-with-indent

Conversation

@ushmz

@ushmz ushmz commented Dec 13, 2025

Copy link
Copy Markdown
Owner

Summary

Improved the visual alignment of note displays by matching the indentation of the code they're attached to.

Changes:

  • Note virtual lines now use the same indentation as the target line
  • Removed "Note: " prefix for cleaner, more minimal display
  • Notes visually blend with the code structure while remaining distinct through highlighting

Visual comparison

Before:

Note: This is a function
      Second line of note
    function foo()
      local x = 1
    end

After:

    This is a function
    Second line of note
    function foo()
      local x = 1
    end

Implementation

Modified display_note_as_virtual_line() in lua/tabi/ui/display.lua:

  • Extract leading whitespace from the target line using pattern matching (^%s*)
  • Apply the same indentation to all virtual line content
  • Removed conditional prefix logic

Test plan

  • All 364 existing tests pass
  • luacheck and stylua checks pass
  • Manual testing: Notes align correctly with various indentation levels
  • Manual testing: Multi-line notes maintain consistent indentation

Note virtual lines now match the indentation of the line they're
attached to, making them visually aligned with the code structure.

Changes:
- Extract leading whitespace from the target line
- Apply the same indentation to all note virtual lines
- Remove "Note: " prefix for cleaner display

Before:
Note: This is a note
      Second line
    function foo()

After:
    This is a note
    Second line
    function foo()
@ushmz ushmz changed the title Align note display with code indentation feat: Align note display with code indentation Dec 13, 2025
@ushmz ushmz merged commit 7b4844f into main Dec 13, 2025
4 checks passed
@ushmz ushmz deleted the feat/align-note-display-with-indent branch December 13, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant