Fix blame window heatmap alignment on resize #1462
Merged
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.
The right-side heatmap indicators (vertical bars) in the blame window stay at their original fixed column when the window is resized with
:wincmd >, causing them to appear misaligned in the middle of the expanded window.Changes
WinResizedautocmd to detect blame window resizes and trigger extmark repositioningupdate_right_extmarks()to recalculate window width and reposition heatmap extmarksset_right_extmark()helper to eliminate duplication between initial render and resize updateImplementation
Extmarks use
virt_text_win_colto position at a specific column. On resize:nvim_win_get_width(blm_win) - 1(0-indexed)virt_text_win_colpropertyPattern follows
current_line_blame.lua'sWinResizedhandling.Original prompt
This section details on the original issue you should resolve
<issue_title>blame window: right side extmarks stays untouched at
wincmd ></issue_title><issue_description>### Description
When increasing the width of the blame window (to see long commit titles) right side extmarks (I'm not sure if it's called heatmap) no longer keep to the right side.
Neovim version
v0.12.0-dev-1050+g9467731865
Operating system and version
Debian Sid
Expected behavior
Right side extmarks are snapped to the right on
WinResize.Actual behavior
See the description
Minimal config
--depth=1only - the rest is untouched.Steps to reproduce
nvim --clean -u init.lua gitsigns_issue/gitsigns/lua/gitsigns/signs.lua:Gitsigns blame:5wincmd >Gitsigns debug messages