home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.068 < prev    next >
Encoding:
Internet Message Format  |  2001-11-02  |  2.4 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.068
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.068
  11. Problem:    When formatting a Visually selected area with "gq" and the number
  12.         of lines increases the last line may not be redrawn correctly.
  13.         (Yegappan Lakshmanan)
  14. Solution:   Correct the area to be redrawn for inserted/deleted lines.
  15. Files:        src/ops.c
  16.  
  17.  
  18. *** ../vim60.67/src/ops.c    Wed Oct 31 20:51:33 2001
  19. --- src/ops.c    Sat Nov  3 21:25:47 2001
  20. ***************
  21. *** 4034,4043 ****
  22.       if (oap->end_adjusted && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
  23.       ++curwin->w_cursor.lnum;
  24.       beginline(BL_WHITE | BL_FIX);
  25. !     msgmore(curbuf->b_ml.ml_line_count - old_line_count);
  26.   
  27.       /* put '] mark on the end of the formatted area */
  28.       curbuf->b_op_end = curwin->w_cursor;
  29.   }
  30.   
  31.   /*
  32. --- 4035,4065 ----
  33.       if (oap->end_adjusted && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
  34.       ++curwin->w_cursor.lnum;
  35.       beginline(BL_WHITE | BL_FIX);
  36. !     old_line_count = curbuf->b_ml.ml_line_count - old_line_count;
  37. !     msgmore(old_line_count);
  38.   
  39.       /* put '] mark on the end of the formatted area */
  40.       curbuf->b_op_end = curwin->w_cursor;
  41. + #ifdef FEAT_VISUAL
  42. +     if (oap->is_VIsual)
  43. +     {
  44. +     win_T    *wp;
  45. +     FOR_ALL_WINDOWS(wp)
  46. +     {
  47. +         if (wp->w_old_cursor_lnum != 0)
  48. +         {
  49. +         /* When lines have been inserted or deleted, adjust the end of
  50. +          * the Visual area to be redrawn. */
  51. +         if (wp->w_old_cursor_lnum > wp->w_old_visual_lnum)
  52. +             wp->w_old_cursor_lnum += old_line_count;
  53. +         else
  54. +             wp->w_old_visual_lnum += old_line_count;
  55. +         }
  56. +     }
  57. +     }
  58. + #endif
  59.   }
  60.   
  61.   /*
  62. *** ../vim60.67/src/version.c    Sat Nov  3 14:16:30 2001
  63. --- src/version.c    Sat Nov  3 21:28:49 2001
  64. ***************
  65. *** 608,609 ****
  66. --- 608,611 ----
  67.   {   /* Add new patch number below this line */
  68. + /**/
  69. +     68,
  70.   /**/
  71.  
  72. -- 
  73. At some point in the project somebody will start whining about the need to
  74. determine the project "requirements".  This involves interviewing people who
  75. don't know what they want but, curiously, know exactly when they need it.
  76.                 (Scott Adams - The Dilbert principle)
  77.  
  78.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  79. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  80.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  81.