简体   繁体   中英

VIM highlight breaks on PHP regular expression

It breaks after scrolling up and down couple of times. I'm wondering if this is just happening to me or if anyone else has the same issue, and if there is anyway to fix it.

I have a string as:

preg_match_all("/<img.*?src=.([\/.a-z0-9@:_-]+).*?>/si", $str);

It's as if vim 7.4 has having problems with it's new regex engine. I've come to a quick fix searching for regex break under javascript. It basically tells vim to use the old regexengine (the fully tested one xD)

:set regexpengine=1
:syntax enable

Hope it helps, and here's the reference https://github.com/pangloss/vim-javascript/issues/93

This is happening to me too in v7.2.330. Not sure you're going to be able to fix it unless you dig into the PHP parser.

Maybe consider filing a bug with VIM?

-tjw

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM