Skip to content

Commit eee2649

Browse files
authored
Merge pull request #426 from lambdalisue/warn-shellslash
Disable fern with `shellslash` option
2 parents 20fbe73 + f5e02f1 commit eee2649

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

doc/fern.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ INTERFACE *fern-interface*
296296
-----------------------------------------------------------------------------
297297
VARIABLE *fern-variable*
298298

299+
*g:fern_disable_startup_warnings*
300+
Set 1 to disable startup warning messages.
301+
Default: 0
302+
299303
*g:fern#profile*
300304
Set 1 to enable fern profiling mode.
301305
Default: 0

plugin/fern.vim

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
if exists('g:loaded_fern') || (!has('nvim') && !has('patch-8.1.0994'))
1+
if exists('g:loaded_fern')
2+
finish
3+
endif
4+
let g:loaded_fern = 1
5+
6+
function! s:warn(message) abort
7+
if get(g:, 'fern_disable_startup_warnings')
8+
return
9+
endif
10+
echohl ErrorMsg
11+
echo printf('[fern] %s', a:message)
12+
echo '[fern] Disable this warning message by adding "let g:fern_disable_startup_warning = 1" on your vimrc.'
13+
echohl None
14+
endfunction
15+
16+
if !has('nvim') && !has('patch-8.1.0994')
217
" NOTE:
318
" At least https://github.com/vim/vim/releases/tag/v8.1.0994 is required
419
" thus minimum working version is 8.1.0994. Remember that minimum support
520
" version is not equal to this.
21+
call s:warn('Vim prior to 8.1.0994 does not have required feature thus fern is disabled.')
22+
finish
23+
elseif exists('+shellslash') && &shellslash
24+
call s:warn('"shellslash" option is not supported thus fern is disabled.')
625
finish
26+
elseif !has('nvim') && !has('patch-8.1.2269')
27+
call s:warn('Vim prior to 8.1.2269 is not supported and fern might not work properly.')
28+
elseif has('nvim') && !has('nvim-0.4.4')
29+
call s:warn('Neovim prior to 0.4.4 is not supported and fern might not work properly.')
730
endif
8-
let g:loaded_fern = 1
31+
932

1033
command! -bar -nargs=*
1134
\ -complete=customlist,fern#internal#command#fern#complete

0 commit comments

Comments
 (0)