[Bug 1019613] New: vim yaml syntax highlighting super-slow with long words
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613 Bug ID: 1019613 Summary: vim yaml syntax highlighting super-slow with long words Classification: openSUSE Product: openSUSE Distribution Version: Leap 42.2 Hardware: x86-64 OS: openSUSE 42.1 Status: NEW Severity: Normal Priority: P5 - None Component: Development Assignee: idonmez@suse.com Reporter: bwiedemann@suse.com QA Contact: qa-bugs@suse.de Found By: Development Blocker: --- Created attachment 709822 --> http://bugzilla.opensuse.org/attachment.cgi?id=709822&action=edit short example yaml I was pasting my 7-line ssh public key into a yaml file and could not use vim anymore, because inserting or deleting a character in that long single-word line took over a minute where vim used 100% CPU the attached example file is shortened to not make it quite as bad yet, but you are invited to add some extra 200 non-space characters in there. Workaround: :syn off -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613#c1
Ismail Donmez
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613#c2
--- Comment #2 from Bernhard Wiedemann
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613#c3
Ismail Donmez
found that commenting out /usr/share/vim/vim74/syntax/yaml.vim:113 avoids the issue: "execute 'syn match yamlBlockMappingKey /\s*\zs'.s:ns_plain_out.'\ze\s*:\%(\s\|$\)/ contained '. " \'nextgroup=yamlKeyValueDelimiter'
so maybe drop or optimize that regexp together with upstream to not be O(n^2) or even O(2^n) ?
The problem seems to be the new regexp engine. Since you did the most of the work, I'll contact upstream to see if it's possible to fix regexp or the engine. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613#c4
--- Comment #4 from Ismail Donmez
(In reply to Bernhard Wiedemann from comment #2)
found that commenting out /usr/share/vim/vim74/syntax/yaml.vim:113 avoids the issue: "execute 'syn match yamlBlockMappingKey /\s*\zs'.s:ns_plain_out.'\ze\s*:\%(\s\|$\)/ contained '. " \'nextgroup=yamlKeyValueDelimiter'
so maybe drop or optimize that regexp together with upstream to not be O(n^2) or even O(2^n) ?
The problem seems to be the new regexp engine. Since you did the most of the work, I'll contact upstream to see if it's possible to fix regexp or the engine.
Can you try the diff in https://github.com/chase/vim-ansible-yaml/issues/11#issuecomment-65472625 ? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613#c5
--- Comment #5 from Bernhard Wiedemann
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613#c6
--- Comment #6 from Ismail Donmez
Applying the diff makes it work fast and adding set re=1 to my .vimrc also makes it fast
set re=1 is a bigger hammer so I'll apply the patch as a workaround. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613
http://bugzilla.opensuse.org/show_bug.cgi?id=1019613#c7
Ismail Donmez
participants (1)
-
bugzilla_noreply@novell.com