fern: only change directory if we are in a fern window
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-12-02 14:56:51 +01:00
parent e06b45a870
commit 499ae85357

View File

@@ -37,7 +37,9 @@ function! airline#extensions#fern#configure_sections(win, context) abort
" because fern navigation changes an internal _fri_ and not the working directory
" we need to give it some help so the branch name gets updated
try
execute 'lcd' fnameescape(abspath)
if &ft ==# 'fern'
execute 'lcd' fnameescape(abspath)
endif
catch /^Vim\%((\a\+)\)\=:E344:/
call a:win.add_section('airline_b', '')
endtry