mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
add .refreshFlags() to path/dir/file objects
This will trigger the path refresh callbacks without refreshing the path's from disk (which takes ages)
This commit is contained in:
@@ -544,6 +544,12 @@ function! s:Path.refresh()
|
|||||||
call self.cacheDisplayString()
|
call self.cacheDisplayString()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
"FUNCTION: Path.refreshFlags() {{{1
|
||||||
|
function! s:Path.refreshFlags()
|
||||||
|
call g:NERDTreeRefreshNotifier.NotifyListeners(self)
|
||||||
|
call self.cacheDisplayString()
|
||||||
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: Path.rename() {{{1
|
"FUNCTION: Path.rename() {{{1
|
||||||
"
|
"
|
||||||
"Renames this node on the filesystem
|
"Renames this node on the filesystem
|
||||||
|
|||||||
@@ -439,6 +439,15 @@ function! s:TreeDirNode.refresh()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
"FUNCTION: TreeDirNode.refreshFlags() {{{1
|
||||||
|
unlet s:TreeDirNode.refreshFlags
|
||||||
|
function! s:TreeDirNode.refreshFlags()
|
||||||
|
call self.path.refreshFlags()
|
||||||
|
for i in self.children
|
||||||
|
call i.refreshFlags()
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: TreeDirNode.reveal(path) {{{1
|
"FUNCTION: TreeDirNode.reveal(path) {{{1
|
||||||
"reveal the given path, i.e. cache and open all treenodes needed to display it
|
"reveal the given path, i.e. cache and open all treenodes needed to display it
|
||||||
"in the UI
|
"in the UI
|
||||||
|
|||||||
@@ -372,6 +372,11 @@ function! s:TreeFileNode.refresh()
|
|||||||
call self.path.refresh()
|
call self.path.refresh()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
"FUNCTION: TreeFileNode.refreshFlags() {{{1
|
||||||
|
function! s:TreeFileNode.refreshFlags()
|
||||||
|
call self.path.refreshFlags()
|
||||||
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: TreeFileNode.rename() {{{1
|
"FUNCTION: TreeFileNode.rename() {{{1
|
||||||
"Calls the rename method for this nodes path obj
|
"Calls the rename method for this nodes path obj
|
||||||
function! s:TreeFileNode.rename(newName)
|
function! s:TreeFileNode.rename(newName)
|
||||||
|
|||||||
Reference in New Issue
Block a user