Improve three highlighting rules
The highlighting rules "NERDTreeClosable" and "NERDTreeOpenable" did not recognize files beginning with a "~" character. This caused bad highlighting on systems that use "~" and "+" for the dir arrow symbols by default. Making these rules more specific solves this problem. The "~" characters in quickhelp section titles also would get confused with a custom mapping for "~". Adjusting the "NERDTreeHelpTitle" solved this problem. I also changed the quickhelp title in a minor way to reflect the proper spelling of "NERDTree".
This commit is contained in:
parent
5af263c2df
commit
d68c9abca8
@ -21,7 +21,7 @@ endfunction
|
|||||||
"prints out the quick help
|
"prints out the quick help
|
||||||
function! s:UI._dumpHelp()
|
function! s:UI._dumpHelp()
|
||||||
if self.getShowHelp()
|
if self.getShowHelp()
|
||||||
let help = "\" NERD tree (" . nerdtree#version() . ") quickhelp~\n"
|
let help = "\" NERDTree (" . nerdtree#version() . ") quickhelp~\n"
|
||||||
let help .= "\" ============================\n"
|
let help .= "\" ============================\n"
|
||||||
let help .= "\" File node mappings~\n"
|
let help .= "\" File node mappings~\n"
|
||||||
let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
||||||
|
@ -8,7 +8,7 @@ execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#"
|
|||||||
"quickhelp syntax elements
|
"quickhelp syntax elements
|
||||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#ms=s+2,me=e-1
|
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#ms=s+2,me=e-1
|
||||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#ms=s+2,me=e-1
|
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#ms=s+2,me=e-1
|
||||||
syn match NERDTreeHelpTitle #" .*\~#ms=s+2,me=e-1
|
syn match NERDTreeHelpTitle #" .*\~$#ms=s+2,me=e-1
|
||||||
syn match NERDTreeToggleOn #(on)#ms=s+1,he=e-1
|
syn match NERDTreeToggleOn #(on)#ms=s+1,he=e-1
|
||||||
syn match NERDTreeToggleOff #(off)#ms=e-3,me=e-1
|
syn match NERDTreeToggleOff #(off)#ms=e-3,me=e-1
|
||||||
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
|
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
|
||||||
@ -22,8 +22,8 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
|
|||||||
"highlighing for directory nodes and file nodes
|
"highlighing for directory nodes and file nodes
|
||||||
syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
|
syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
|
||||||
|
|
||||||
exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
exec 'syn match NERDTreeClosable #' . escape(g:NERDTreeDirArrowCollapsible, '~') . '\ze .*/# containedin=NERDTreeDir,NERDTreeFile'
|
||||||
exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile'
|
exec 'syn match NERDTreeOpenable #' . escape(g:NERDTreeDirArrowExpandable, '~') . '\ze .*/# containedin=NERDTreeDir,NERDTreeFile'
|
||||||
|
|
||||||
let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~]\-').escape(g:NERDTreeDirArrowExpandable, '~]\-')
|
let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~]\-').escape(g:NERDTreeDirArrowExpandable, '~]\-')
|
||||||
exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#'
|
exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#'
|
||||||
|
Loading…
Reference in New Issue
Block a user