forked from aniani/vim
patch 9.1.0320: Wrong cursor position after using setcellwidths()
Problem: Wrong cursor position after using setcellwidths(). Solution: Invalidate cursor position in addition to redrawing. (zeertzjq) closes: #14545 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
3d93630605
commit
05aacec6ab
@@ -5733,6 +5733,7 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
vim_free(cw_table_save);
|
vim_free(cw_table_save);
|
||||||
|
changed_window_setting_all();
|
||||||
redraw_all_later(UPD_CLEAR);
|
redraw_all_later(UPD_CLEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
src/move.c
13
src/move.c
@@ -677,6 +677,19 @@ changed_window_setting_buf(buf_T *buf)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Call changed_window_setting_win() for every window.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
changed_window_setting_all(void)
|
||||||
|
{
|
||||||
|
tabpage_T *tp;
|
||||||
|
win_T *wp;
|
||||||
|
|
||||||
|
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||||
|
changed_window_setting_win(wp);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set wp->w_topline to a certain number.
|
* Set wp->w_topline to a certain number.
|
||||||
*/
|
*/
|
||||||
|
@@ -9,6 +9,7 @@ void check_cursor_moved(win_T *wp);
|
|||||||
void changed_window_setting(void);
|
void changed_window_setting(void);
|
||||||
void changed_window_setting_win(win_T *wp);
|
void changed_window_setting_win(win_T *wp);
|
||||||
void changed_window_setting_buf(buf_T *buf);
|
void changed_window_setting_buf(buf_T *buf);
|
||||||
|
void changed_window_setting_all(void);
|
||||||
void set_topline(win_T *wp, linenr_T lnum);
|
void set_topline(win_T *wp, linenr_T lnum);
|
||||||
void changed_cline_bef_curs(void);
|
void changed_cline_bef_curs(void);
|
||||||
void changed_cline_bef_curs_win(win_T *wp);
|
void changed_cline_bef_curs_win(win_T *wp);
|
||||||
|
@@ -170,6 +170,7 @@ func Test_screenchar_utf8()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_setcellwidths()
|
func Test_setcellwidths()
|
||||||
|
new
|
||||||
call setcellwidths([
|
call setcellwidths([
|
||||||
\ [0x1330, 0x1330, 2],
|
\ [0x1330, 0x1330, 2],
|
||||||
\ [9999, 10000, 1],
|
\ [9999, 10000, 1],
|
||||||
@@ -212,6 +213,18 @@ func Test_setcellwidths()
|
|||||||
" Ambiguous width chars
|
" Ambiguous width chars
|
||||||
call assert_equal(2, strwidth("\u00A1"))
|
call assert_equal(2, strwidth("\u00A1"))
|
||||||
call assert_equal(2, strwidth("\u2010"))
|
call assert_equal(2, strwidth("\u2010"))
|
||||||
|
|
||||||
|
call setcellwidths([])
|
||||||
|
call setline(1, repeat("\u2103", 10))
|
||||||
|
normal! $
|
||||||
|
redraw
|
||||||
|
call assert_equal((aw == 'single') ? 10 : 19, wincol())
|
||||||
|
call setcellwidths([[0x2103, 0x2103, 1]])
|
||||||
|
redraw
|
||||||
|
call assert_equal(10, wincol())
|
||||||
|
call setcellwidths([[0x2103, 0x2103, 2]])
|
||||||
|
redraw
|
||||||
|
call assert_equal(19, wincol())
|
||||||
endfor
|
endfor
|
||||||
set ambiwidth& isprint&
|
set ambiwidth& isprint&
|
||||||
|
|
||||||
@@ -245,6 +258,7 @@ func Test_setcellwidths()
|
|||||||
set listchars&
|
set listchars&
|
||||||
set fillchars&
|
set fillchars&
|
||||||
call setcellwidths([])
|
call setcellwidths([])
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_getcellwidths()
|
func Test_getcellwidths()
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
320,
|
||||||
/**/
|
/**/
|
||||||
319,
|
319,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user