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.090 < prev    next >
Encoding:
Internet Message Format  |  2001-11-05  |  4.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.090
  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.090
  11. Problem:    When a wrapping line does not fit in a window and 'scrolloff' is 
  12.             bigger than half the window height, moving the cursor left or
  13.             right causes the screen to flash badly. (Lubomir Host)
  14. Solution:   When there is not enough room to show 'scrolloff' screen lines and
  15.             near the end of the line, show the end of the line.
  16. Files:      src/move.c
  17.  
  18.  
  19. *** ../vim60.89/src/move.c    Sat Sep 29 10:11:29 2001
  20. --- src/move.c    Tue Nov  6 21:38:50 2001
  21. ***************
  22. *** 931,936 ****
  23. --- 931,937 ----
  24.       int        extra;        /* offset for first screen line */
  25.       int        off;
  26.       int        n;
  27. +     int        p_lines;
  28.       int        width = 0;
  29.       int        textwidth;
  30.       int        new_leftcol;
  31. ***************
  32. *** 1071,1081 ****
  33.   
  34.       prev_skipcol = curwin->w_skipcol;
  35.   
  36. !     n = 0;
  37.       if ((curwin->w_wrow >= curwin->w_height
  38.           || ((prev_skipcol > 0
  39.               || curwin->w_wrow + p_so >= curwin->w_height)
  40. !             && (n =
  41.   #ifdef FEAT_DIFF
  42.               plines_win_nofill
  43.   #else
  44. --- 1072,1082 ----
  45.   
  46.       prev_skipcol = curwin->w_skipcol;
  47.   
  48. !     p_lines = 0;
  49.       if ((curwin->w_wrow >= curwin->w_height
  50.           || ((prev_skipcol > 0
  51.               || curwin->w_wrow + p_so >= curwin->w_height)
  52. !             && (p_lines =
  53.   #ifdef FEAT_DIFF
  54.               plines_win_nofill
  55.   #else
  56. ***************
  57. *** 1102,1116 ****
  58.           extra = 1;
  59.       /* Compute last display line of the buffer line that we want at the
  60.        * bottom of the window. */
  61. !     if (n == 0)
  62. !         n = plines_win(curwin, curwin->w_cursor.lnum, FALSE);
  63. !     --n;
  64. !     if (curwin->w_wrow + p_so < n)
  65.           n = curwin->w_wrow + p_so;
  66.       if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width)
  67.           extra += 2;
  68.   
  69. !     if (extra == 3)
  70.       {
  71.           /* not enough room for 'scrolloff', put cursor in the middle */
  72.           n = curwin->w_virtcol / width;
  73. --- 1103,1119 ----
  74.           extra = 1;
  75.       /* Compute last display line of the buffer line that we want at the
  76.        * bottom of the window. */
  77. !     if (p_lines == 0)
  78. !         p_lines = plines_win(curwin, curwin->w_cursor.lnum, FALSE);
  79. !     --p_lines;
  80. !     if (p_lines > curwin->w_wrow + p_so)
  81.           n = curwin->w_wrow + p_so;
  82. +     else
  83. +         n = p_lines;
  84.       if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width)
  85.           extra += 2;
  86.   
  87. !     if (extra == 3 || p_lines < p_so * 2)
  88.       {
  89.           /* not enough room for 'scrolloff', put cursor in the middle */
  90.           n = curwin->w_virtcol / width;
  91. ***************
  92. *** 1118,1123 ****
  93. --- 1121,1129 ----
  94.           n -= curwin->w_height / 2;
  95.           else
  96.           n = 0;
  97. +         /* don't skip more than necessary */
  98. +         if (n > p_lines - curwin->w_height + 1)
  99. +         n = p_lines - curwin->w_height + 1;
  100.           curwin->w_skipcol = n * width;
  101.       }
  102.       else if (extra == 1)
  103. ***************
  104. *** 1149,1160 ****
  105.           curwin->w_wrow -= extra;
  106.       }
  107.   
  108. !     extra = (curwin->w_skipcol - prev_skipcol) / width;
  109.       if (extra > 0)
  110.           win_ins_lines(curwin, 0, extra, FALSE, FALSE);
  111.       else if (extra < 0)
  112.           win_del_lines(curwin, 0, -extra, FALSE, FALSE);
  113.       }
  114.       else
  115.       curwin->w_skipcol = 0;
  116. --- 1155,1165 ----
  117.           curwin->w_wrow -= extra;
  118.       }
  119.   
  120. !     extra = ((int)prev_skipcol - (int)curwin->w_skipcol) / width;
  121.       if (extra > 0)
  122.           win_ins_lines(curwin, 0, extra, FALSE, FALSE);
  123.       else if (extra < 0)
  124.           win_del_lines(curwin, 0, -extra, FALSE, FALSE);
  125.       }
  126.       else
  127.       curwin->w_skipcol = 0;
  128. *** ../vim60.89/src/version.c    Tue Nov  6 19:43:29 2001
  129. --- src/version.c    Tue Nov  6 21:42:02 2001
  130. ***************
  131. *** 608,609 ****
  132. --- 608,611 ----
  133.   {   /* Add new patch number below this line */
  134. + /**/
  135. +     90,
  136.   /**/
  137.  
  138. -- 
  139. How To Keep A Healthy Level Of Insanity:
  140. 2. Page yourself over the intercom. Don't disguise your voice.
  141.  
  142.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  143. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  144.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  145.