6

I just wrote the following code in an answer to another question:

syntax match HideTwoIndents /\v^\t(\t)?/ conceal
set conceallevel=2

This works great if 'list' is set and if 'listchars' does not contain a value for tab:.

However, if 'list' is unset or if 'listchars' contains a value for tab: then if there are more than two tabs at the start of the line, the first two will be concealed as expected, but the third will be displayed as though it has a width of 3×'tabstop'!

e.g. after running:

syntax match HideTwoIndents /\v^\t(\t)?/ conceal
set conceallevel=2
set tabstop=2
set list
set listchars+=tab:xy

Then the line:

<tab><tab><tab>Three tabs

will be displayed correctly when the cursor is not on the line:

xyxyxyThree tabs

but will be displayed incorrectly when the cursor is on the line:

xyyyyyThree tabs

I would expect it to displayed as below:

xyThree tabs

Is this documented behaviour, or should it be reported as a bug?

  • 2
    looks like a bug – Christian Brabandt Dec 5 '17 at 12:14
  • 1
    @ChristianBrabandt Okay thanks I'll report. – Rich Dec 5 '17 at 12:21
0

I finally got around to posting this as a bug on Vim's issue tracker after stumbling across it in the Unanswered Questions section.

However, after a bit more investigation (which is included in the linked issue), I suspect that the problem is that the size/position of tabs is calculated before text is concealed, and that this issue will therefore be hard to address. I don't hold out too much hope that a fix is coming any time soon.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.