mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.2903: cursor position wrong on wrapped line with 'signcolumn'
Problem: Cursor position wrong on wrapped line with 'signcolumn'.
Solution: Don't add space for showbreak twice. (Christian Brabandt,
closes vim/vim#8262)
a06e345af5
Add a modeline to test_display.vim.
This introduced a regression fixed by v8.2.3391.
This commit is contained in:
parent
fd1dbb103b
commit
b91609a70d
@ -3554,6 +3554,13 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
|
|||||||
char_u *p = ptr - (mb_off + 1);
|
char_u *p = ptr - (mb_off + 1);
|
||||||
// TODO: is passing p for start of the line OK?
|
// TODO: is passing p for start of the line OK?
|
||||||
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol, NULL) - 1;
|
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol, NULL) - 1;
|
||||||
|
|
||||||
|
// We have just drawn the showbreak value, no need to add
|
||||||
|
// space for it again
|
||||||
|
if (vcol == vcol_sbr) {
|
||||||
|
n_extra -= MB_CHARLEN(get_showbreak_value(wp));
|
||||||
|
}
|
||||||
|
|
||||||
if (c == TAB && n_extra + col > grid->Columns) {
|
if (c == TAB && n_extra + col > grid->Columns) {
|
||||||
n_extra = tabstop_padding(vcol, wp->w_buffer->b_p_ts,
|
n_extra = tabstop_padding(vcol, wp->w_buffer->b_p_ts,
|
||||||
wp->w_buffer->b_p_vts_array) - 1;
|
wp->w_buffer->b_p_vts_array) - 1;
|
||||||
|
@ -262,3 +262,21 @@ func Test_display_scroll_at_topline()
|
|||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_display_linebreak_breakat()
|
||||||
|
new
|
||||||
|
vert resize 25
|
||||||
|
let _breakat = &breakat
|
||||||
|
setl signcolumn=yes linebreak breakat=) showbreak=+\
|
||||||
|
call setline(1, repeat('x', winwidth(0) - 2) .. ')abc')
|
||||||
|
let lines = ScreenLines([1, 2], 25)
|
||||||
|
let expected = [
|
||||||
|
\ ' xxxxxxxxxxxxxxxxxxxxxxx',
|
||||||
|
\ ' + )abc '
|
||||||
|
\ ]
|
||||||
|
call assert_equal(expected, lines)
|
||||||
|
%bw!
|
||||||
|
let &breakat=_breakat
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user