Skip to content

Commit 5f4f194

Browse files
committed
Fix a bug that disables :FSharpUpdateFSAC command when FSAC is not installed
1 parent 4fc6420 commit 5f4f194

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

ftplugin/fsharp.vim

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ if exists('b:did_fsharp_ftplugin')
55
endif
66
let b:did_fsharp_ftplugin = 1
77

8-
let script_dir = expand('<sfile>:p:h')
9-
let fsac = script_dir . "/../fsac/fsautocomplete.dll"
10-
11-
if empty(glob(fsac))
12-
echoerr "FSAC not found. :FSharpUpdateFSAC to download."
13-
finish
14-
endif
15-
168
" set some defaults
179
if !exists('g:fsharp#automatic_workspace_init')
1810
let g:fsharp#automatic_workspace_init = 1
@@ -41,6 +33,17 @@ setl comments=s0:*\ -,m0:*\ \ ,ex0:*),s1:(*,mb:*,ex:*),:\/\/\/,:\/\/
4133
" make ftplugin undo-able
4234
let b:undo_ftplugin = 'setl fo< cms< com< fdm<'
4335

36+
com! -buffer -nargs=* FSharpUpdateFSAC call fsharp#updateFSAC(<f-args>)
37+
38+
" check if FSAC exists
39+
let script_dir = expand('<sfile>:p:h')
40+
let fsac = script_dir . "/../fsac/fsautocomplete.dll"
41+
if empty(glob(fsac))
42+
echoerr "FSAC not found. :FSharpUpdateFSAC to download."
43+
let &cpo = s:cpo_save
44+
finish
45+
endif
46+
4447
if g:fsharp#automatic_workspace_init
4548
augroup LanguageClient_config
4649
autocmd!
@@ -54,7 +57,6 @@ augroup END
5457

5558
com! -buffer FSharpLoadWorkspaceAuto call fsharp#loadWorkspaceAuto()
5659
com! -buffer FSharpReloadWorkspace call fsharp#reloadProjects()
57-
com! -buffer -nargs=* FSharpUpdateFSAC call fsharp#updateFSAC(<f-args>)
5860
com! -buffer -nargs=* -complete=file FSharpParseProject call fsharp#loadProject(<f-args>)
5961

6062
let &cpo = s:cpo_save

0 commit comments

Comments
 (0)