From bf9c4ccdc5ac3aacf8b90e5e4c3c2242fe14a596 Mon Sep 17 00:00:00 2001 From: Michael Coppola Date: Tue, 22 Oct 2024 11:45:24 -0400 Subject: [PATCH] unified fim_on_exit --- examples/llama.vim | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/llama.vim b/examples/llama.vim index 50353f22e..c18a9622c 100644 --- a/examples/llama.vim +++ b/examples/llama.vim @@ -476,13 +476,13 @@ function! llama#fim(is_auto) abort if s:nvim_ghost_text let s:current_job = jobstart(l:curl_command, { \ 'on_stdout': function('s:fim_on_stdout', [s:pos_x, s:pos_y, a:is_auto]), - \ 'on_exit': function('s:nvim_fim_on_exit'), + \ 'on_exit': function('s:fim_on_exit'), \ 'stdout_buffered': v:true \ }) elseif s:vim_ghost_text let s:current_job = job_start(l:curl_command, { \ 'out_cb': function('s:fim_on_stdout', [s:pos_x, s:pos_y, a:is_auto]), - \ 'close_cb': function('s:vim_fim_on_exit') + \ 'exit_cb': function('s:fim_on_exit') \ }) endif @@ -774,14 +774,10 @@ function! s:fim_on_stdout(pos_x, pos_y, is_auto, job_id, data, event = 0) let s:hint_shown = v:true endfunction -function! s:nvim_fim_on_exit(job_id, exit_code, event) dict +function! s:fim_on_exit(job_id, exit_code, event = v:null) if a:exit_code != 0 echom "Job failed with exit code: " . a:exit_code endif let s:current_job = v:null endfunction - -function! s:vim_fim_on_exit(job_id) - let s:current_job = v:null -endfunction