ojroques / vim-oscyank

A Vim plugin to copy text through SSH with OSC52
BSD 2-Clause "Simplified" License
629 stars 39 forks source link

Not working with debian's vim 8.1 or Vundle? #16

Closed seqizz closed 3 years ago

seqizz commented 3 years ago

Hi again :wave:

Since this is the most useful plugin I'm using currently, wanted to install it to a debian server, using Vundle, which failed with:

Error detected while processing /home/seqizz/.vim/bundle/vim-oscyank/plugin/oscyank.vim:
line   62:
E475: Invalid argument: type = '') abort
line   67:
E133: :return not inside a function
line   71:
E121: Undefined variable: a:type
line   73:
E133: :return not inside a function
line   81:
E133: :return not inside a function
line   84:
E684: list index out of range: -1
line   85:
E684: list index out of range: 0
Error detected while processing function YankOSC52:
line   24:
E121: Undefined variable: s:osc52_table
E116: Invalid arguments for function get(s:osc52_table, osc52_key, s:osc52_table['default'])(a:str)
line   25:
E121: Undefined variable: osc52
E116: Invalid arguments for function <SNR>54_raw_echo
[oscyank] 0 characters copied
Error detected while processing /home/seqizz/.vim/bundle/vim-oscyank/plugin/oscyank.vim:
line   88:
E193: :endfunction not inside a function

vim --version output is:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 15 2019 16:41:15)
Included patches: 1-875, 878, 884, 948, 1046, 1365-1368, 1382, 1401
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version without GUI.  Features included (+) or not (-):
+acl               +extra_search      +mouse_netterm     +tag_old_static
+arabic            +farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    -tcl
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +textprop
+byte_offset       -hangul_input      +num64             +timers
+channel           +iconv             +packages          +title
+cindent           +insert_expand     +path_extra        -toolbar
-clientserver      +job               -perl              +user_commands
-clipboard         +jumplist          +persistent_undo   +vartabs
+cmdline_compl     +keymap            +postscript        +vertsplit
+cmdline_hist      +lambda            +printer           +virtualedit
+cmdline_info      +langmap           +profile           +visual
+comments          +libcall           -python            +visualextra
+conceal           +linebreak         -python3           +viminfo
+cryptv            +lispindent        +quickfix          +vreplace
+cscope            +listcmds          +reltime           +wildignore
+cursorbind        +localmap          +rightleft         +wildmenu
+cursorshape       -lua               -ruby              +windows
+dialog_con        +menu              +scrollbind        +writebackup
+diff              +mksession         +signs             -X11
+digraphs          +modify_fname      +smartindent       -xfontset
-dnd               +mouse             +startuptime       -xim
-ebcdic            -mouseshape        +statusline        -xpm
+emacs_tags        +mouse_dec         -sun_workshop      -xsmp
+eval              +mouse_gpm         +syntax            -xterm_clipboard
+ex_extra          -mouse_jsbterm     +tag_binary        -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-4Pursk/vim-8.1.0875=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux -lacl -lattr -lgpm -ldl

Thanks for any hints.

keeto commented 3 years ago

It seems to be the recent OSCYankOperator commit (fe67f649111dc15336c9905b9aee28e242add358). I use vim-plugged and I pinned my config to use the last working commit (e2a6ec4fb91b38591445bdaa9972f54653dbcd49), which you can try if Vundle supports it.

ojroques commented 3 years ago

Sorry if it broke anything :/

I'm currently away from home and don't have access to a computer for the next 5 days unfortunately.

I'll try to fix this issue as soon as I get back home. Or if someone is willing to make a PR about it, it'd be welcome :)

mdedonno1337 commented 3 years ago

same here on Debian 11, neovim 0.4.4 and vim-plug

ojroques commented 3 years ago

I've reverted the commits that introduced the errors. The issue should be fixed now but the yank operator has been removed. I'll see if I can add it again without introducing any errors in the following days.

joechrisellis commented 3 years ago

Hi all -- mea culpa. You're seeing that error because optional/default arguments were not supported until Vim 8.1.1310 (something I didn't realise when I was writing the patch). If you're using Vim >= 8.1.1310 (oe Neovim version) then this should work fine, otherwise I'd expect errors.

I think the patch will need to be updated to use Vim's ... arguments for backward compatibility.

function! Foo(bar, ...)
    let baz = get(a:, 1, 0)
endfunction

^ something like that.

@ojroques and others, apologies for the breakage!

joechrisellis commented 3 years ago

Hey again folks -- proposed fix in #17, would anybody mind testing?

ojroques commented 3 years ago

I've merged the fix. Feel free to re-open this issue if the problem persists.