mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 19:33:50 -05:00
cache display string
This commit is contained in:
@@ -1310,6 +1310,8 @@ function! s:oPath.New(fullpath) dict
|
|||||||
|
|
||||||
call newPath.ReadInfoFromDisk(a:fullpath)
|
call newPath.ReadInfoFromDisk(a:fullpath)
|
||||||
|
|
||||||
|
let newPath.cachedDisplayString = ""
|
||||||
|
|
||||||
return newPath
|
return newPath
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -1433,25 +1435,27 @@ endfunction
|
|||||||
"Return:
|
"Return:
|
||||||
"a string that can be used in the view to represent this path
|
"a string that can be used in the view to represent this path
|
||||||
function! s:oPath.StrDisplay() dict
|
function! s:oPath.StrDisplay() dict
|
||||||
let toReturn = self.GetLastPathComponent(1)
|
if self.cachedDisplayString == ""
|
||||||
|
let self.cachedDisplayString = self.GetLastPathComponent(1)
|
||||||
|
|
||||||
if self.isExecutable
|
if self.isExecutable
|
||||||
let toReturn = toReturn . '*'
|
let self.cachedDisplayString = self.cachedDisplayString . '*'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty(self.BookmarkNames())
|
||||||
|
let self.cachedDisplayString .= ' {' . join(self.BookmarkNames(), ',') . '}'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if self.isSymLink
|
||||||
|
let self.cachedDisplayString .= ' -> ' . self.symLinkDest
|
||||||
|
endif
|
||||||
|
|
||||||
|
if self.isReadOnly
|
||||||
|
let self.cachedDisplayString .= ' [RO]'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !empty(self.BookmarkNames())
|
return self.cachedDisplayString
|
||||||
let toReturn .= ' {' . join(self.BookmarkNames(), ',') . '}'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if self.isSymLink
|
|
||||||
let toReturn .= ' -> ' . self.symLinkDest
|
|
||||||
endif
|
|
||||||
|
|
||||||
if self.isReadOnly
|
|
||||||
let toReturn .= ' [RO]'
|
|
||||||
endif
|
|
||||||
|
|
||||||
return toReturn
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: oPath.StrForEditCmd() {{{3
|
"FUNCTION: oPath.StrForEditCmd() {{{3
|
||||||
|
|||||||
Reference in New Issue
Block a user