-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'b' binding to jump to bookmark table #1307
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ function! nerdtree#ui_glue#createDefaultBindings() abort | |
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpRoot, 'scope': 'all', 'callback': s.'jumpToRoot' }) | ||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpNextSibling, 'scope': 'Node', 'callback': s.'jumpToNextSibling' }) | ||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpPrevSibling, 'scope': 'Node', 'callback': s.'jumpToPrevSibling' }) | ||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpBookmarks, 'scope': 'all', 'callback': s.'jumpToBookmarks' }) | ||
|
||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTab, 'scope': 'Node', 'callback': s . 'openInNewTab' }) | ||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': 'Node', 'callback': s . 'openInNewTabSilent' }) | ||
|
@@ -495,6 +496,17 @@ function! s:jumpToSibling(node, forward) abort | |
call b:NERDTree.ui.centerView() | ||
endfunction | ||
|
||
" FUNCTION: s:jumpToBookmarks() {{{1 | ||
" moves the cursor to the bookmark listing | ||
function! s:jumpToBookmarks() abort | ||
try | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ds2606 Hello sir, I'm sorry to see your beautiful PR has been waiting for this long. My only issue with this code is using try/catch instead of checking whether or not the bookmark section is open via this function call: b:NERDTree.ui.getShowBookmarks() |
||
call g:NERDTree.CursorToBookmarkTable() | ||
catch /^NERDTree.BookmarkTableNotFoundError\|^NERDTree.IllegalOperationError/ | ||
call nerdtree#echoError('bookmark table is closed') | ||
return | ||
endtry | ||
endfunction | ||
|
||
" FUNCTION: nerdtree#ui_glue#openBookmark(name) {{{1 | ||
" Open the Bookmark that has the specified name. This function provides the | ||
" implementation for the :OpenBookmark command. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not doing a new version for each PR anymore, just remove this change log. For now, I'll use the PR titles to write multi-bulletin change logs.