chrisbra / Recover.vim

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

Bug: rubbish message in neovim #39

Closed amerlyq closed 8 years ago

amerlyq commented 8 years ago

Seems like it somehow messed out by reasons of migrating to shada. Check out if it possible to fix, please. As 'diff' case saved me innumerable times, but output makes sad:)

chdir(/home/amerlyq/aura/airy/cfg/term/vim/cfg/plugins)                             
chdir(/home/amerlyq/.vim/cfg/plugins)                                               
chdir(/home/amerlyq/aura/airy/cfg/term/vim/cfg/plugins)                             
Reading ShaDa file "/home/amerlyq/.local/share/nvim/shada/main.shada" info marks old
files^[[?1049h^[[H^[[J^[[?2004h^[[8;24;80t^[[H^[[J^[[1;1H^[[1;1H^[[?1002h^[[?1006h^[
[24;1Hchdir(/home/amerlyq/aura/airy/cfg/term/vim/cfg/plugins)^[[24;56H^[[1;24r^[[1;1
H^[[M^[[1;24r^[[24;56H^[[24;1Hchdir(/home/amerlyq/.vim/cfg/plugins)^[[1;24r^[[1;1H^[
[M^[[1;24r^[[24;38H^[[24;1Hchdir(/home/amerlyq/aura/airy/cfg/term/vim/cfg/plugins)^[
[1;24r^[[1;1H^[[M^[[1;24r^[[24;56H^[[24;1H"~/.vim/cfg/plugins/environment.yml" ^[[24
;38H^[[24;1H"~/.vim/cfg/plugins/environment.yml" 37L, 1245C^[[1;24r^[[1;1H^[[M^[[1;2
4r^[[24;48H^[[24;1HReading ShaDa file "/home/amerlyq/.local/share/nvim/shada/main.sh
ada" marks ^[[?1002h^[[?1006h^[[1;24r^[[1;1H^[[M^[[1;24r^[[24;77H^[[24;1HEntering Ex
 mode.  Type "visual" to go to Normal mode.^[[1;24r^[[1;1H^[[M^[[1;24r^[[24;55H^[[24
;1H:^[[24;2H^[[24;2H^[[24;1H^[[1;24r^[[1;1H^[[M^[[1;24r^[[24;1HWriting ShaDa file "/
home/amerlyq/.local/share/nvim/shada/main.shada"^[[24;70H^[[24;1H^[[2 q^[[?1002l^[[?
1006l^[[m^O^[[?1049l^[[?2004l                                                       
Swap and on-disk file seem to be identical
chrisbra commented 8 years ago

I am not sure, what to do with this, as I don't use neovim

amerlyq commented 8 years ago

Aah, I'm not sure either. Manual testing with different kind of terminal strings to fetch msg bore no results. Output don't seems like expected by next substitutions at all. Would it be possible to make message parsing/patching optional? So only options like D[i]ff would be added, leaving message body intact?

chrisbra commented 8 years ago

Hi Dmytro!

On Mo, 23 Nov 2015, Dmytro Kolomoiets wrote:

Aah, I'm not sure either. Manual testing with different kind of terminal strings to fetch msg bore no results. Output don't seems like expected by next substitutions at all. Would it be possible to make message parsing/patching optional? So only options like D[i]ff would be added, leaving message body intact?

Okay, I have pushed a change, that allows skipping the investigation of the swapfile. Set the variable 'g:RecoverPlugin_No_Check_Swapfile' to 1

Please check if this works for you.

amerlyq commented 8 years ago

It somehow works, however option for 'delete' swap file disappered somewhere on the way. (Edit: after some tests, it seems option is present when launching two nvim instances simultaneously and absent when simply found swap file on disk -- both for identical and different) And I miss other info like pid/rights, but consider this as valid compromise, if original message couldn't be left intact. Because, if I understood correctly, replacing only last two lines of case-options in message buffer isn't possible -- only rewriting buffer as whole -- therefore you used re-launching vim inside of vim to get msg?

chrisbra commented 8 years ago

PID from the message is not parsed, that was the whole point of launching another vim instance in the plugin and what I understand from you was, that exactly that does not work.

Regarding the option "Delete" that is only visible, if no process with this PID exists. That is builtin to Vim, there is nothing I can do about.