Loading ...
Sorry, an error occurred while loading the content.
 

Re: Ctrl-X Ctrl-E treats folded lines badly

Expand Messages
  • Bram Moolenaar
    ... +++ move.c 5 Dec 2004 12:24:17 -0000 @@ -1551,7 +1551,12 @@ --curwin- w_topfill; else #endif + { +#ifdef FEAT_FOLDING +
    Message 1 of 4 , Dec 5, 2004
      Gautam wrote:

      > I'm using Vim 6.3.28, and I find the following:
      >
      > If a closed fold is the first line displayed on the screen, and you try
      > and scroll up / down with ^E/^Y, then everything works fine.
      >
      > However if you're in insert mode, and try scrolling using ^X-^E / ^X-^Y,
      > then ^X-^Y works fine. However ^X^E does not scroll the first line
      > (which is a closed fold) of the screen. Instead it decreases one from
      > the number of lines in the closed fold.
      >
      > After exiting insert mode, and scrolling up manually, the fold sometimes
      > looks garbled. Opening and closing the fold makes it look normal again.
      >
      > Is there a fix for this in a later version?

      Try this patch:

      --- move.c 3 Jul 2004 16:01:52 -0000 1.2
      +++ move.c 5 Dec 2004 12:24:17 -0000
      @@ -1551,7 +1551,12 @@
      --curwin->w_topfill;
      else
      #endif
      + {
      +#ifdef FEAT_FOLDING
      + (void)hasFolding(curwin->w_topline, NULL, &curwin->w_topline);
      +#endif
      ++curwin->w_topline;
      + }
      ++curwin->w_botline; /* approximate w_botline */
      curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE);
      }

      Let me know if it works OK then.

      --
      The acknowledged parents of reengineering are Michael Hammer and James Champy.
      When I say they're the "parents" I don't mean they had sex - and I apologize
      for making you think about it. I mean they wrote the best-selling business
      book _Reengineering the Corporation_, which was published in 1993.
      Businesses flocked to reengineering like frat boys to a drunken
      cheerleader. (This analogy wasn't necessary, but I'm trying to get my mind
      off that Hammer and Champy thing.)
      (Scott Adams - The Dilbert principle)

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
    • GI
      ... Works great now. Thanks Bram :) Gautam -- Twenty Ways To Maintain A Healthy Level of Insanity 15. Five days in advance, tell your friends you can t attend
      Message 2 of 4 , Dec 5, 2004
        On Sun, Dec 05, 2004 at 01:59:02PM +0100, Bram Moolenaar wrote:

        > Gautam wrote:
        >
        > > I'm using Vim 6.3.28, and I find the following:
        > >
        > > If a closed fold is the first line displayed on the screen, and you try
        > > and scroll up / down with ^E/^Y, then everything works fine.
        > >
        > > However if you're in insert mode, and try scrolling using ^X-^E / ^X-^Y,
        > > then ^X-^Y works fine. However ^X^E does not scroll the first line
        > > (which is a closed fold) of the screen. Instead it decreases one from
        > > the number of lines in the closed fold.
        > >
        > > After exiting insert mode, and scrolling up manually, the fold sometimes
        > > looks garbled. Opening and closing the fold makes it look normal again.
        >
        > Try this patch:
        >
        > [snip]
        >
        > Let me know if it works OK then.

        Works great now. Thanks Bram :)

        Gautam

        --
        Twenty Ways To Maintain A Healthy Level of Insanity
        15. Five days in advance, tell your friends you can't attend their
        party because you're not in the mood.
      Your message has been successfully submitted and would be delivered to recipients shortly.