Skip to content

Commit 564a203

Browse files
committed
Fix a bug in the code for auto shutdown of hdevtools on Vim exit
Fixes #4 <#4>
1 parent 2103352 commit 564a203

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

autoload/hdevtools.vim

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
let s:hdevtools_info_buffer = -1
22

33
function! s:shutdown()
4-
let l:cmd = hdevtools#build_command('admin', '--stop-server')
4+
let l:cmd = hdevtools#build_command_bare('admin', '--stop-server')
55
" Must save the output in order for the command to actually run:
66
let l:dummy = system(l:cmd)
77
endfunction
88

99
function! hdevtools#prepare_shutdown()
10-
let l:cmd = hdevtools#build_command('admin', '--status')
10+
let l:cmd = hdevtools#build_command_bare('admin', '--status')
1111
" Must save the output in order for the command to actually run:
1212
let l:dummy = system(l:cmd)
1313

@@ -462,6 +462,14 @@ function! hdevtools#build_command(command, args)
462462
return l:cmd
463463
endfunction
464464

465+
" Does not include g:hdevtools_options
466+
function! hdevtools#build_command_bare(command, args)
467+
let l:cmd = 'hdevtools'
468+
let l:cmd = l:cmd . ' ' . a:command . ' '
469+
let l:cmd = l:cmd . a:args
470+
return l:cmd
471+
endfunction
472+
465473
function! hdevtools#clear_highlight()
466474
if exists('w:hdevtools_type_matchid')
467475
call matchdelete(w:hdevtools_type_matchid)

0 commit comments

Comments
 (0)