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

Patch 6.1.449

Expand Messages
  • Bram Moolenaar
    Patch 6.1.449 Problem: When 1 and a are in formatoptions , auto-formatting always moves a newly added character to the next line. (Servatius Brandt)
    Message 1 of 1 , Apr 6, 2003
      Patch 6.1.449
      Problem: When "1" and "a" are in 'formatoptions', auto-formatting always
      moves a newly added character to the next line. (Servatius Brandt)
      Solution: Don't move a single character to the next line when it was just
      typed.
      Files: src/edit.c


      *** ../vim61.448/src/edit.c Sat Mar 15 17:55:18 2003
      --- src/edit.c Sun Apr 6 15:48:38 2003
      ***************
      *** 4343,4351 ****
      old = ml_get_curline();

      /* Don't format in Insert mode when the cursor is on a trailing blank, the
      ! * user might insert normal text next. */
      ! if (*old != NUL && pos.col == STRLEN(old) && vim_iswhite(old[pos.col - 1]))
      ! return;

      #ifdef FEAT_COMMENTS
      /* With the 'c' flag in 'formatoptions' only format comments. */
      --- 4343,4366 ----
      old = ml_get_curline();

      /* Don't format in Insert mode when the cursor is on a trailing blank, the
      ! * user might insert normal text next. Also skip formatting when "1" is
      ! * in 'formatoptions' and there is a single character before the cursor.
      ! * Otherwise the line would be broken and when typing another non-white
      ! * next they are not joined back together. */
      ! if (*old != NUL && pos.col == STRLEN(old))
      ! {
      ! dec_cursor();
      ! if (!WHITECHAR(gchar_cursor())
      ! && curwin->w_cursor.col > 0
      ! && has_format_option(FO_ONE_LETTER))
      ! dec_cursor();
      ! if (WHITECHAR(gchar_cursor()))
      ! {
      ! curwin->w_cursor = pos;
      ! return;
      ! }
      ! curwin->w_cursor = pos;
      ! }

      #ifdef FEAT_COMMENTS
      /* With the 'c' flag in 'formatoptions' only format comments. */
      *** ../vim61.448/src/version.c Sun Apr 6 15:22:34 2003
      --- src/version.c Sun Apr 6 16:16:09 2003
      ***************
      *** 613,614 ****
      --- 613,616 ----
      { /* Add new patch number below this line */
      + /**/
      + 449,
      /**/

      --
      Vi beats Emacs to death, and then again!
      http://linuxtoday.com/stories/5764.html

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.