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

Ctrl-X Ctrl-E treats folded lines badly

Expand Messages
  • GI
    Hi all, 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
    Message 1 of 4 , Dec 3, 2004
    • 0 Attachment
      Hi all,

      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?

      Thanks,

      Gautam

      --
      ACTUAL LABEL INSTRUCTIONS ON CONSUMER GOODS:
      On Tesco's Tiramisu dessert (printed on bottom): "Do not turn upside
      down."
    • Christian J. Robinson
      ... [...] ... [...] ... I m running the latest version of Vim (6.3.38), and I m seeing this problem as well. It s definitely odd to see. - Christian --
      Message 2 of 4 , Dec 4, 2004
      • 0 Attachment
        Yesterday (Fri, 3 Dec 2004), GI wrote:

        > I'm using Vim 6.3.28, and I find the following:
        [...]
        > 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.
        [...]
        > Is there a fix for this in a later version?

        I'm running the latest version of Vim (6.3.38), and I'm seeing this
        problem as well. It's definitely odd to see.

        - Christian

        --
        Expecting the world to treat you fairly because you are good is like
        expecting the bull not to charge because you are a vegetarian.
        Christian J. Robinson <infynity@...> http://infynity.spodzone.com/
        PGP key: 0x893B0EAF / 0xFB698360 http://infynity.spodzone.com/pgp
      • Bram Moolenaar
        ... +++ move.c 5 Dec 2004 12:24:17 -0000 @@ -1551,7 +1551,12 @@ --curwin- w_topfill; else #endif + { +#ifdef FEAT_FOLDING +
        Message 3 of 4 , Dec 5, 2004
        • 0 Attachment
          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 4 of 4 , Dec 5, 2004
          • 0 Attachment
            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.