@@ -482,11 +482,9 @@ function! llama#fim_cancel()
482
482
" clear the virtual text
483
483
let l: bufnr = bufnr (' %' )
484
484
485
- let l: id_vt_fim = nvim_create_namespace (' vt_fim' )
486
- let l: id_vt_info = nvim_create_namespace (' vt_info' )
485
+ let l: id_vt_fim = nvim_create_namespace (' vt_fim' )
487
486
488
487
call nvim_buf_clear_namespace (l: bufnr , l: id_vt_fim , 0 , -1 )
489
- call nvim_buf_clear_namespace (l: bufnr , l: id_vt_info , 0 , -1 )
490
488
491
489
" remove the mappings
492
490
silent ! iunmap <buffer> <Tab>
@@ -644,13 +642,11 @@ function! s:fim_on_stdout(job_id, data, event) dict
644
642
" display virtual text with the suggestion
645
643
let l: bufnr = bufnr (' %' )
646
644
647
- let l: id_vt_fim = nvim_create_namespace (' vt_fim' )
648
- let l: id_vt_info = nvim_create_namespace (' vt_info' )
645
+ let l: id_vt_fim = nvim_create_namespace (' vt_fim' )
649
646
650
647
" construct the info message
651
648
if g: llama_config .show_info > 0 && l: has_info
652
- " prefix the info string with whitespace in order to offset it to the right of the fim overlay
653
- let l: prefix = repeat (' ' , len (s: content [0 ]) - len (s: line_cur_suffix ) + 3 )
649
+ let l: prefix = ' '
654
650
655
651
if l: truncated
656
652
let l: info = printf (" %s | WARNING: the context is full: %d / %d, increase the server context size or reduce g:llama_config.ring_n_chunks" ,
@@ -668,21 +664,15 @@ function! s:fim_on_stdout(job_id, data, event) dict
668
664
endif
669
665
670
666
if g: llama_config .show_info == 1
671
- " display it in the statusline
667
+ " display the info in the statusline
672
668
let &statusline = l: info
673
- elseif g: llama_config .show_info == 2
674
- " display it to the right of the current line
675
- call nvim_buf_set_extmark (l: bufnr , l: id_vt_info , s: pos_y - 1 , s: pos_x - 1 , {
676
- \ ' virt_text' : [[l: info , ' llama_hl_info' ]],
677
- " \ 'virt_text_pos': 'eol',
678
- \ ' virt_text_pos' : ' right_align' ,
679
- \ })
669
+ let l: info = ' '
680
670
endif
681
671
endif
682
672
683
- " display the suggestion
673
+ " display the suggestion and append the info to the end of the first line
684
674
call nvim_buf_set_extmark (l: bufnr , l: id_vt_fim , s: pos_y - 1 , s: pos_x - 1 , {
685
- \ ' virt_text' : [[s: content [0 ], ' llama_hl_hint' ]],
675
+ \ ' virt_text' : [[s: content [0 ], ' llama_hl_hint' ], [ l: info , ' llama_hl_info ' ] ],
686
676
\ ' virt_text_win_col' : virtcol (' .' ) - 1
687
677
\ })
688
678
0 commit comments