chrisbra / Recover.vim

A Plugin to show a diff, whenever recovering a buffer
http://www.vim.org/scripts/script.php?script_id=3068
247 stars 25 forks source link

Error detected while processing SwapExists Autocommands for "*"..function recover#ConfirmSwapDiff[22]..<SNR>130_AttentionMessage #74

Closed rpdelaney closed 2 years ago

rpdelaney commented 2 years ago
Error detected while processing SwapExists Autocommands for "*"..function recover#ConfirmSwapDiff[22]..<SNR>130_AttentionMessage:
line    5:
E484: Can't open file /var/folders/cf/_7_y2ks145l10nznn4_5l1qh0000gn/T/v3pLC4w/1
line   11:
E896: Argument of get() must be a List, Dictionary or Blob
line   12:
E896: Argument of get() must be a List, Dictionary or Blob
Error detected while processing SwapExists Autocommands for "*"..function recover#ConfirmSwapDiff:
line   70:
"dumbpw/engine.py" 99L, 2821B
Press ENTER or type command to continue
$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 06 2022 16:59:21)
macOS version - arm64
Included patches: 1-4700
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        -mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
-farsi             -mouse_sysmouse    -tag_old_static    
   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: "/opt/homebrew/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: clang -L. -fstack-protector-strong -L/opt/homebrew/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/readline/lib -o vim -lm -lncurses -liconv -lintl -framework AppKit -L/opt/homebrew/opt/lua/lib -llua5.4 -mmacosx-version-min=12.0 -fstack-protector-strong -L/opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level/CORE -lperl -L/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin -lpython3.10 -framework CoreFoundation -lruby.3.1 -L/opt/homebrew/Cellar/ruby/3.1.1/lib 
$

Recover plugin is on 23d1e4766642a55e774deb56fda434c64538b06b via vim-plug

chrisbra commented 2 years ago

Hm, /var/folders/cf/_7_y2ks145l10nznn4_5l1qh0000gn/T/v3pLC4w/1 is that a valid file? Looks like a problem with the swapinfo() function. Is that reproducible?

rpdelaney commented 2 years ago

tmpfs is so weird on macOS I don't really understand it. Some things want to put temp files in /var/tmp instead of /tmp and I don't know why. /var/folders exists on my system -- not sure if that makes it a "valid file" or not though. As far as reproducibility goes, yes, it seems to happen every time I edit a file that has a swap.

rpdelaney commented 2 years ago

For instance, I can reliably reproduce this like so:

  1. vim edit foo
  2. Hit CTRL-Z, which backgrounds the vim process
  3. vim edit foo again to start a new process editing the same file
  4. Observe error about SwapExists Autocommands for "*" etc
chrisbra commented 2 years ago

i suppose this is caused by 23d1e4766642a55e774deb56fda434c64538b06b? If you back out this change, does it work then?

rpdelaney commented 2 years ago

Here's what I did:

  1. cd into ~/.vim/plug/Recover
  2. git revert 23d1e4766642a55e774deb56fda434c64538b06b
  3. vim foo
  4. ctrl-Z
  5. vim foo

Still getting the error:

Error detected while processing SwapExists Autocommands for "*"..function recover#ConfirmSwapDiff[22]..<SNR>130_AttentionMessage:
line    1:
E484: Can't open file /var/folders/cf/_7_y2ks145l10nznn4_5l1qh0000gn/T/vF3AEDm/1
line    2:
E896: Argument of get() must be a List, Dictionary or Blob
line    3:
E896: Argument of get() must be a List, Dictionary or Blob
Error detected while processing SwapExists Autocommands for "*"..function recover#ConfirmSwapDiff:
line   70:
"foo" [New]
Press ENTER or type command to continue
chrisbra commented 2 years ago

This is really puzzling and totally unclear why the stat command would not work. For now, I have ignored "File is not readable" error.

You could try to use :set verbose=5 then :e of a file with an exising swapfile and see what shell command is executed. Vim should output the shell command in its message pane. Then try to run the command from another terminal and see if this works. But I suppose this does not really help us fixing the issue.