Skip to content

feat(panel): add mark_placement option for selection marks location#90

Merged
dlyongemallo merged 1 commit intomainfrom
add_option_for_selection_marks_placement
Apr 8, 2026
Merged

feat(panel): add mark_placement option for selection marks location#90
dlyongemallo merged 1 commit intomainfrom
add_option_for_selection_marks_placement

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

Relates to #70 (comment).

Copilot AI review requested due to automatic review settings April 8, 2026 08:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new file_panel.mark_placement configuration option to control whether selection marks are rendered inline (current behavior) or placed in the sign column to avoid text alignment shifts in the file panel.

Changes:

  • Introduces file_panel.mark_placement = "inline" | "sign_column" with documentation and default config updates.
  • Updates diff view panel rendering to suppress inline marks in sign_column mode and instead place selection marks via sign extmarks.
  • Adds functional tests covering config persistence and sign-column mark behavior for file entries.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lua/diffview/ui/panel.lua Uses :redraw() on WinResized to ensure post-render steps run on resize.
lua/diffview/scene/views/diff/render.lua Implements mark_placement handling and sign-column extmark placement for selection marks.
lua/diffview/scene/views/diff/file_panel.lua Overrides :redraw() to place selection signs after buffer render.
lua/diffview/config.lua Adds the file_panel.mark_placement default.
doc/diffview.txt Documents the new mark_placement option.
doc/diffview_defaults.txt Updates defaults listing to include mark_placement.
lua/diffview/tests/functional/panel_render_spec.lua Adds functional tests for inline vs sign-column selection mark rendering.
lua/diffview/tests/functional/config_options_spec.lua Adds config option tests for mark_placement default and persistence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/diffview/scene/views/diff/render.lua Outdated
Comment thread lua/diffview/scene/views/diff/render.lua
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/diffview/tests/functional/panel_render_spec.lua Outdated
@dlyongemallo dlyongemallo force-pushed the add_option_for_selection_marks_placement branch from 0e08ce7 to 42bf2ef Compare April 8, 2026 09:32
@jakubbortlik
Copy link
Copy Markdown

Hi David, I've tested the configuration and it works very well. The only thing is that when I use a wide character, it gets crammed very tight to the modification letter so that it makes some of the letters a little difficult to read:
image
It would be nice if there was a little padding, but if that would be anything more than trivial to implement, then just forget it -- it's usable and useful as it is. Thanks!

@dlyongemallo dlyongemallo force-pushed the add_option_for_selection_marks_placement branch from 42bf2ef to 7bf5648 Compare April 8, 2026 23:14
@dlyongemallo dlyongemallo requested a review from Copilot April 8, 2026 23:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dlyongemallo dlyongemallo merged commit 5844415 into main Apr 8, 2026
6 checks passed
@dlyongemallo dlyongemallo deleted the add_option_for_selection_marks_placement branch April 8, 2026 23:29
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.

3 participants