Browse files

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
  • Loading branch information...
guns authored and wincent committed Apr 9, 2012
1 parent e6e682d commit c23d31f549da344ba6ce38ef825fea761bcb6b8d
Showing with 1 addition and 0 deletions.
  1. +1 −0 ruby/command-t/match_window.rb
@@ -99,6 +99,7 @@ def initialize options = {}
::VIM::command "syntax match CommandTSelection \"^#{SELECTION_MARKER}.\\+$\""
::VIM::command 'syntax match CommandTNoEntries "^-- NO MATCHES --$"'
::VIM::command 'syntax match CommandTNoEntries "^-- NO SUCH FILE OR DIRECTORY --$"'
+ ::VIM::command 'setlocal synmaxcol=9999'
if VIM::has_conceal?
::VIM::command 'setlocal conceallevel=2'

0 comments on commit c23d31f

Please sign in to comment.