P.S. Switching two lines by ddp doesn't close the fold; OTOH the
do-nothing move ":m ." does.

Best regards,
Tony.

On Tue, Dec 22, 2015 at 4:29 AM, Tony Mechelynck
<[email protected]> wrote:
> On Tue, Dec 22, 2015 at 12:19 AM, Steven Hall <[email protected]> 
> wrote:
>> I have 2 versions of vim. Both the exact same configuration, but whenever I
>> do a :m command in one of them, it closes all open folds.
>>
>> I ran vim -N -u NONE to open vim with no configs or plugins.
>>
>> Then in vim I set set foldmethod=marker, to start using folds with a marker
>> (without this setting the odd behaviour does not occur).
>>
>> Now if I am on any line and do a command with :m it will close that fold.
>>
>> Example:
>>
>> /*{{{*/
>> test
>> test
>> test
>> test
>> /*}}}*/
>>
>> Hello
>>
>> Here we have 4 lines with "test" in a fold, and a stray "Hello" that is not
>> in the fold.
>>
>> With my cursor on the line of Hello if I do a :m command such as :m 6 the
>> resulting document looks like this (note that I gave the example of :m 6,
>> but every single combination of :m commands that I have tried yield the same
>> result):
>>
>> +--  6 lines:
>> ------------------------------------------------------------------------------------------
>> Hello
>>
>> The movement is correct, but now the fold is closed, which is not what I
>> would expect.
>>
>> This occurs also when the line you are moving is inside a fold (All folds
>> close).
>>
>> This is the output of vim --version that behaves in this strange way for me:
>>
>>   $ vim --version
>> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 28 2015 02:02:33)
>> Included patches: 1-942
>> Modified by pi-rho
>> Compiled by buildd@lcy01-36
>> Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
> […]
>>
>> And this is the version I have that behaves as I expect (The folds do not
>> close themselves):
>>
>>   $ vim --version
>> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan  2 2014 19:40:46)
>> Included patches: 1-52
>> Modified by [email protected]
>> Compiled by buildd@
>> Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
> […]
>
> Between 7.4.52 and 7.4.942, that's a wide range! I tried searching the
> patch descriptions at http://ftp.vim.org/pub/vim/patches/7.4/ for the
> word "fold" but the only "interesting" thing I found was patch
> 7.4.700, which would seem to repair what you found broken.
>
> Then I tried to reproduce it in my Huge gvim 7.4.979 with GTK2/Gnome2
> GUI for linux-x86_64, where the only "local changes" are in feature.h
> to set +xterm_save -tag_old_static. First I tried checking the fold
> option values and got
>   foldmethod=manual
>   foldlevel=0
>   foldmarker={{{,}}}
>   foldenable
>   foldclose=
>
> Setting foldmethod=marker _immediately_ closes the fold, which is what
> I would expect with fdl=0. So I reopened the fold by clicking right on
> the "+" character at its far left, moved the cursor back to "Hello"
> and moved that line to immediately below the fold by ":m 6". The fold
> indeed closes, which is in agreement with 'foldlevel'. So I set
> 'foldlevel' to 1 (which opened it), added an empty line above the
> "Hello", then repeated the move.
>
> This time the move didn't close the fold.
>
> 3rd experiment: Add two empty lines before Hello (e.g. by ":m $"), set
> fdl=0 (e.g. by zM), reopen only this fold (by right-arrow on its +
> token), bring back the cursor on Hello and move it, but not directly
> below the fold (by :m 7)
>
> Here too, the move closes the fold.
>
> IOW, in "modern" Vim versions, :move reapplies 'foldlevel'. This may
> be surprising to some, but I think it is understandable. Bram, what do
> you think? Bug or feature?
>
>
> Best regards,
> Tony.

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