Problem with 7.3 and folding

180 views
Skip to first unread message

Tina

unread,
Mar 19, 2011, 11:37:55 AM3/19/11
to vim-perl
Hi,



I have installed vim 7.3 on debian linux by downloading the source and
compiling with prefix /home/vim7.3. (Tested with and without perl-
interpreter compiled in).



I am seeing two (similar) problems that I didn't have with vim 7.1,
and they only appear if I have folding on and syntax highlighting.

I would like to describe it and see if you can reproduce it and think
it can have something to do with perl.vim.



I have deleted my .vim/ and .vimrc for the test, and this is
the .vimrc I can reproduce it with:



let perl_fold=0 " doesn't make a difference if it is set to 1 or 0

syntax on



Now I copied CGI.pm to /tmp and made it writeable.



I open it with /home/vim73/bin/vim /tmp/CGI.pm and open the first fold
of 3646 lines.

Then I go above the first subroutine which is folded,
initialize_globals(). Here in line 43.



Now I type O to go in insert modus. This takes about 3 seconds until I
can see I am in insert modus. CPU usage of vim goes up to 99%.

Same happens if I now start to type (just typing test). This takes
more than 4 seconds until I can see what I typed.



The other problem, and this one could be reproduced by somebody with
vim 7.2, is, that all folds open if you type in a quote character.



Same steps as above, but go above subroutine "can" (line 257 here). Go
in insert modus with O, and then type:

double quote, single quote, q/ or anything like that that starts a
string.

Depending on what you typed all folds below that will be opened now
(if you type double quote, all. if you type single quote or q/, then
the first sub that is not opened is to_filehandle() in line 728.

And also this will take some seconds.



If I go to a subroutine near the end of the module instead, everything
is fast. So it seems that vim calculates something for the complete
rest of the file whenever I insert something.

If I am *inside* a subroutine it's also fast, so it depends on what
scope you are in. I can see a similar effect if I have a very long
subroutine and try to insert something at the top of it.



I remember that in version 7.1, only the next fold was opened if you
were starting a string above.



Now I would like to find out what vim is calculating here that it
takes so long.

I really like the new features in vim 7.3 and I would like to keep
using folding, so I would be glad for any hint. I suspect that both
effects belong together.



regards,

tina

Benjamin Fritz

unread,
Mar 21, 2011, 9:56:26 AM3/21/11
to vim-...@googlegroups.com
On Sat, Mar 19, 2011 at 10:37 AM, Tina <perl...@googlemail.com> wrote:
> Hi,
>
>
>
> I have installed vim 7.3 on debian linux by downloading the source and
> compiling with prefix /home/vim7.3. (Tested with and without perl-
> interpreter compiled in).
>
>
>
> I am seeing two (similar) problems that I didn't have with vim 7.1,
> and they only appear if I have folding on and syntax highlighting.
>
> I would like to describe it and see if you can reproduce it and think
> it can have something to do with perl.vim.
>
>
>
> I have deleted my .vim/ and .vimrc for the test, and this is
> the .vimrc I can reproduce it with:
>
>
>
>  let perl_fold=0 " doesn't make a difference if it is set to 1 or 0
>
>  syntax on
>
>

It is strange to me that perl_fold makes no difference. The symptoms
you describe sound a lot like they are related to syntax-based
folding.

Try the info on this page to see if it helps:

http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text

> --
> You received this message because you are subscribed to the Google Groups "vim-perl" group.
> To post to this group, send email to vim-...@googlegroups.com.
> To unsubscribe from this group, send email to vim-perl+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/vim-perl?hl=en.
>
>

Tina

unread,
Mar 21, 2011, 6:58:38 PM3/21/11
to vim-perl


On 21 Mrz., 14:56, Benjamin Fritz <fritzophre...@gmail.com> wrote:
> On Sat, Mar 19, 2011 at 10:37 AM, Tina <perlpu...@googlemail.com> wrote:

> It is strange to me that perl_fold makes no difference. The symptoms
> you describe sound a lot like they are related to syntax-based
> folding.
>
> Try the info on this page to see if it helps:
>
> http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text

ah yes, this helps a bit, thanks.

It still takes 2-3 seconds when I enter insert mode and again, when I
leave it, but while in insert, I can type normally.
And the folding issue is also gone.

But still strange, that it takes so long to go into insert mode. I
usually move around in the file in normal mode and only enter insert
mode when I really want to edit; also I have some "imap"s that switch
modes several times. One takes 15 seconds to complete...
so I still would be glad if anyone has a hint.

regards, tina

Tina

unread,
Mar 21, 2011, 7:30:51 PM3/21/11
to vim-perl
I get the suspicion that in vim 7.1 I had foldmethod=manual as a
default.
I actually don't even know what foldmethod=syntax does differently.
I set foldmethod=manual in my .vim/ftplugin/perl.vim now and see if I
miss any features.
Reply all
Reply to author
Forward
0 new messages