Xavier de Gaye wrote:

> In the following test case, 'foobar' and  'dummy_file' are two
> non-existent files:
> 
> gvim -o foobar dummy_file
>    :set buftype=nofile
>    :call append(1, "second line")    -> foobar contains now two lines
>    <CTRL-W> W
>    :edit foobar                      -> a) foobar still contains two lines
>    :edit foobar                      -> b) Ooops... foobar contains no lines 
> now !
> 
> The problem is that do_ecmd() does not handle this case in a consistent way, 
> whether:
> 1) foobar is not curbuf and therefore 'other_file' is true (in case (a) above)
> 2) or foobar is curbuf and therefore 'other_file' is false (in case (b) 
> above) in which case buf_clear_file(curbuf) is invoked by do_ecmd()

If you do this with a file then the same thing happens, except that you
will get an error at the second ":edit foobar", since the buffer was
changed and you are trying to drop the changes.

It may seem a bit inconsistant, but changing this will most likely cause
some plugins to fail in a weird way.  Better just keep it as it is.

-- 
Amnesia is one of my favorite words, but I forgot what it means.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui