Skip to content

Commit 10c7aa0

Browse files
authored
Merge pull request #102 from rdnetto/enable_recovery_from_crash
kill() should not fail just because the buffer doesn't exist anymore
2 parents 9a3ddfa + 26a74ba commit 10c7aa0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

autoload/intero/process.vim

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,17 @@ endfunction
128128
function! intero#process#kill() abort
129129
" Kills the intero buffer, if it exists.
130130
if exists('g:intero_buffer_id')
131-
exe 'bd! ' . g:intero_buffer_id
131+
" The buffer may have been manually closed if Intero crashed
132+
if bufexists(g:intero_buffer_id)
133+
exe 'bd! ' . g:intero_buffer_id
134+
endif
135+
132136
unlet g:intero_buffer_id
133137
" Deleting a terminal buffer implicitly stops the job
134138
unlet g:intero_job_id
135-
let g:intero_started = 0
136139
endif
140+
141+
let g:intero_started = 0
137142
endfunction
138143

139144
function! intero#process#hide() abort

0 commit comments

Comments
 (0)