[vim/vim] Fix color column position when 'linebreak' is set (PR #17477)

31 views
Skip to first unread message

Matthias

unread,
Jun 8, 2025, 3:45:38 PM6/8/25
to vim/vim, Subscribed

As reported in #16837 the 'colorcolumn' option does not behave as
expected, when the 'linebreak' option is set. Instead of always
highlighting the same character independent of the window's width, the
highlighted character changes with changing window sizes.

Furthermore, the color column ignored the inserted "virtual text" that
comes with the 'showbreak' option. This resulted in the color column
possibly highlighting the text inserted by the 'showbreak' option
instead of actual, user inserted text. Now, this "virtual text" is
ignored when determining the color column's position.


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

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

Commit Summary

  • 8b068a1 Fix `colorcolumn` when `linebreak` is on
  • be04aa0 Fix color column for leading tabs
  • ee2e6eb Fix `linebreak` + `colorcolumn` edge case
  • f76e1d0 Fix showbreak and cursorcolumn

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/17477@github.com>

Matthias

unread,
Jun 8, 2025, 3:46:42 PM6/8/25
to vim/vim, Subscribed
matrdr left a comment (vim/vim#17477)

I still need to add at least one new test, fix the old tests and touch up the code a bit. So, please do not merge yet.


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/17477/c2954245112@github.com>

Matthias

unread,
Jun 9, 2025, 7:47:12 AM6/9/25
to vim/vim, Push

@matrdr pushed 1 commit.

  • f1642f8 Change expected 'conceal' test results


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17477/before/f76e1d061f956b76b944f2cc031c6fa46dc9be72/after/f1642f8f5771c18768dd508948a5997d3e1425c1@github.com>

Maxim Kim

unread,
Jun 9, 2025, 8:00:08 AM6/9/25
to vim/vim, Subscribed
habamax left a comment (vim/vim#17477)

Could you show a screenshot with several long lines (~200 chars) and set colorcolumn=20,40,60,80,100,120?

image.png (view on web)


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/17477/c2955583600@github.com>

Maxim Kim

unread,
Jun 9, 2025, 8:05:38 AM6/9/25
to vim/vim, Subscribed
habamax left a comment (vim/vim#17477)

oh, nevermind I see what you try to fix now!


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/17477/c2955596361@github.com>

Christian Brabandt

unread,
Jun 9, 2025, 9:49:24 AM6/9/25
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#17477)

converting to draft for now. Thanks


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/17477/c2955851685@github.com>

Matthias

unread,
Jun 9, 2025, 11:32:41 AM6/9/25
to vim/vim, Push

@matrdr pushed 1 commit.

  • cd9fde4 Change expectation in color column test

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17477/before/f1642f8f5771c18768dd508948a5997d3e1425c1/after/cd9fde45730c8d1c703e49408c837583ed6f13b1@github.com>

Matthias

unread,
Jun 9, 2025, 11:33:07 AM6/9/25
to vim/vim, Push

@matrdr pushed 6 commits.

  • 5712911 Fix `colorcolumn` when `linebreak` is on
  • 1fa3429 Fix color column for leading tabs
  • b291fcd Fix `linebreak` + `colorcolumn` edge case
  • 9d20f13 Fix showbreak and cursorcolumn
  • 7537365 Change expected 'conceal' test results
  • 74763a7 Change expectation in color column test

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17477/before/cd9fde45730c8d1c703e49408c837583ed6f13b1/after/74763a77a98c91ba551287d7465845fd9689a52f@github.com>

Matthias

unread,
Aug 17, 2025, 4:55:01 AM8/17/25
to vim/vim, Push

@matrdr pushed 6 commits.

  • 05adff9 Fix `colorcolumn` when `linebreak` is on
  • ad3c26d Fix color column for leading tabs
  • aa8a928 Fix `linebreak` + `colorcolumn` edge case
  • 6499a35 Fix showbreak and cursorcolumn
  • 0312275 Change expected 'conceal' test results
  • 5008cf0 Change expectation in color column test

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17477/before/74763a77a98c91ba551287d7465845fd9689a52f/after/5008cf0b480edf14c7e24f4e58f356d45c1f3095@github.com>

Matthias

unread,
Dec 31, 2025, 10:06:49 AM12/31/25
to vim/vim, Push

@matrdr pushed 6 commits.

  • 36fffda Fix `colorcolumn` when `linebreak` is on
  • 50442da Fix color column for leading tabs
  • 2796a81 Fix `linebreak` + `colorcolumn` edge case
  • 36edd39 Fix showbreak and cursorcolumn
  • d67c08a Change expected 'conceal' test results
  • 8e2b16e Change expectation in color column test

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17477/before/5008cf0b480edf14c7e24f4e58f356d45c1f3095/after/8e2b16e75ebca6ff4a6a4af24e62a00e2b06c9d0@github.com>

Matthias

unread,
Jan 1, 2026, 5:52:17 AMJan 1
to vim/vim, Push

@matrdr pushed 1 commit.

  • 4c0b4db Fix showbreak text being "colorcolumned"

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17477/before/8e2b16e75ebca6ff4a6a4af24e62a00e2b06c9d0/after/4c0b4db5fda962b8c80cd2cc7d428615353afa0a@github.com>

Matthias

unread,
Jan 1, 2026, 5:59:09 AMJan 1
to vim/vim, Subscribed
matrdr left a comment (vim/vim#17477)

Getting back to this PR again. It seems like I need to change a few existing test cases, as their behaviour does not match the one I would expect. For example, the test case Test_colorcolumn_sbr expects the color columns to be on the showbreak characters, as seen in the upper output. With this fix, the behaviour is the one seen in the lower output, which I think is more in line with how a color column shall work, when the line is wrapped.

image.png (view on web)


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/17477/c3703541387@github.com>

Matthias

unread,
Jan 1, 2026, 9:16:06 AMJan 1
to vim/vim, Push

@matrdr pushed 9 commits.

  • 5a3015a Fix `colorcolumn` when `linebreak` is on
  • b4cc11f Fix color column for leading tabs
  • 5980809 Fix `linebreak` + `colorcolumn` edge case
  • 04ab76c Fix showbreak and cursorcolumn
  • 9fc85bb Change expected 'conceal' test results
  • 005d3bc Change expectation in color column test
  • 1812524 Fix showbreak text being "colorcolumned"
  • 50bf0cb Fix indentation
  • 2e60952 Change expected result in colorcolumn test case

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17477/before/4c0b4db5fda962b8c80cd2cc7d428615353afa0a/after/2e60952a62b61186c122c9641532d75d6fce5e17@github.com>

Christian Brabandt

unread,
Jun 13, 2026, 4:09:25 PM (10 hours ago) Jun 13
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#17477)

this has stalled, so closing


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17477/c4699650539@github.com>

Reply all
Reply to author
Forward
0 new messages