metakirby5 / codi.vim

:notebook_with_decorative_cover: The interactive scratchpad for hackers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vim 8.2 problem?

dusanx opened this issue · comments

Issue description

When I start codi, either using codi() shell function or directly while editing, it doesn't work, instead Vim shows a lot of errors:

Error detected while processing function <SNR>112_require[3]..<SNR>112_check_exec[1]..<SNR>112_first_str:                                                                                                                                                                                
line    5:                                                                                                                                                                                                                                                                               
E654: missing delimiter after search pattern: 684                                                                                                                                                                                                                                        
Error detected while processing function <SNR>112_require:                                                                                                                                                                                                                               
line    3:                                                                                                                                                                                                                                                                               
E171: Missing :endif                                                                                                                                                                                                                                                                     
Error detected while processing function <SNR>112_require[3]..<SNR>112_check_exec[1]..<SNR>112_first_str:                                                                                                                                                                                
line    5:                                                                                                                                                                                                                                                                               
E654: missing delimiter after search pattern: 684                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 684                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 684                                                                                                                                                                                                                                        
Error detected while processing function codi#run[32]..<SNR>112_codi_spawn[95]..codi#update[5]..<SNR>112_codi_do_update[57]..<SNR>112_stop_job_for_buf:                                                                                                                                  
line    2:                                                                                                                                                                                                                                                                               
E716: Key not present in Dictionary: 1                                                                                                                                                                                                                                                   
line    3:                                                                                                                                                                                                                                                                               
E716: Key not present in Dictionary: 1                                                                                                                                                                                                                                                   
line    4:                                                                                                                                                                                                                                                                               
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
Press ENTER or type command to continue                                                                                                                                                                                                                                                  
Error detected while processing function codi#__vim_callback:                                                                                                                                                                                                                            
line    3:                                                                                                                                                                                                                                                                               
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716    

Then each next keypress results in:

Error detected while processing function codi#update[5]..<SNR>112_codi_do_update[57]..<SNR>112_stop_job_for_buf:                                                                                                                                                                         
line    4:                                                                                                                                                                                                                                                                               
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
Press ENTER or type command to continue                                                                                                                                                                                                                                                  
Error detected while processing function codi#__vim_callback:                                                                                                                                                                                                                            
line    3:                                                                                                                                                                                                                                                                               
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716                                                                                                                                                                                                                                        
E654: missing delimiter after search pattern: 716 

Of course after all this errors (that make impossible to type), there are no results on the right.

Environment

commented

i got the same things than you at start, but i have only the start :

Error detected while processing function codi#run[32]..<SNR>54_codi_spawn[27]..<SNR>54_check_exec[1]..<SNR>54_first_str:
line    5:
E654: missing delimiter after search pattern: 684
Error detected while processing function codi#run[32]..<SNR>54_codi_spawn:
line   27:
E171: Missing :endif
Error detected while processing function codi#run:
line   32:
E171: Missing :endif
Press ENTER or type command to continue

Getting the exact same error message like @dusanx on Arch with vim 8.2.0717-2

Similar error here, Linux Mint with vim:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 12 2020 02:37:13)
Included patches: 1-716

Seems like some recent update broke it

same issue, wasn't getting it on mac though.

Same issue:

Void Linux:

Linux void 5.4.44_1 #1 SMP PREEMPT Wed Jun 3 14:54:55 UTC 2020 x86_64 GNU/Linux
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun  3 2020 20:49:38)
Included patches: 1-891
Compiled by void-buildslave@a-hel-fi
Huge version without GUI.  Features included (+) or not (-):

Found several things.

  1. autoload/codi.vim line: 69
    " Causing error
    catch E684
    " Should be
    catch /E684/

Or one could eliminate the try/catch by rewriting the function:

" Get string or first element of list
function! s:first_str(o)
  " Check if a list.
  if type(a:o) is# v:t_list
    " Check if list is empty.
    if len(a:o) > 0
      return a:o[0]
    else
      return ''
    endif
  " Not a list.
  else
    return a:o
  endif
endfunction
  1. autoload/codi.vim line: 234,484,495
    " Causing error
    catch E716
    " Should be
    catch /E716/

I think this can be closed after #125 , it fixed the problems for me.

Yeah, I can confirm it works, thanks, I wasn't aware about #125 update but everything seems perfect after installing codi plugin again.