Skip to content

Commit af629f5

Browse files
authored
Merge pull request #198 from lambdalisue/improve-cd-actions
Select window prior to 'lcd' action
2 parents 203827d + e6a1021 commit af629f5

File tree

1 file changed

+10
-0
lines changed
  • autoload/fern/scheme/file/mapping

1 file changed

+10
-0
lines changed

autoload/fern/scheme/file/mapping/cd.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,20 @@ function! s:call(name, ...) abort
2121
endfunction
2222

2323
function! s:map_cd_root(helper, command) abort
24+
if a:command ==# 'lcd'
25+
if fern#internal#window#select()
26+
return s:Promise.resolve()
27+
endif
28+
endif
2429
return s:cd(a:helper.sync.get_root_node(), a:helper, a:command)
2530
endfunction
2631

2732
function! s:map_cd_cursor(helper, command) abort
33+
if a:command ==# 'lcd'
34+
if fern#internal#window#select()
35+
return s:Promise.resolve()
36+
endif
37+
endif
2838
return s:cd(a:helper.sync.get_cursor_node(), a:helper, a:command)
2939
endfunction
3040

0 commit comments

Comments
 (0)