How to reproduce: - go to directory with Vim sources, - build C tags for Vim sources, - start Vim: $ vim -c 'set number lines=24 columns=80' \ -c 531 -c 'normal 20|' \ -c 'exe "normal \<C-w>\<C-]>"' \ -O syntax.c syntax.c - move the current window to the top: :wincmd K
The cursor is displayed on line 804 of structs.h, while it should be displayed on line 802. Analogically, moving a window in the horizontal direction: $ vim -c 'set number lines=24 columns=80' \ -c 531 -c 'normal 20|' \ -c 'exe "normal \<C-w>\<C-]>"' \ syntax.c :wincmd L The cursor is displayed on line 799, while it should remain on line 802. -- Cheers, Lech -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
diff --git a/src/move.c b/src/move.c index 26ff3bf..c8c2a20 100644 --- a/src/move.c +++ b/src/move.c @@ -696,7 +696,7 @@ validate_cline_row() /* * Compute wp->w_cline_row and wp->w_cline_height, based on the current value - * of wp->w_topine. + * of wp->w_topline. * * Returns OK when cursor is in the window, FAIL when it isn't. */ diff --git a/src/window.c b/src/window.c index c1955ad..4f87e5a 100644 --- a/src/window.c +++ b/src/window.c @@ -991,28 +991,28 @@ win_split_ins(size, flags, newwin, dir) wp->w_p_scr = curwin->w_p_scr; if (need_status) { - --oldwin->w_height; + win_new_height(oldwin, oldwin->w_height - 1); oldwin->w_status_height = need_status; } if (flags & (WSP_TOP | WSP_BOT)) { /* set height and row of new window to full height */ wp->w_winrow = tabline_height(); - wp->w_height = curfrp->fr_height - (p_ls > 0); + win_new_height(wp, curfrp->fr_height - (p_ls > 0)); wp->w_status_height = (p_ls > 0); } else { /* height and row of new window is same as current window */ wp->w_winrow = oldwin->w_winrow; - wp->w_height = oldwin->w_height; + win_new_height(wp, oldwin->w_height); wp->w_status_height = oldwin->w_status_height; } frp->fr_height = curfrp->fr_height; /* "new_size" of the current window goes to the new window, use * one column for the vertical separator */ - wp->w_width = new_size; + win_new_width(wp, new_size); if (before) wp->w_vsep_width = 1; else @@ -1049,13 +1049,13 @@ win_split_ins(size, flags, newwin, dir) if (flags & (WSP_TOP | WSP_BOT)) { wp->w_wincol = 0; - wp->w_width = Columns; + win_new_width(wp, Columns); wp->w_vsep_width = 0; } else { wp->w_wincol = oldwin->w_wincol; - wp->w_width = oldwin->w_width; + win_new_width(wp, oldwin->w_width); wp->w_vsep_width = oldwin->w_vsep_width; } frp->fr_width = curfrp->fr_width; @@ -5572,7 +5572,6 @@ win_new_width(wp, width) invalidate_botline_win(wp); if (wp == curwin) { - update_topline(); curs_columns(TRUE); /* validate w_wrow */ } redraw_win_later(wp, NOT_VALID);