-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines #21768
Conversation
0dd3e35
to
a3d0e04
Compare
I guess this actually revealed an issue, only tested with diff-mode filler lines before. Now we also rebuild the statuscolumn for the first wrapped line after filler lines. |
It's hard to tell from the test, but |
Hmm ok maybe, but we need to make sure |
Not really.
Yes |
ProposalRename
User can check that Alternatively we could set it to |
a3d0e04
to
54dc0ac
Compare
54dc0ac
to
10d9b49
Compare
f3a28de
to
6f20bca
Compare
Do we need |
This change is probably to small to mention as these variables aren't mentioned either. |
6f20bca
to
22a65ac
Compare
22a65ac
to
81d2154
Compare
1b9ab1f
to
582be0e
Compare
Problem: The `'statuscolumn'` was not re-evaluated for wrapped lines, when preceded by virtual/filler lines. There was also no way to distinguish virtual and wrapped lines in the status column. Solution: Make sure to rebuild the statuscolumn, and replace variable `v:wrap` with `v:virtnum`. `v:virtnum` is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.
878dbff
to
e627053
Compare
e627053 fixes this issue #21768 (comment). It might be better discussed in a separate PR but it depends on this so I added it here. |
e627053
to
b63ac31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
b63ac31
to
a4dc81d
Compare
Problem: The default fold column, as well as the 'statuscolumn', were drawn unnecessarily/unexpectedly for virtual lines placed with `virt_lines_leftcol` set. Solution: Skip the column states if a virtual line with `virt_lines_leftcol` set will be drawn.
a4dc81d
to
5447033
Compare
This could be nice to have actually. I am trying to do a different action depending on the relative wrapped line position to the actual buffer line. Also, it would not be breaking change. |
I would be okay with this. It would mean 'statuscolumn' is re-evaluated for each line in the window, currently it is only re-evaluated once for filler lines above the buffer line, once for the buffer line itself, and once for the wrapped lines below. So there would be a performance hit as well, but not compared to buffers where 'wrap' is disabled anyways. So not something we have to worry about I think. |
fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines
Problem: The
'statuscolumn'
was not re-evaluated for wrapped lines, when preceded by virtual/filler lines. There was also no way to distinguish virtual and wrapped lines in the status column.Solution: Make sure to rebuild the statuscolumn, and replace variable
v:wrap
withv:virtnum
.v:virtnum
is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.Also resolve a memory leak when returning from
win_line()
bybreak
ing instead ofreturn
ing.fix(column): avoid drawing columns for virt_lines_leftcol
Problem: The default fold column, as well as the 'statuscolumn', were drawn unnecessarily/unexpectedly for virtual lines placed with
virt_lines_leftcol
set.Solution: Skip the column states if a virtual line with
virt_lines_leftcol
set will be drawn.