diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-05-02 07:49:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-02 07:49:07 -0700 |
commit | e5c69df679159cd56fe34d6fc66a898bed9a87d0 (patch) | |
tree | c2b20f0b3581f8e861134c177489ff294be911ea /src/nvim/drawscreen.c | |
parent | 350d81856473b45100d6b0e5920b757df1b4ad27 (diff) | |
parent | 037ea6e786b5d05f4a8965e4c2ba6aa60ec7c01a (diff) | |
download | rneovim-e5c69df679159cd56fe34d6fc66a898bed9a87d0.tar.gz rneovim-e5c69df679159cd56fe34d6fc66a898bed9a87d0.tar.bz2 rneovim-e5c69df679159cd56fe34d6fc66a898bed9a87d0.zip |
Merge #28101 nvim__redraw
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 |