[vim/vim] Use LineNr and CursorLineNr on folded line number column, and use Cur… (PR #10733)

62 views
Skip to first unread message

Zhern

unread,
Jul 13, 2022, 10:02:03 AM7/13/22
to vim/vim, Subscribed

This is a modification of the Folded line highlight rules:

  • use of LineNr and CursorLineNr on folded line number column
  • use of CursorLine on folded line

This enables a more consistent look and feel when extensively using folds (e.g. when displaying a tree structure).


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/10733

Commit Summary

  • 99947fa Use LineNr and CursorLineNr on folded line number column, and use CursorLine on folded lines

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733@github.com>

Zhern

unread,
Jul 19, 2022, 7:02:29 AM7/19/22
to vim/vim, Push

@Zhern pushed 1 commit.

  • e523477 Combine Folded and CursorLine highlight patterns


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/push/10481208634@github.com>

Bram Moolenaar

unread,
Jul 22, 2022, 3:12:25 PM7/22/22
to vim/vim, Subscribed

How about a screenshot to show the difference?
I wonder if this will have backwards compatibility problems.

You can't declare a variable halfway a block in ANSI C, which we use.

There should be a test for this. Perhaps an existing test will fail? I just triggered CI.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/c1192862917@github.com>

Zhern

unread,
Jul 25, 2022, 4:45:06 AM7/25/22
to vim/vim, Subscribed

image

In both instances I used fdm=marker and I focus on line 3 (b).
On the left is the modified version: the line 3 highlight is different from line 4 (also a fold) because it is the current one, and the current column number line (in blue) is using the CursorLineNR highlight pattern.
On the right is the standard version: the line 3 highlight is the same as line 4 (both are folds) even if I am focusing on line 3, and the current column number line is not using the CursorLineNR highlight pattern.

I admit that it is not possible to achieve the old highlight behavior with my version, maybe would it be preferable to use new highlight pattern names like FoldedCursorLineNR and FoldedCursorLine?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/c1193761075@github.com>

Zhern

unread,
Jul 25, 2022, 4:55:33 AM7/25/22
to vim/vim, Push

@Zhern pushed 1 commit.

  • 9939db8 Declare new variables names at the beginning of the function

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/push/10535108625@github.com>

Zhern

unread,
Jul 25, 2022, 9:35:05 AM7/25/22
to vim/vim, Push

@Zhern pushed 1 commit.

  • 5ed43bf Set folded sign to the sign of the first folded line

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/push/10537764808@github.com>

Zhern

unread,
Jul 25, 2022, 9:41:44 AM7/25/22
to vim/vim, Subscribed

I also added the display of the sign of the first folded line: on the left is the new behavior, on the right the standard version.

  • Not folded:
    image
  • Folded:
    image


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/c1194062482@github.com>

Zhern

unread,
Jul 25, 2022, 9:44:14 AM7/25/22
to vim/vim, Subscribed

However I am not sure how to make a test for this fold-highlight-sign stuff, I will look at existing ones when I have time.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/c1194064173@github.com>

Zhern

unread,
Jul 27, 2022, 3:21:57 AM7/27/22
to vim/vim, Push

@Zhern pushed 4 commits.

  • 9107d33 Use LineNr and CursorLineNr on folded line number column, and use CursorLine on folded lines
  • 2916991 Combine Folded and CursorLine highlight patterns
  • 615be93 Declare new variables names at the beginning of the function
  • a8c6834 Set folded sign to the sign of the first folded line

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/push/10557013725@github.com>

Zhern

unread,
Aug 3, 2022, 6:19:06 AM8/3/22
to vim/vim, Push

@Zhern pushed 4 commits.

  • 545a053 Use LineNr and CursorLineNr on folded line number column, and use CursorLine on folded lines
  • 3ae09ee Combine Folded and CursorLine highlight patterns
  • 467aa50 Declare new variables names at the beginning of the function
  • 7f8d356 Set folded sign to the sign of the first folded line

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/push/10623987099@github.com>

codecov[bot]

unread,
Aug 3, 2022, 4:22:43 PM8/3/22
to vim/vim, Subscribed

Codecov Report

Merging #10733 (7f8d356) into master (0b0ccbb) will decrease coverage by 4.76%.
The diff coverage is 5.55%.

@@            Coverage Diff             @@

##           master   #10733      +/-   ##

==========================================

- Coverage   81.77%   77.01%   -4.77%     

==========================================

  Files         158      148      -10     

  Lines      186077   147339   -38738     

  Branches    42067    38459    -3608     

==========================================

- Hits       152173   113470   -38703     

- Misses      21419    22117     +698     

+ Partials    12485    11752     -733     
Flag Coverage Δ
huge-clang-none ?
linux ?
mingw-x64-HUGE 0.00% <0.00%> (ø)
mingw-x64-HUGE-gui 78.23% <5.88%> (-0.02%) ⬇️
windows 77.01% <5.55%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/drawscreen.c 65.60% <5.55%> (-14.47%) ⬇️
src/xdiff/xpatience.c 0.00% <0.00%> (-81.99%) ⬇️
src/xdiff/xhistogram.c 0.00% <0.00%> (-72.42%) ⬇️
src/hardcopy.c 10.87% <0.00%> (-66.40%) ⬇️
src/if_cscope.c 4.88% <0.00%> (-63.78%) ⬇️
src/beval.c 1.62% <0.00%> (-60.97%) ⬇️
src/libvterm/src/mouse.c 0.00% <0.00%> (-41.94%) ⬇️
src/debugger.c 49.39% <0.00%> (-40.38%) ⬇️
src/sound.c 28.26% <0.00%> (-36.11%) ⬇️
src/mouse.c 49.00% <0.00%> (-30.07%) ⬇️
... and 139 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/c1204435532@github.com>

Bram Moolenaar

unread,
Aug 5, 2022, 7:15:33 AM8/5/22
to vim/vim, Subscribed

There is a failing test that seems related to the change. Also perhaps a hint on how to test the change.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/c1206332095@github.com>

Zhern

unread,
Dec 2, 2022, 5:27:46 AM12/2/22
to vim/vim, Subscribed

I don't think I will have time to continue this. I close the PR and will perhaps reopen it later when I have progressed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/c1335044297@github.com>

Zhern

unread,
Dec 2, 2022, 5:27:47 AM12/2/22
to vim/vim, Subscribed

Closed #10733.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10733/issue_event/7939481528@github.com>

Reply all
Reply to author
Forward
0 new messages