Allow user-defined RO indicator.

(inspired by overwriting g:NERDTreeDirArrowCollapsible/Expandable)

Replace instances of the RO string with a variable that the user can
override. Useful for custom unicode glyphs, i.e. Font Awesome.

* Initialize variable g:NERDTreeGlyphReadOnly = "RO".
   -> plugin/NERD_tree.vim
* Replace instances of 'RO' with g:NERDTreeGlyphReadOnly
This commit is contained in:
Alex Carlson
2016-02-26 17:57:40 -08:00
parent 4ebbb533c3
commit dfb9111786
4 changed files with 6 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ function! s:Path.cacheDisplayString() abort
endif
if self.isReadOnly
let self.cachedDisplayString .= ' [RO]'
let self.cachedDisplayString .= ' ['.g:NERDTreeGlyphReadOnly.']'
endif
endfunction

View File

@@ -375,7 +375,7 @@ function! s:UI._stripMarkup(line, removeLeadingSpaces)
let line = substitute (line, g:NERDTreeUI.MarkupReg(),"","")
"strip off any read only flag
let line = substitute (line, ' \[RO\]', "","")
exec 'let line = substitute (line, " \['.g:NERDTreeGlyphReadOnly.'\]", "","")'
"strip off any bookmark flags
let line = substitute (line, ' {[^}]*}', "","")