Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/nerdtree/bookmark.vim
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ function! s:Bookmark.str()
let pathStr = self.path.str({'format': 'UI'})
if strdisplaywidth(pathStr) > pathStrMaxLen
while strdisplaywidth(pathStr) > pathStrMaxLen && strchars(pathStr) > 0
let pathStr = strcharpart(pathStr, 1)
let pathStr = substitute(pathStr, '.\{1}', '', '')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the regex '^.' would be safer to use here. That guarantees it finds the first character.

endwhile
let pathStr = '<' . pathStr
endif
Expand Down
2 changes: 1 addition & 1 deletion lib/nerdtree/path.vim
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ function! s:Path.str(...)
let limit = options['truncateTo']
if strdisplaywidth(toReturn) > limit-1
while strdisplaywidth(toReturn) > limit-1 && strchars(toReturn) > 0
let toReturn = strcharpart(toReturn, 1)
let toReturn = substitute(toReturn, '.\{1}', '', '')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same regex comment here.

endwhile
if len(split(toReturn, '/')) > 1
let toReturn = '</' . join(split(toReturn, '/')[1:], '/') . '/'
Expand Down