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
13
13
nnoremap <buffer> <silent> <Plug> (fern-action-open:leftest) :<C-u> call <SID> call('open', 'topleft vsplit')<CR>
14
14
nnoremap <buffer> <silent> <Plug> (fern-action-open:bottom) :<C-u> call <SID> call('open', 'botright split')<CR>
15
15
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>
16
17
nnoremap <buffer> <silent> <Plug> (fern-action-open:edit-or-error) :<C-u> call <SID> call('open', 'edit')<CR>
17
18
nnoremap <buffer> <silent> <Plug> (fern-action-open:edit-or-split) :<C-u> call <SID> call('open', 'edit/split')<CR>
18
19
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*
929
929
The command will be applied on an "anchor" window when invoked from a
930
930
drawer style fern (| fern-glossary-anchor | .)
931
931
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
+
932
936
*<Plug>(fern-action-open:edit-or-error)*
933
937
Open a cursor node or marked nodes with | edit | command or fallback
934
938
to print an error.
Original file line number Diff line number Diff line change @@ -135,6 +135,22 @@ Describe fern#internal#buffer
135
135
\ 'opener': 'vsplit',
136
136
\})
137
137
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)
138
154
End
139
155
End
140
156
End
You can’t perform that action at this time.
0 commit comments