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

Re: seidescroll after :se nowrap on short lines

Expand Messages
  • Bram Moolenaar
    ... The code is not really prepared for switching between wrap and nowrap all the time. When nowrap is set the j command, moving to cursor to a
    Message 1 of 2 , Aug 29, 2000
    • 0 Attachment
      Raul wrote:

      > after use :se nowrap on a long line (involving a sidescroll) vim will keep
      > on sidescrolling after :se nowrap even on short lines that do not need a
      > sidescroll if the cursor desired column is greater than the columns number
      >
      > for example:
      >
      > step 1)
      >
      > start vim -u NONE -U NONE
      > and type:
      > :h
      > JJ$:se nowrap
      >
      > so far so good, you've created a long line, and moved to a position that
      > needed a sidescroll to show the cursor after :se nowrap but now do this:
      >
      > step 2)
      >
      > :se wrap
      > j:se nowrap
      >
      > ie turn on wrap, and move the cursor to a short line, note that the desired
      > column is still that of the long line, when you turn off wrap vim
      > sidescrolls again, it doesn't need to, since it is in a short line, it
      > wouldn't without step 1)
      >
      > from now on, ":se nowrap" will often sidescroll even if both, real and
      > desired columns, are lessthan the screen columns.

      The code is not really prepared for switching between 'wrap' and 'nowrap' all
      the time. When 'nowrap' is set the "j" command, moving to cursor to a
      character that is visible, won't change the left offset. That you did "set
      wrap" in between doesn't change this.

      I suppose the left offset should be reset when you do ":set wrap". Patchy:

      *** option.c~ Mon Aug 28 11:46:47 2000
      --- option.c Tue Aug 29 10:56:13 2000
      ***************
      *** 4832,4837 ****
      --- 4832,4845 ----
      }
      #endif

      + /* If 'wrap' is set, set w_leftcol to zero. */
      + else if ((int *)varp == &curwin->w_p_wrap)
      + {
      + if (curwin->w_p_wrap)
      + curwin->w_leftcol = 0;
      + }
      +
      +
      /*
      * End of handling side effects for bool options.
      */


      --
      Why is "abbreviation" such a long word?

      /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
      \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.