Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions plugin/fswitch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ if exists("g:disable_fswitch")
finish
endif

function! s:FSError(msg) abort
echohl ErrorMsg
echomsg a:msg
echohl None
endfunction

if v:version < 700
echoerr "FSwitch requires Vim 7.0 or higher."
call s:FSError("FSwitch requires Vim 7.0 or higher.")
finish
endif

Expand Down Expand Up @@ -323,10 +329,10 @@ function! FSwitch(filename, precmd)
execute 'edit ' . s:fname
endif
else
echoerr "Alternate has evaluated to nothing. See :h fswitch-empty for more info."
call s:FSError("Alternate has evaluated to nothing. See :h fswitch-empty for more info.")
endif
else
echoerr "No alternate file found. 'fsnonewfiles' is set which denies creation."
call s:FSError("No alternate file found.")
endif
endfunction

Expand Down