darlingm / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

Malformed YAML hogs CPU for a long time #263

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. take puppet (ruby) source code (*) and either paste it into open YAML file, 
insert it there with :r or rename the puppet file to *.yml and open it with vi
2. wait for a **long** time while vi spins CPU
......
3. Finally "pkill -9 vi" from another terminal because it's still unresponsive

(*) The problem might be specific to a code where YAML tries to parse regexps 
or st. like that. This is a file that causes several second hangup, by adding 
characters to 'baz' string the lag increases dramatically:

> cat test.yml 
class foo {
        bar {
                baz             => "aaaaaaaaaaaaaaaa+bbbbbbbbbbbbbb+cccccccccccccc/dddddddddddddd+/eeeeeeeeeeeeee+ff/ggggggggggggg/hhhhhhhhhhhhhh/jjjj+kk+lllllllllllll/mmmmmmmmmmmmmm//nnnnnnnnnnnn+ooooooooooooooo=",
        }
}

What version of the product are you using? On what operating system?

Ubuntu 14.04.1 LTS - 2:7.4.052-1ubuntu3

Debian GNU/Linux jessie/sid - 2:7.4.430-1

Ubuntu 12.04.5 LTS - 2:7.3.429-2ubuntu2.1 - this one shows much less lag, but 
this might be caused by the fact that it's a desktop system unlike previous two.

Original issue reported on code.google.com by krystof1...@gmail.com on 7 Oct 2014 at 1:42

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like the yamlFlowMappingKey syntax item is taking too long. Please report 
the issue to the maintainer of the file. I suggest, adding '\%#=1' to that 
syntax item to switch for that pattern to the old engine. That seems to make 
vim more responsive.

The maintainer can then an updated syntax file to Bram for inclusion with Vim.

Original comment by chrisbr...@googlemail.com on 7 Oct 2014 at 2:42