简体   繁体   English

VIM高亮显示PHP正则表达式

[英]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. 好像vim 7.4的新regex引擎有问题。 I've come to a quick fix searching for regex break under javascript. 我来一个快速修复方法来搜索javascript下的正则表达式。 It basically tells vim to use the old regexengine (the fully tested one xD) 它基本上告诉vim使用旧的regexengine(经过全面测试的xD)

:set regexpengine=1
:syntax enable

Hope it helps, and here's the reference https://github.com/pangloss/vim-javascript/issues/93 希望对您有所帮助,这是参考https://github.com/pangloss/vim-javascript/issues/93

This is happening to me too in v7.2.330. v7.2.330中也发生了这种情况。 Not sure you're going to be able to fix it unless you dig into the PHP parser. 除非您深入研究PHP解析器,否则不确定是否将能够修复它。

Maybe consider filing a bug with VIM? 也许考虑向VIM提交错误?

-tjw -tjw

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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