aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRom Grk <romgrk.cc@gmail.com>2020-10-24 20:16:58 -0400
committerRom Grk <romgrk.cc@gmail.com>2020-10-24 20:16:58 -0400
commita1596f0b0bb7e2a84e062a27fabe618d085a2947 (patch)
tree7f4b53e964c613a410e01a9b71396334ccde3b79
parentbcf79c62bca76b8b2fb5f51e3f83d4c645d91684 (diff)
downloadrneovim-a1596f0b0bb7e2a84e062a27fabe618d085a2947.tar.gz
rneovim-a1596f0b0bb7e2a84e062a27fabe618d085a2947.tar.bz2
rneovim-a1596f0b0bb7e2a84e062a27fabe618d085a2947.zip
scroll: use win->w_viewport_invalid
-rw-r--r--src/nvim/buffer_defs.h3
-rw-r--r--src/nvim/edit.c7
-rw-r--r--src/nvim/normal.c8
3 files changed, 2 insertions, 16 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 546054bb19..1223f2bdab 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -1204,9 +1204,6 @@ struct window_S {
colnr_T w_skipcol; // starting column when a single line
// doesn't fit in the window
- linenr_T w_last_topline; ///< last known value for topline
- colnr_T w_last_leftcol; ///< last known value for leftcol
-
//
// Layout of the window in the screen.
// May need to add "msg_scrolled" to "w_winrow" in rare situations.
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 949f5d5a62..56202177c0 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1483,13 +1483,8 @@ static void ins_redraw(
}
if (ready && has_event(EVENT_SCROLL)
- && (curwin->w_last_topline != curwin->w_topline ||
- curwin->w_last_leftcol != curwin->w_leftcol)) {
-
+ && curwin->w_viewport_invalid) {
apply_autocmds(EVENT_SCROLL, NULL, NULL, false, curbuf);
-
- curwin->w_last_topline = curwin->w_topline;
- curwin->w_last_leftcol = curwin->w_leftcol;
}
if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin)
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 80ed9bd2b6..2e49108028 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1197,13 +1197,8 @@ static void normal_check_window_scrolled(NormalState *s)
{
// Trigger Scroll if the window moved.
if (!finish_op && has_event(EVENT_SCROLL)
- && (curwin->w_last_topline != curwin->w_topline ||
- curwin->w_last_leftcol != curwin->w_leftcol)) {
-
+ && curwin->w_viewport_invalid) {
apply_autocmds(EVENT_SCROLL, NULL, NULL, false, curbuf);
-
- curwin->w_last_topline = curwin->w_topline;
- curwin->w_last_leftcol = curwin->w_leftcol;
}
}
@@ -1293,7 +1288,6 @@ static void normal_redraw(NormalState *s)
xfree(p);
}
-
// show fileinfo after redraw
if (need_fileinfo && !shortmess(SHM_FILEINFO)) {
fileinfo(false, true, false);