comparison src/move.c @ 31329:5c83140aafc9 v9.0.0998

patch 9.0.0998: "gk" may reset skipcol when not needed Commit: https://github.com/vim/vim/commit/1b73edd9ee40aec400f3611f59823cec5fd1c489 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 3 11:51:54 2022 +0000 patch 9.0.0998: "gk" may reset skipcol when not needed Problem: "gk" may reset skipcol when not needed. Solution: Only reset skipcol if the cursor column is less.
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Dec 2022 13:00:04 +0100
parents 243c35fad9cb
children bfbcc148da58
comparison
equal deleted inserted replaced
31328:aeffee6a601a 31329:5c83140aafc9
2341 scroll_cursor_halfway(FALSE); 2341 scroll_cursor_halfway(FALSE);
2342 else 2342 else
2343 { 2343 {
2344 /* 2344 /*
2345 * If "always" is FALSE, only adjust topline to a lower value, higher 2345 * If "always" is FALSE, only adjust topline to a lower value, higher
2346 * value may happen with wrapping lines 2346 * value may happen with wrapping lines.
2347 */ 2347 */
2348 if (new_topline < curwin->w_topline || always) 2348 if (new_topline < curwin->w_topline || always)
2349 curwin->w_topline = new_topline; 2349 curwin->w_topline = new_topline;
2350 if (curwin->w_topline > curwin->w_cursor.lnum) 2350 if (curwin->w_topline > curwin->w_cursor.lnum)
2351 curwin->w_topline = curwin->w_cursor.lnum; 2351 curwin->w_topline = curwin->w_cursor.lnum;
2358 curwin->w_topfill = 0; 2358 curwin->w_topfill = 0;
2359 } 2359 }
2360 check_topfill(curwin, FALSE); 2360 check_topfill(curwin, FALSE);
2361 #endif 2361 #endif
2362 // TODO: if the line doesn't fit may optimize w_skipcol 2362 // TODO: if the line doesn't fit may optimize w_skipcol
2363 if (curwin->w_topline == curwin->w_cursor.lnum) 2363 if (curwin->w_topline == curwin->w_cursor.lnum
2364 && curwin->w_skipcol >= curwin->w_cursor.col)
2364 reset_skipcol(); 2365 reset_skipcol();
2365 if (curwin->w_topline != old_topline 2366 if (curwin->w_topline != old_topline
2366 || curwin->w_skipcol != old_skipcol 2367 || curwin->w_skipcol != old_skipcol
2367 #ifdef FEAT_DIFF 2368 #ifdef FEAT_DIFF
2368 || curwin->w_topfill != old_topfill 2369 || curwin->w_topfill != old_topfill