diff options
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r-- | src/nvim/drawscreen.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index 5e834e4b79..bda0ccc870 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -821,25 +821,25 @@ static void win_redr_border(win_T *wp) /// Set cursor to its position in the current window. void setcursor(void) { - setcursor_mayforce(false); + setcursor_mayforce(curwin, false); } /// Set cursor to its position in the current window. /// @param force when true, also when not redrawing. -void setcursor_mayforce(bool force) +void setcursor_mayforce(win_T *wp, bool force) { if (force || redrawing()) { - validate_cursor(curwin); + validate_cursor(wp); - ScreenGrid *grid = &curwin->w_grid; - int row = curwin->w_wrow; - int col = curwin->w_wcol; - if (curwin->w_p_rl) { + ScreenGrid *grid = &wp->w_grid; + int row = wp->w_wrow; + int col = wp->w_wcol; + if (wp->w_p_rl) { // With 'rightleft' set and the cursor on a double-wide character, // position it on the leftmost column. - col = curwin->w_width_inner - curwin->w_wcol - - ((utf_ptr2cells(get_cursor_pos_ptr()) == 2 - && vim_isprintc(gchar_cursor())) ? 2 : 1); + char *cursor = ml_get_buf(wp->w_buffer, wp->w_cursor.lnum) + wp->w_cursor.col; + col = wp->w_width_inner - wp->w_wcol - ((utf_ptr2cells(cursor) == 2 + && vim_isprintc(utf_ptr2char(cursor))) ? 2 : 1); } grid_adjust(&grid, &row, &col); @@ -2713,7 +2713,7 @@ void redraw_buf_line_later(buf_T *buf, linenr_T line, bool force) } } -void redraw_buf_range_later(buf_T *buf, linenr_T firstline, linenr_T lastline) +void redraw_buf_range_later(buf_T *buf, linenr_T firstline, linenr_T lastline) { FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { if (wp->w_buffer == buf |