Define a syntax region which depends on the indentation level

﹥>﹥吖頭↗ 提交于 2019-12-04 13:00:26

By matching the text before the :: as the region's start, you're indeed preventing other syntax rules from applying there. I would solve this by positive lookbehind; i.e. only assert the rules for the text before the ::, without including it in the match. With this, you even don't need the ms=e-1, as the only thing that gets matched for the region start is the :: itself:

syn region rstLiteralBlock  start=/\%(^\%(\.\.\)\@!\z(\s*\).*\)\@<=::$/ skip=/^$/ end=/^\z1\S/me=e-1

The indentation will still be captured by the \z(...\).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!