Skip to content
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

goSpaceError syntax hilighting very slow on long lines #449

chkno opened this issue May 31, 2015 · 3 comments

goSpaceError syntax hilighting very slow on long lines #449

chkno opened this issue May 31, 2015 · 3 comments


Copy link

@chkno chkno commented May 31, 2015

This rule is slow on long lines:

syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"

To reproduce:

  1. Begin editing a new file foo.vim.
  2. Create 5000 spaces (5000i<space><esc>)
  3. Attempt to add a 5001th space or otherwise attempt to edit this line. Every UI interaction incurs a ~10s lag.

Output from ":syntime report":

19.232237   2      0      10.416958    9.616119  goSpaceError       \(\(^\|[={(,;]\)\s*<
 0.021542   2      0       0.011089    0.010771  goSpaceError       \(\<chan\)\@<=\s\+\(
 0.017746   2      0       0.008958    0.008873  goSpaceError       \(<-\)\@<=\s\+\(chan
Copy link

@fatih fatih commented Jun 3, 2015

Hi @chkno , I'm aware of it, that's why it's disabled by default. If you disable it:

let g:go_highlight_space_tab_error = 0
let g:go_highlight_array_whitespace_error = 0
let g:go_highlight_trailing_whitespace_error = 0

You are good to go. Unfortunately I don't have time to tackle the syntax file. Also I have some settings which speeds up the highlighting a little more:

" speed up syntax highlighting
set nocursorcolumn
set nocursorline
syntax sync minlines=256
set synmaxcol=300
set re=1

Does this improve your situation?

Copy link

@fatih fatih commented Jun 25, 2015

Any response on this?

Copy link

@fatih fatih commented Jul 6, 2015

Closing as I didn't get a response for over 1 month.

@fatih fatih closed this Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.