Mercurial > vim
comparison src/move.c @ 32473:c89816c3e2d7 v9.0.1568
patch 9.0.1568: with 'smoothscroll' cursor may move below botline
Commit: https://github.com/vim/vim/commit/d49f646bf56b29d44bbb16e79bc877b59aab38ac
Author: Luuk van Baal <luukvbaal@gmail.com>
Date: Fri May 19 14:04:47 2023 +0100
patch 9.0.1568: with 'smoothscroll' cursor may move below botline
Problem: With 'smoothscroll' cursor may move below botline.
Solution: Call redraw_later() if needed, Compute cursor row with adjusted
condition. (Luuk van Baal, closes #12415)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 19 May 2023 15:15:05 +0200 |
parents | 83074077c0b1 |
children | c8b28054caec |
comparison
equal
deleted
inserted
replaced
32472:bc0e1a97d4e0 | 32473:c89816c3e2d7 |
---|---|
517 redraw_later(UPD_VALID); | 517 redraw_later(UPD_VALID); |
518 | 518 |
519 // When 'smoothscroll' is not set, should reset w_skipcol. | 519 // When 'smoothscroll' is not set, should reset w_skipcol. |
520 if (!curwin->w_p_sms) | 520 if (!curwin->w_p_sms) |
521 reset_skipcol(); | 521 reset_skipcol(); |
522 else if (curwin->w_skipcol != 0) | |
523 redraw_later(UPD_SOME_VALID); | |
522 | 524 |
523 // May need to set w_skipcol when cursor in w_topline. | 525 // May need to set w_skipcol when cursor in w_topline. |
524 if (curwin->w_cursor.lnum == curwin->w_topline) | 526 if (curwin->w_cursor.lnum == curwin->w_topline) |
525 validate_cursor(); | 527 validate_cursor(); |
526 } | 528 } |
890 } | 892 } |
891 else if (wp->w_lines[i].wl_lnum > lnum) | 893 else if (wp->w_lines[i].wl_lnum > lnum) |
892 --i; // hold at inserted lines | 894 --i; // hold at inserted lines |
893 } | 895 } |
894 if (valid | 896 if (valid |
895 #ifdef FEAT_DIFF | 897 && (lnum != wp->w_topline || (wp->w_skipcol == 0 |
896 && (lnum != wp->w_topline || !wp->w_p_diff) | 898 #ifdef FEAT_DIFF |
897 #endif | 899 && !wp->w_p_diff |
898 ) | 900 #endif |
901 ))) | |
899 { | 902 { |
900 #ifdef FEAT_FOLDING | 903 #ifdef FEAT_FOLDING |
901 lnum = wp->w_lines[i].wl_lastlnum + 1; | 904 lnum = wp->w_lines[i].wl_lastlnum + 1; |
902 // Cursor inside folded lines, don't count this row | 905 // Cursor inside folded lines, don't count this row |
903 if (lnum > wp->w_cursor.lnum) | 906 if (lnum > wp->w_cursor.lnum) |