mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
remove the magic from the <c-j>/<c-k> mappings
previoulsy, <c-k>/<c-j> did magic stuff if the selected node was a file. i.e. jumped to the parent/parents next sibling. I chose to remove this behaviour as it is more confusing than helpful.
This commit is contained in:
@@ -344,8 +344,7 @@ Default key: <C-j>
|
|||||||
Map option: NERDTreeMapJumpNextSibling
|
Map option: NERDTreeMapJumpNextSibling
|
||||||
Applies to: files and directories.
|
Applies to: files and directories.
|
||||||
|
|
||||||
If a dir node is selected, jump to the next sibling of that node.
|
Jump to the next sibling of the selected node.
|
||||||
If a file node is selected, jump to the next sibling of that nodes parent.
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDTree-c-k*
|
*NERDTree-c-k*
|
||||||
@@ -353,8 +352,7 @@ Default key: <C-k>
|
|||||||
Map option: NERDTreeMapJumpPrevSibling
|
Map option: NERDTreeMapJumpPrevSibling
|
||||||
Applies to: files and directories.
|
Applies to: files and directories.
|
||||||
|
|
||||||
If a dir node is selected, jump to the previous sibling of that node.
|
Jump to the previous sibling of the selected node.
|
||||||
If a file node is selected, jump to the previous sibling of that nodes parent.
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDTree-C*
|
*NERDTree-C*
|
||||||
|
|||||||
@@ -3001,18 +3001,7 @@ endfunction
|
|||||||
function! s:JumpToSibling(forward)
|
function! s:JumpToSibling(forward)
|
||||||
let currentNode = s:GetSelectedNode()
|
let currentNode = s:GetSelectedNode()
|
||||||
if !empty(currentNode)
|
if !empty(currentNode)
|
||||||
|
let sibling = currentNode.FindSibling(a:forward)
|
||||||
if !currentNode.path.isDirectory
|
|
||||||
|
|
||||||
if a:forward
|
|
||||||
let sibling = currentNode.parent.FindSibling(1)
|
|
||||||
else
|
|
||||||
let sibling = currentNode.parent
|
|
||||||
endif
|
|
||||||
|
|
||||||
else
|
|
||||||
let sibling = currentNode.FindSibling(a:forward)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !empty(sibling)
|
if !empty(sibling)
|
||||||
call s:PutCursorOnNode(sibling, 1, 0)
|
call s:PutCursorOnNode(sibling, 1, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user