From: Alexandre Constantino Date: Thu, 4 Feb 2016 11:32:20 +0000 (+0000) Subject: Add comment on non-greedy match X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/0df976288d54c7e5c5d0e92addd7419b3b8f71f6?ds=inline Add comment on non-greedy match --- diff --git a/syntax/markdown.vim b/syntax/markdown.vim index a897f60..994de6b 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -51,6 +51,7 @@ if get(g:, "vim_markdown_emphasis_multiline", 1) syn region htmlBoldItalic start="___\ze\S" end="\S\zs___" keepend else " single-line emphasis (emphasis only works with closing token on the same line) + " the following character makes the match non-greedy: vv syn region htmlItalic start="\%(^\|\s\)\zs\*\ze[^\\\*\t ]\([^\n\*]*[^\\\*\t ]\)\?\*" end="[^\\\*\t ]\zs\*\ze\_W" keepend syn region htmlItalic start="\%(^\|\s\)\zs_\ze[^\\_\t ]\([^\n_]*[^\\_\t ]\)\?_" end="[^\\_\t ]\zs_\ze\_W" keepend syn region htmlBold start="\*\*\ze\S\([^\n\*]*[^\\\*\t ]\)\?\*\*" end="\S\zs\*\*" keepend