File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 11let s: hdevtools_info_buffer = -1
22
3+ function ! s: shutdown ()
4+ let l: cmd = hdevtools#build_command (' admin' , ' --stop-server' )
5+ " Must save the output in order for the command to actually run:
6+ let l: dummy = system (l: cmd )
7+ endfunction
8+
9+ function ! hdevtools#prepare_shutdown ()
10+ let l: cmd = hdevtools#build_command (' admin' , ' --status' )
11+ " Must save the output in order for the command to actually run:
12+ let l: dummy = system (l: cmd )
13+
14+ " Only shutdown the hdevtools server on Vim quit if the above 'status'
15+ " command indicated that the hdevtools server isn't currently running: This
16+ " plugin will start the server, so this plugin should be responsible for
17+ " shutting it down when Vim exits.
18+ "
19+ " If on the other hand, the hdevtools server is already running, then we
20+ " shouldn't shut it down on Vim exit, since someone else started it, so it's
21+ " their problem.
22+ if v: shell_error != 0
23+ autocmd VimLeave * call s: shutdown ()
24+ endif
25+ endfunction
26+
327function ! hdevtools#info (identifier )
428 let l: identifier = a: identifier
529
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ if !s:has_hdevtools
1818 finish
1919endif
2020
21+ call hdevtools#prepare_shutdown ()
22+
2123if exists (' b:undo_ftplugin' )
2224 let b: undo_ftplugin .= ' | '
2325else
You can’t perform that action at this time.
0 commit comments