mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 20:03:48 -05:00
remove NERDTreeDirArrows option
Use +/~ for windows - which seems to not have the arrow chars in its default font. TBH I don't really understand this. Inprove the UI indent matching so that it should handle any combo of open/close symbol lengths e.g. the fancy arrows are 3 bytes each, whereas +/~ are 1 byte each.
This commit is contained in:
@@ -287,13 +287,11 @@ endfunction
|
||||
|
||||
"FUNCTION: s:UI._indentLevelFor(line) {{{1
|
||||
function! s:UI._indentLevelFor(line)
|
||||
let level = match(a:line, '[^ \-+~'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'`|]') / s:UI.IndentWid()
|
||||
" check if line includes arrows
|
||||
if match(a:line, '['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.']') > -1
|
||||
" decrement level as arrow uses 3 ascii chars
|
||||
let level = level - 1
|
||||
endif
|
||||
return level
|
||||
"have to do this work around because match() returns bytes, not chars
|
||||
let numLeadBytes = match(a:line, '\M\[^ '.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.']')
|
||||
let leadChars = strchars(a:line[0:numLeadBytes-1])
|
||||
|
||||
return leadChars / s:UI.IndentWid()
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:UI.IndentWid() {{{1
|
||||
|
||||
Reference in New Issue
Block a user