mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 20:03:48 -05:00
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:
@@ -61,7 +61,7 @@ function! s:Path.cacheDisplayString() abort
|
||||
endif
|
||||
|
||||
if self.isReadOnly
|
||||
let self.cachedDisplayString .= ' [RO]'
|
||||
let self.cachedDisplayString .= ' ['.g:NERDTreeGlyphReadOnly.']'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -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, ' {[^}]*}', "","")
|
||||
|
||||
Reference in New Issue
Block a user