From 8c8c794104246d0d4f65cf23bc8bbb3722b4c3c2 Mon Sep 17 00:00:00 2001 From: Igor Tatarintsev Date: Tue, 15 Sep 2015 23:22:14 +0600 Subject: [PATCH] Added character escaping to syn match regexes --- syntax/nerdtree.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntax/nerdtree.vim b/syntax/nerdtree.vim index fd548cf..a48445a 100644 --- a/syntax/nerdtree.vim +++ b/syntax/nerdtree.vim @@ -23,10 +23,10 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir syn match NERDTreeDirSlash #/# containedin=NERDTreeDir if g:NERDTreeDirArrows - exec 'syn match NERDTreeClosable #'.g:NERDTreeDirArrowCollapsible.'# containedin=NERDTreeDir,NERDTreeFile' - exec 'syn match NERDTreeOpenable #'.g:NERDTreeDirArrowExpandable.'# containedin=NERDTreeDir,NERDTreeFile' + exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile' + exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile' - let s:dirArrows = g:NERDTreeDirArrowCollapsible.g:NERDTreeDirArrowExpandable + let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~').escape(g:NERDTreeDirArrowExpandable, '~') exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#' syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile'