mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-29 04:33:40 +08:00
make :ClearMarks default to all marks on the current node
This commit is contained in:
parent
bcc690a141
commit
64514e3ceb
|
@ -180,6 +180,15 @@ function! s:CompareNodes(n1, n2)
|
||||||
return a:n1.path.CompareTo(a:n2.path)
|
return a:n1.path.CompareTo(a:n2.path)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
"FUNCTION: oTreeFileNode.ClearMarks() {{{3
|
||||||
|
function! s:oTreeFileNode.ClearMarks() dict
|
||||||
|
let marks = s:GetMarks()
|
||||||
|
for i in keys(marks)
|
||||||
|
if marks[i].Equals(self.path)
|
||||||
|
call remove(marks, i)
|
||||||
|
end
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
"FUNCTION: oTreeFileNode.Copy(dest) {{{3
|
"FUNCTION: oTreeFileNode.Copy(dest) {{{3
|
||||||
function! s:oTreeFileNode.Copy(dest) dict
|
function! s:oTreeFileNode.Copy(dest) dict
|
||||||
call self.path.Copy(a:dest)
|
call self.path.Copy(a:dest)
|
||||||
|
@ -2528,7 +2537,7 @@ function! s:BindMappings()
|
||||||
command! -buffer -nargs=1 Mark :call <SID>MarkNode('<args>')
|
command! -buffer -nargs=1 Mark :call <SID>MarkNode('<args>')
|
||||||
command! -buffer -complete=customlist,s:FindMarks -nargs=1 RecallMark :call <SID>RecallMark('<args>')
|
command! -buffer -complete=customlist,s:FindMarks -nargs=1 RecallMark :call <SID>RecallMark('<args>')
|
||||||
command! -buffer -complete=customlist,s:FindMarks -nargs=1 OpenMark :call <SID>OpenMark('<args>')
|
command! -buffer -complete=customlist,s:FindMarks -nargs=1 OpenMark :call <SID>OpenMark('<args>')
|
||||||
command! -buffer -complete=customlist,s:FindMarks -nargs=+ ClearMarks call <SID>ClearMarks('<args>')
|
command! -buffer -complete=customlist,s:FindMarks -nargs=* ClearMarks call <SID>ClearMarks('<args>')
|
||||||
command! -buffer -complete=customlist,s:FindMarks -nargs=+ MarkToRoot call <SID>MarkToRoot('<args>')
|
command! -buffer -complete=customlist,s:FindMarks -nargs=+ MarkToRoot call <SID>MarkToRoot('<args>')
|
||||||
command! -buffer -nargs=0 ClearAllMarks call <SID>ClearAllMarks() <bar> call <SID>RenderView()
|
command! -buffer -nargs=0 ClearAllMarks call <SID>ClearAllMarks() <bar> call <SID>RenderView()
|
||||||
command! -buffer -nargs=0 ReadMarks call <SID>ReadMarks() <bar> call <SID>RenderView()
|
command! -buffer -nargs=0 ReadMarks call <SID>ReadMarks() <bar> call <SID>RenderView()
|
||||||
|
@ -2596,11 +2605,18 @@ endfunction
|
||||||
" FUNCTION: s:ClearMarks(marks) {{{2
|
" FUNCTION: s:ClearMarks(marks) {{{2
|
||||||
function! s:ClearMarks(marks)
|
function! s:ClearMarks(marks)
|
||||||
let marks = s:GetMarks()
|
let marks = s:GetMarks()
|
||||||
|
if a:marks == ''
|
||||||
|
let currentNode = s:GetSelectedNode()
|
||||||
|
if currentNode != {}
|
||||||
|
call currentNode.ClearMarks()
|
||||||
|
endif
|
||||||
|
else
|
||||||
for name in split(a:marks, ' ')
|
for name in split(a:marks, ' ')
|
||||||
if count(keys(marks), name)
|
if count(keys(marks), name)
|
||||||
call remove(marks, name)
|
call remove(marks, name)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
endif
|
||||||
call s:RenderView()
|
call s:RenderView()
|
||||||
endfunction
|
endfunction
|
||||||
" FUNCTION: s:CloseChildren() {{{2
|
" FUNCTION: s:CloseChildren() {{{2
|
||||||
|
|
Loading…
Reference in New Issue
Block a user