Skip to content

Commit dbab491

Browse files
committed
🐛 Do NOT throw error on denops#server#close
The documentation said that `denops#server#close` does not throw an error even if the server is not connected. However, it throws an error when the server is not connected. This commit fixes the behavior. Close #338
1 parent 9f0f941 commit dbab491

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

autoload/denops/server.vim

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ function! denops#server#stop() abort
2929
endfunction
3030

3131
function! denops#server#restart() abort
32-
if denops#_internal#server#proc#is_started()
33-
call denops#server#stop()
34-
endif
32+
call denops#server#stop()
3533
call denops#server#start()
3634
endfunction
3735

@@ -58,13 +56,14 @@ function! denops#server#connect() abort
5856
endfunction
5957

6058
function! denops#server#close() abort
59+
if !denops#_internal#server#chan#is_connected()
60+
return
61+
endif
6162
call denops#_internal#server#chan#close()
6263
endfunction
6364

6465
function! denops#server#reconnect() abort
65-
if denops#_internal#server#chan#is_connected()
66-
call denops#server#close()
67-
endif
66+
call denops#server#close()
6867
call denops#server#connect()
6968
endfunction
7069

0 commit comments

Comments
 (0)