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

Set synmaxcol to avoid match highlighting errors #43

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@guns
Copy link
Contributor

guns commented Apr 9, 2012

The new match highlight feature uses as conceal
markers per match. If the user has set a low synmaxcol (in order to
speed up syntax highlighting in files with long lines), the concealed
markers can quickly bring the character count of the line past the
synmaxcol value, causing all markers past the value to be shown.

This can be demonstrated by setting a low synmaxcol, then opening a new
match window in this project's root:

:set synmaxcol=20 | CommandT

" Search for //

fixtures/bar/abc
fixtures/bar/xyz
fixtures/foo/beta

Set synmaxcol to avoid match highlighting errors
The new match highlight feature uses <commandt></commandt> as conceal
markers per match. If the user has set a low synmaxcol (in order to
speed up syntax highlighting in files with long lines), the concealed
markers can quickly bring the character count of the line past the
synmaxcol value, causing all markers past the value to be shown.

This can be demonstrated by setting a low synmaxcol, then opening a new
match window in this project's root:

:set synmaxcol=20 | CommandT

" Search for `//`

> fixtures/bar/abc
  fixtures/</commandt>bar<commandt>/</commandt>xyz
  fixtures/</commandt>foo<commandt>/</commandt>beta
@wincent

This comment has been minimized.

Copy link
Owner

wincent commented Apr 9, 2012

Thanks for this. I hadn't run into this myself, so I'll check it out.

@guns

This comment has been minimized.

Copy link
Contributor Author

guns commented Apr 9, 2012

I set synmaxcol=160, which is long enough to cover most reasonable
code bases while still being able to avoid a total lock-up from
accidentally opening a 100k single line xml file.

It was the strangest error, because things only started breaking after
typing six characters!

@wincent

This comment has been minimized.

Copy link
Owner

wincent commented Apr 10, 2012

I've merged the pull request now. Thanks once again.

@wincent wincent closed this Apr 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment