On Fri, Apr 16, 2010 at 11:28 AM, Marvin Renich <[email protected]> wrote: > [dropping vim_use] > > * Christian Brabandt <[email protected]> [100416 08:35]: >> This has come up on the vim_use mailinglist. The problem seems to be >> that after recovery of a swap buffer, the file should be modified so you >> are not loosing your changes after e.g. accidently hitting ZZ >> >> Signed-off-by: Christian Brabandt <[email protected]> >> --- >> src/memline.c | 1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >> diff --git a/src/memline.c b/src/memline.c >> index 102b61e..c4a0d87 100644 >> --- a/src/memline.c >> +++ b/src/memline.c >> @@ -1326,6 +1326,7 @@ ml_recover() >> * the buffer. Delete it. >> */ >> ml_delete(curbuf->b_ml.ml_line_count, FALSE); >> + curbuf->b_changed = TRUE; >> curbuf->b_flags |= BF_RECOVERED; >> >> recoverymode = FALSE; >> -- >> 1.6.5.7 >> >> regards, >> Christian > > Shouldn't this set curbuf->b_changed based on the "modified" setting > from the swap file, so that if you "recover" a file that was not > modified, you don't set the modified flag?
I'd think that any time you recover from a swap file, the buffer should be considered "modified". The modified flag indicates that the buffer is different than the on-disk file with the same name. Whether or not the buffer was modified at the time that the swap file was last updated has no bearing on whether the content recovered from the swap file matches the current contents of the file that was being edited. That's up to the user to diagnose and decide what steps to take. -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]> -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php Subscription settings: http://groups.google.com/group/vim_dev/subscribe?hl=en
