File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ function! fern#mapping#open#init(disable_default_mappings) abort
1313 nnoremap <buffer> <silent> <Plug> (fern-action-open:leftest) :<C-u> call <SID> call('open', 'topleft vsplit')<CR>
1414 nnoremap <buffer> <silent> <Plug> (fern-action-open:bottom) :<C-u> call <SID> call('open', 'botright split')<CR>
1515 nnoremap <buffer> <silent> <Plug> (fern-action-open:rightest) :<C-u> call <SID> call('open', 'botright vsplit')<CR>
16+ nnoremap <buffer> <silent> <Plug> (fern-action-open:drop) :<C-u> call <SID> call('open', 'drop')<CR>
1617 nnoremap <buffer> <silent> <Plug> (fern-action-open:edit-or-error) :<C-u> call <SID> call('open', 'edit')<CR>
1718 nnoremap <buffer> <silent> <Plug> (fern-action-open:edit-or-split) :<C-u> call <SID> call('open', 'edit/split')<CR>
1819 nnoremap <buffer> <silent> <Plug> (fern-action-open:edit-or-vsplit) :<C-u> call <SID> call('open', 'edit/vsplit')<CR>
Original file line number Diff line number Diff line change @@ -929,6 +929,10 @@ GLOBAL *fern-mapping-global*
929929 The command will be applied on an "anchor" window when invoked from a
930930 drawer style fern (| fern-glossary-anchor | .)
931931
932+ *<Plug>(fern-action-open:drop)*
933+ Open a cursor node or jump the window when it was already opend.
934+ Note See | drop | for more details.
935+
932936*<Plug>(fern-action-open:edit-or-error)*
933937 Open a cursor node or marked nodes with | edit | command or fallback
934938 to print an error.
Original file line number Diff line number Diff line change @@ -135,6 +135,22 @@ Describe fern#internal#buffer
135135 \ 'opener': 'vsplit',
136136 \})
137137 Assert Equals(winnr('$'), 2)
138+ %bwipeout!
139+
140+ call fern#internal#buffer#open('hello1', {
141+ \ 'opener': 'edit',
142+ \})
143+ call fern#internal#buffer#open('hello2', {
144+ \ 'opener': 'vsplit',
145+ \})
146+ call fern#internal#buffer#open('hello1', {
147+ \ 'opener': 'drop',
148+ \})
149+ Assert Equals(winnr(), 2)
150+ call fern#internal#buffer#open('hello2', {
151+ \ 'opener': 'drop',
152+ \})
153+ Assert Equals(winnr(), 1)
138154 End
139155 End
140156End
You can’t perform that action at this time.
0 commit comments