Christian Brabandt wrote:

> On Di, 14 Apr 2015, Yutao Yuan wrote:
> 
> > Steps to reproduce:
> > 
> > 1. create a buffer with two lines.
> > 2. set 'fdm' to indent.
> > 3. insert two lines with some text indented according to 'sw' to create a 
> > fold.
> > 4. execute :m1 on the first line.
> > 5. close the fold and try to delete the fold.
> > 
> > This will cause a E315 error. Reproducible with latest version 7.4.698
> > with command line flag -u NONE -N.
> 
> I see two problems here.
> 1) First after step 4 (:m1) the fold info is destroyed and I am not able
>    to fold the lines again. This looks like the problem I have been 
>    trying to fix with this patch:
>    https://groups.google.com/d/msg/vim_dev/5SD5E_hyGPk/-ojYGyeNbwYJ
> 
> 2) After step 5 (trying to delete all the lines within a fold, I first
>    thought you were trying to delete the fold, which doesn't work for 
>    indented folded lines), I get a bunch of E315 errors.
>    The problem here is that hasFoldingWin() function sets lnume to the 
>    line after the fold, which is actually invalid, because the buffer 
>    does not have that many lines. This also causes that foldtext() 
>    returns an empty string for that region. So in the following patch, I 
>    check, that the last line is actually a valid buffer line and if it 
>    is larger than the lines of the buffer, set it to the end of the 
>    buffer (see attached patch).
> 
> Both patch are also available here:
> https://github.com/chrisbra/vim-mq-patches/blob/master/fold_bug
> https://github.com/chrisbra/vim-mq-patches/blob/master/move_folding_bug

Thanks.  I'll include the attached fix.

I have a note that says that the move_folding_bug patch doesn't
completely fix it.  Is it still worth including?  Perhaps a test that
afails before and succeeds after the patch makes clear what it changes.


-- 
How come wrong numbers are never busy?

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