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

Clash with fencview #23

Closed lyokha closed 10 years ago

lyokha commented 11 years ago

Not actually a bug but rather interesting behaviour. I have installed plugin fencview (http://www.vim.org/scripts/script.php?script_id=1708). With this if i have a swap file Recover behaves not as expected: it shows its original dialog and when i press <Enter> it shows vim's recover menu and when i press <Enter> again it shows FencView errors. All this looks like

E325: ATTENTION
Found a swap file by the name ".Sprint2.txt.swp"
          owned by: lyokha   dated: Thu Aug 15 18:28:51 2013
         file name: ~lyokha/Sprint2.txt
          modified: YES
         user name: lyokha   host name: localhost.localdomain
        process ID: 15079 [not existing]

 Processing...  100% (ctrl+c to stop)
Found a swap file by the name ".Sprint2.txt.swp"
          owned by: lyokha   dated: Thu Aug 15 18:28:51 2013
         file name: ~lyokha/Sprint2.txt
          modified: YES
         user name: lyokha   host name: localhost.localdomain
        process ID: 15079
While opening file "Sprint2.txt"
             dated: Thu Aug 15 18:11:42 2013

(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r Sprint2.txt"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".Sprint2.txt.swp"
    to avoid this message.

Swap file ".Sprint2.txt.swp" already exists!
"Sprint2.txt" [readonly] 34L, 2101C
Error detected while processing function <SNR>43_EditAutoEncoding..<SNR>43_FencDetectFileEncoding:
line   92:
E325: ATTENTION
Error detected while processing function <SNR>43_EditAutoEncoding:
line   40:
E171: Missing :endif
Press ENTER or type command to continue

and after that a single buffer opens without the diff mode.

I found that i can suppress this issue by adding in my .vimrc line

" disable fencview autodetection as it clashes with Recover plugin
let g:fencview_autodetect = 0

Cheers, Alexey.

chrisbra commented 11 years ago

Hm, fencview doesn't really allow to selectively disable it. So I have now implemented a hackish workaround, that should fix this issue. Please try current head.

lyokha commented 11 years ago

I tried. Unfortunately it does not work well. I have to press <Enter> twice again, here is my output:

E325: ATTENTION
Found a swap file by the name ".TagHLConfig.txt.swp"
          owned by: lyokha   dated: Sun Aug 18 21:35:53 2013
         file name: ~lyokha/TagHLConfig.txt
          modified: YES
         user name: lyokha   host name: desktop.localdomain
        process ID: 20866 [not existing]

Please choose: 
"TagHLConfig.txt" 12L, 265C
Используется своп-файл "~/.TagHLConfig.txt.swp"
Исходный файл "~/TagHLConfig.txt"
Восстановление завершено. Проверьте, всё ли в порядке.
(Можете записать файл под другим именем и сравнить его с исходным
файлом при помощи программы diff)
Вероятно, сейчас вы захотите удалить файл .swp.

"~/TagHLConfig.txt" 12L, 265C
"TagHLConfig.txt (on-disk version)" [Изменён][Не редактировался] 12 стр. --100%--
W10: Предупреждение: Изменение файла с правами только для чтения
Обнаружена ошибка при обработке function <SNR>44_CheckModelineFileEncoding:
строка    8:
E325: ВНИМАНИЕ
Обнаружен своп-файл с именем "~/.TagHLConfig.txt.swp"
          владелец: lyokha    дата: Sun Aug 18 21:35:53 2013
         имя файла: ~lyokha/TagHLConfig.txt
           изменён: ДА
      пользователь: lyokha  компьютер: desktop.localdomain
           процесс: 20866
при открытии файла: "/home/lyokha/TagHLConfig.txt"
              дата: Sun Aug 18 21:27:37 2013

(1) Возможно, редактирование этого же файла выполняется в другой программе.
    Если это так, то будьте внимательны при внесении изменений, чтобы
    у вас не появилось два разных варианта одного и того же файла.
    Завершите работу или продолжайте с осторожностью.
(2) Сеанс редактирования этого файла завершён аварийно.
    В этом случае, используйте команду ":recover" или "vim -r /home/lyokha/TagHLConfig.txt"
    для восстановления изменений (см. ":help recovery").
    Если вы уже выполняли эту операцию, удалите своп-файл "/home/lyokha/.TagHLConfig.txt.swp"
    чтобы избежать появления этого сообщения в будущем.

Своп-файл "~/.TagHLConfig.txt.swp" уже существует!
[O] Открыть для чтения, (E) Редактировать, (R) Восстановить, (D) Удалить, (Q) Выход, (A) Прервать:

(there is Russian here). Now it claims about error in 44_CheckModelineFileEncoding (as well in Fencview). But after second <Enter> i finally get into the diff mode but with unchanged lines for some reason.

Actually i do not care much about this issue because disabling automatic Fencview fits well my tasks :)

Cheers, Alexey.