Skip to content

Commit

Permalink
Use the correct scope for the "i" and "s" commands
Browse files Browse the repository at this point in the history
The docs say that these mappings should have the "FileNode" scope
rather than the "Node" scope, which is actually too broad.

This change fixes the following bug:
 1. Open the NERDTree
 2. Navigate cursor to a directory node with children
 3. Press "i" or "s", and then press "r"
 4. Observe that the node will close when it should remain open

This is due to the usage of an incorrect mapping scope.
  • Loading branch information
lifecrisis committed Jul 11, 2020
1 parent b968faf commit 2eb40a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/nerdtree/ui_glue.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function! nerdtree#ui_glue#createDefaultBindings()
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "Bookmark", 'callback': s."activateBookmark" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "all", 'callback': s."activateAll" })

call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenSplit, 'scope': "Node", 'callback': s."openHSplit" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenVSplit, 'scope': "Node", 'callback': s."openVSplit" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenSplit, 'scope': 'FileNode', 'callback': s.'openHSplit' })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenVSplit, 'scope': 'FileNode', 'callback': s.'openVSplit' })

call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreview, 'scope': "Node", 'callback': s."previewNodeCurrent" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewVSplit, 'scope': "Node", 'callback': s."previewNodeVSplit" })
Expand Down

0 comments on commit 2eb40a0

Please sign in to comment.