aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mcoudron@hotmail.com>2020-12-23 16:53:35 +0100
committerMatthieu Coudron <mcoudron@hotmail.com>2020-12-23 16:53:35 +0100
commit45166313ccf15dac5dd45926e77c58240de79413 (patch)
treeccb4aadd0b320f1fc17e72d8be51933bba72dc81 /src/nvim/normal.c
parent4d9520ec86aaea607f0dc7f1630a82a1cdf9515a (diff)
downloadrneovim-45166313ccf15dac5dd45926e77c58240de79413.tar.gz
rneovim-45166313ccf15dac5dd45926e77c58240de79413.tar.bz2
rneovim-45166313ccf15dac5dd45926e77c58240de79413.zip
refactor: de-curwin-ify update_topline/curs_columns
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 95553ccc52..ef422f447e 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1261,7 +1261,7 @@ static void normal_redraw(NormalState *s)
{
// Before redrawing, make sure w_topline is correct, and w_leftcol
// if lines don't wrap, and w_skipcol if lines wrap.
- update_topline();
+ update_topline(curwin);
validate_cursor();
// If the cursor moves horizontally when 'concealcursor' is active, then the
@@ -1341,7 +1341,7 @@ static int normal_check(VimState *state)
} else if (do_redraw || stuff_empty()) {
// Need to make sure w_topline and w_leftcol are correct before
// normal_check_window_scrolled() is called.
- update_topline();
+ update_topline(curwin);
normal_check_cursor_moved(s);
normal_check_text_changed(s);
@@ -4254,7 +4254,7 @@ dozet:
case '+':
if (cap->count0 == 0) {
/* No count given: put cursor at the line below screen */
- validate_botline(); /* make sure w_botline is valid */
+ validate_botline(curwin); /* make sure w_botline is valid */
if (curwin->w_botline > curbuf->b_ml.ml_line_count)
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
else
@@ -5053,7 +5053,7 @@ static void nv_scroll(cmdarg_T *cap)
setpcmark();
if (cap->cmdchar == 'L') {
- validate_botline(); /* make sure curwin->w_botline is valid */
+ validate_botline(curwin); /* make sure curwin->w_botline is valid */
curwin->w_cursor.lnum = curwin->w_botline - 1;
if (cap->count1 - 1 >= curwin->w_cursor.lnum)
curwin->w_cursor.lnum = 1;
@@ -5074,7 +5074,7 @@ static void nv_scroll(cmdarg_T *cap)
/* Don't count filler lines above the window. */
used -= diff_check_fill(curwin, curwin->w_topline)
- curwin->w_topfill;
- validate_botline(); // make sure w_empty_rows is valid
+ validate_botline(curwin); // make sure w_empty_rows is valid
half = (curwin->w_height_inner - curwin->w_empty_rows + 1) / 2;
for (n = 0; curwin->w_topline + n < curbuf->b_ml.ml_line_count; n++) {
// Count half he number of filler lines to be "below this
@@ -6653,7 +6653,7 @@ static void nv_g_cmd(cmdarg_T *cap)
VIsual = curwin->w_cursor;
curwin->w_cursor = tpos;
check_cursor();
- update_topline();
+ update_topline(curwin);
/*
* When called from normal "g" command: start Select mode when
* 'selectmode' contains "cmd". When called for K_SELECT, always