|
Karsten Hopp |
47d5ba |
To: vim-dev@vim.org
|
|
Karsten Hopp |
47d5ba |
Subject: Patch 7.0.149
|
|
Karsten Hopp |
47d5ba |
Fcc: outbox
|
|
Karsten Hopp |
47d5ba |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
47d5ba |
Mime-Version: 1.0
|
|
Karsten Hopp |
47d5ba |
Content-Type: text/plain; charset=ISO-8859-1
|
|
Karsten Hopp |
47d5ba |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
47d5ba |
------------
|
|
Karsten Hopp |
47d5ba |
|
|
Karsten Hopp |
47d5ba |
Patch 7.0.149
|
|
Karsten Hopp |
47d5ba |
Problem: When resizing a window that shows "~" lines the text sometimes
|
|
Karsten Hopp |
47d5ba |
jumps down.
|
|
Karsten Hopp |
47d5ba |
Solution: Remove code that uses "~" lines in some situations. Fix the
|
|
Karsten Hopp |
47d5ba |
computation of the screen line of the cursor. Also set w_skipcol
|
|
Karsten Hopp |
47d5ba |
to handle very long lines.
|
|
Karsten Hopp |
47d5ba |
Files: src/misc1.c, src/window.c
|
|
Karsten Hopp |
47d5ba |
|
|
Karsten Hopp |
47d5ba |
|
|
Karsten Hopp |
47d5ba |
*** ../vim-7.0.148/src/misc1.c Tue Oct 17 11:12:28 2006
|
|
Karsten Hopp |
47d5ba |
--- src/misc1.c Tue Oct 24 17:33:39 2006
|
|
Karsten Hopp |
47d5ba |
***************
|
|
Karsten Hopp |
47d5ba |
*** 1761,1775 ****
|
|
Karsten Hopp |
47d5ba |
* Add column offset for 'number', 'foldcolumn', etc.
|
|
Karsten Hopp |
47d5ba |
*/
|
|
Karsten Hopp |
47d5ba |
width = W_WIDTH(wp) - win_col_off(wp);
|
|
Karsten Hopp |
47d5ba |
! if (width > 0)
|
|
Karsten Hopp |
47d5ba |
! {
|
|
Karsten Hopp |
47d5ba |
! lines += 1;
|
|
Karsten Hopp |
47d5ba |
! if (col >= width)
|
|
Karsten Hopp |
47d5ba |
! lines += (col - width) / (width + win_col_off2(wp));
|
|
Karsten Hopp |
47d5ba |
! if (lines <= wp->w_height)
|
|
Karsten Hopp |
47d5ba |
! return lines;
|
|
Karsten Hopp |
47d5ba |
! }
|
|
Karsten Hopp |
47d5ba |
! return (int)(wp->w_height); /* maximum length */
|
|
Karsten Hopp |
47d5ba |
}
|
|
Karsten Hopp |
47d5ba |
|
|
Karsten Hopp |
47d5ba |
int
|
|
Karsten Hopp |
47d5ba |
--- 1761,1773 ----
|
|
Karsten Hopp |
47d5ba |
* Add column offset for 'number', 'foldcolumn', etc.
|
|
Karsten Hopp |
47d5ba |
*/
|
|
Karsten Hopp |
47d5ba |
width = W_WIDTH(wp) - win_col_off(wp);
|
|
Karsten Hopp |
47d5ba |
! if (width <= 0)
|
|
Karsten Hopp |
47d5ba |
! return 9999;
|
|
Karsten Hopp |
47d5ba |
!
|
|
Karsten Hopp |
47d5ba |
! lines += 1;
|
|
Karsten Hopp |
47d5ba |
! if (col > width)
|
|
Karsten Hopp |
47d5ba |
! lines += (col - width) / (width + win_col_off2(wp)) + 1;
|
|
Karsten Hopp |
47d5ba |
! return lines;
|
|
Karsten Hopp |
47d5ba |
}
|
|
Karsten Hopp |
47d5ba |
|
|
Karsten Hopp |
47d5ba |
int
|
|
Karsten Hopp |
47d5ba |
*** ../vim-7.0.148/src/window.c Tue Sep 5 16:29:38 2006
|
|
Karsten Hopp |
47d5ba |
--- src/window.c Tue Oct 24 20:39:56 2006
|
|
Karsten Hopp |
47d5ba |
***************
|
|
Karsten Hopp |
47d5ba |
*** 5189,5199 ****
|
|
Karsten Hopp |
47d5ba |
int height;
|
|
Karsten Hopp |
47d5ba |
{
|
|
Karsten Hopp |
47d5ba |
linenr_T lnum;
|
|
Karsten Hopp |
47d5ba |
- linenr_T bot;
|
|
Karsten Hopp |
47d5ba |
int sline, line_size;
|
|
Karsten Hopp |
47d5ba |
- int space;
|
|
Karsten Hopp |
47d5ba |
- int did_below = FALSE;
|
|
Karsten Hopp |
47d5ba |
- int old_height = wp->w_height;
|
|
Karsten Hopp |
47d5ba |
#define FRACTION_MULT 16384L
|
|
Karsten Hopp |
47d5ba |
|
|
Karsten Hopp |
47d5ba |
/* Don't want a negative height. Happens when splitting a tiny window.
|
|
Karsten Hopp |
47d5ba |
--- 5189,5195 ----
|
|
Karsten Hopp |
47d5ba |
***************
|
|
Karsten Hopp |
47d5ba |
*** 5228,5281 ****
|
|
Karsten Hopp |
47d5ba |
wp->w_wrow = ((long)wp->w_fraction * (long)height - 1L) / FRACTION_MULT;
|
|
Karsten Hopp |
47d5ba |
line_size = plines_win_col(wp, lnum, (long)(wp->w_cursor.col)) - 1;
|
|
Karsten Hopp |
47d5ba |
sline = wp->w_wrow - line_size;
|
|
Karsten Hopp |
47d5ba |
if (sline < 0)
|
|
Karsten Hopp |
47d5ba |
{
|
|
Karsten Hopp |
47d5ba |
/*
|
|
Karsten Hopp |
47d5ba |
* Cursor line would go off top of screen if w_wrow was this high.
|
|
Karsten Hopp |
47d5ba |
*/
|
|
Karsten Hopp |
47d5ba |
wp->w_wrow = line_size;
|
|
Karsten Hopp |
47d5ba |
}
|
|
Karsten Hopp |
47d5ba |
else
|
|
Karsten Hopp |
47d5ba |
{
|
|
Karsten Hopp |
47d5ba |
! space = height - 1;
|
|
Karsten Hopp |
47d5ba |
!
|
|
Karsten Hopp |
47d5ba |
! while (lnum > 1)
|
|
Karsten Hopp |
47d5ba |
{
|
|
Karsten Hopp |
47d5ba |
- /* When using "~" lines stop when at the old topline, don't
|
|
Karsten Hopp |
47d5ba |
- * scroll down. */
|
|
Karsten Hopp |
47d5ba |
- if (did_below && height < old_height && lnum <= wp->w_topline)
|
|
Karsten Hopp |
47d5ba |
- sline = 0;
|
|
Karsten Hopp |
47d5ba |
-
|
|
Karsten Hopp |
47d5ba |
- space -= line_size;
|
|
Karsten Hopp |
47d5ba |
- if (space > 0 && sline <= 0 && !did_below)
|
|
Karsten Hopp |
47d5ba |
- {
|
|
Karsten Hopp |
47d5ba |
- /* Try to use "~" lines below the text to avoid that text
|
|
Karsten Hopp |
47d5ba |
- * is above the window while there are empty lines.
|
|
Karsten Hopp |
47d5ba |
- * Subtract the rows below the cursor from "space" and
|
|
Karsten Hopp |
47d5ba |
- * give the rest to "sline". */
|
|
Karsten Hopp |
47d5ba |
- did_below = TRUE;
|
|
Karsten Hopp |
47d5ba |
- bot = wp->w_cursor.lnum;
|
|
Karsten Hopp |
47d5ba |
- while (space > 0)
|
|
Karsten Hopp |
47d5ba |
- {
|
|
Karsten Hopp |
47d5ba |
- if (wp->w_buffer->b_ml.ml_line_count - bot >= space)
|
|
Karsten Hopp |
47d5ba |
- space = 0;
|
|
Karsten Hopp |
47d5ba |
- else
|
|
Karsten Hopp |
47d5ba |
- {
|
|
Karsten Hopp |
47d5ba |
- #ifdef FEAT_FOLDING
|
|
Karsten Hopp |
47d5ba |
- hasFoldingWin(wp, bot, NULL, &bot, TRUE, NULL);
|
|
Karsten Hopp |
47d5ba |
- #endif
|
|
Karsten Hopp |
47d5ba |
- if (bot >= wp->w_buffer->b_ml.ml_line_count)
|
|
Karsten Hopp |
47d5ba |
- break;
|
|
Karsten Hopp |
47d5ba |
- ++bot;
|
|
Karsten Hopp |
47d5ba |
- space -= plines_win(wp, bot, TRUE);
|
|
Karsten Hopp |
47d5ba |
- }
|
|
Karsten Hopp |
47d5ba |
- }
|
|
Karsten Hopp |
47d5ba |
- if (bot == wp->w_buffer->b_ml.ml_line_count && space > 0)
|
|
Karsten Hopp |
47d5ba |
- sline += space;
|
|
Karsten Hopp |
47d5ba |
- }
|
|
Karsten Hopp |
47d5ba |
- if (sline <= 0)
|
|
Karsten Hopp |
47d5ba |
- break;
|
|
Karsten Hopp |
47d5ba |
-
|
|
Karsten Hopp |
47d5ba |
#ifdef FEAT_FOLDING
|
|
Karsten Hopp |
47d5ba |
hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
|
|
Karsten Hopp |
47d5ba |
if (lnum == 1)
|
|
Karsten Hopp |
47d5ba |
--- 5224,5267 ----
|
|
Karsten Hopp |
47d5ba |
wp->w_wrow = ((long)wp->w_fraction * (long)height - 1L) / FRACTION_MULT;
|
|
Karsten Hopp |
47d5ba |
line_size = plines_win_col(wp, lnum, (long)(wp->w_cursor.col)) - 1;
|
|
Karsten Hopp |
47d5ba |
sline = wp->w_wrow - line_size;
|
|
Karsten Hopp |
47d5ba |
+
|
|
Karsten Hopp |
47d5ba |
+ if (sline >= 0)
|
|
Karsten Hopp |
47d5ba |
+ {
|
|
Karsten Hopp |
47d5ba |
+ /* Make sure the whole cursor line is visible, if possible. */
|
|
Karsten Hopp |
47d5ba |
+ int rows = plines_win(wp, lnum, FALSE);
|
|
Karsten Hopp |
47d5ba |
+
|
|
Karsten Hopp |
47d5ba |
+ if (sline > wp->w_height - rows)
|
|
Karsten Hopp |
47d5ba |
+ {
|
|
Karsten Hopp |
47d5ba |
+ sline = wp->w_height - rows;
|
|
Karsten Hopp |
47d5ba |
+ wp->w_wrow -= rows - line_size;
|
|
Karsten Hopp |
47d5ba |
+ }
|
|
Karsten Hopp |
47d5ba |
+ }
|
|
Karsten Hopp |
47d5ba |
+
|
|
Karsten Hopp |
47d5ba |
if (sline < 0)
|
|
Karsten Hopp |
47d5ba |
{
|
|
Karsten Hopp |
47d5ba |
/*
|
|
Karsten Hopp |
47d5ba |
* Cursor line would go off top of screen if w_wrow was this high.
|
|
Karsten Hopp |
47d5ba |
+ * Make cursor line the first line in the window. If not enough
|
|
Karsten Hopp |
47d5ba |
+ * room use w_skipcol;
|
|
Karsten Hopp |
47d5ba |
*/
|
|
Karsten Hopp |
47d5ba |
wp->w_wrow = line_size;
|
|
Karsten Hopp |
47d5ba |
+ if (wp->w_wrow >= wp->w_height
|
|
Karsten Hopp |
47d5ba |
+ && (W_WIDTH(wp) - win_col_off(wp)) > 0)
|
|
Karsten Hopp |
47d5ba |
+ {
|
|
Karsten Hopp |
47d5ba |
+ wp->w_skipcol += W_WIDTH(wp) - win_col_off(wp);
|
|
Karsten Hopp |
47d5ba |
+ --wp->w_wrow;
|
|
Karsten Hopp |
47d5ba |
+ while (wp->w_wrow >= wp->w_height)
|
|
Karsten Hopp |
47d5ba |
+ {
|
|
Karsten Hopp |
47d5ba |
+ wp->w_skipcol += W_WIDTH(wp) - win_col_off(wp)
|
|
Karsten Hopp |
47d5ba |
+ + win_col_off2(wp);
|
|
Karsten Hopp |
47d5ba |
+ --wp->w_wrow;
|
|
Karsten Hopp |
47d5ba |
+ }
|
|
Karsten Hopp |
47d5ba |
+ }
|
|
Karsten Hopp |
47d5ba |
}
|
|
Karsten Hopp |
47d5ba |
else
|
|
Karsten Hopp |
47d5ba |
{
|
|
Karsten Hopp |
47d5ba |
! while (sline > 0 && lnum > 1)
|
|
Karsten Hopp |
47d5ba |
{
|
|
Karsten Hopp |
47d5ba |
#ifdef FEAT_FOLDING
|
|
Karsten Hopp |
47d5ba |
hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
|
|
Karsten Hopp |
47d5ba |
if (lnum == 1)
|
|
Karsten Hopp |
47d5ba |
*** ../vim-7.0.148/src/version.c Tue Oct 24 13:51:47 2006
|
|
Karsten Hopp |
47d5ba |
--- src/version.c Tue Oct 24 21:13:31 2006
|
|
Karsten Hopp |
47d5ba |
***************
|
|
Karsten Hopp |
47d5ba |
*** 668,669 ****
|
|
Karsten Hopp |
47d5ba |
--- 668,671 ----
|
|
Karsten Hopp |
47d5ba |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
47d5ba |
+ /**/
|
|
Karsten Hopp |
47d5ba |
+ 149,
|
|
Karsten Hopp |
47d5ba |
/**/
|
|
Karsten Hopp |
47d5ba |
|
|
Karsten Hopp |
47d5ba |
--
|
|
Karsten Hopp |
47d5ba |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
47d5ba |
104. When people ask about the Presidential Election you ask "Which country?"
|
|
Karsten Hopp |
47d5ba |
|
|
Karsten Hopp |
47d5ba |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
47d5ba |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
47d5ba |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
47d5ba |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|