mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.4501: with 'showbreak' set cursor displayed in wrong position
Problem: With 'showbreak' set and after the end of the line the cursor may be displayed in the wrong position. Solution: Do not apply 'showbreak' after the end of the line. (closes #9884)
This commit is contained in:
@@ -1037,9 +1037,10 @@ win_lbr_chartabsize(
|
|||||||
* May have to add something for 'breakindent' and/or 'showbreak'
|
* May have to add something for 'breakindent' and/or 'showbreak'
|
||||||
* string at start of line.
|
* string at start of line.
|
||||||
* Set *headp to the size of what we add.
|
* Set *headp to the size of what we add.
|
||||||
|
* Do not use 'showbreak' at the NUL after the text.
|
||||||
*/
|
*/
|
||||||
added = 0;
|
added = 0;
|
||||||
sbr = get_showbreak_value(wp);
|
sbr = c == NUL ? empty_option : get_showbreak_value(wp);
|
||||||
if ((*sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0)
|
if ((*sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0)
|
||||||
{
|
{
|
||||||
colnr_T sbrlen = 0;
|
colnr_T sbrlen = 0;
|
||||||
|
@@ -0,0 +1,6 @@
|
|||||||
|
| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@71|X
|
||||||
|
> +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|e|c|o|n|d| |l|i|n|e| @61
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|7|4| @9|A|l@1|
|
@@ -8,6 +8,7 @@ source check.vim
|
|||||||
CheckOption breakindent
|
CheckOption breakindent
|
||||||
|
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
|
source screendump.vim
|
||||||
|
|
||||||
let s:input ="\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP"
|
let s:input ="\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP"
|
||||||
|
|
||||||
@@ -849,6 +850,27 @@ func Test_window_resize_with_linebreak()
|
|||||||
%bw!
|
%bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_cursor_position_with_showbreak()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
&signcolumn = 'yes'
|
||||||
|
&showbreak = '+ '
|
||||||
|
var leftcol: number = win_getid()->getwininfo()->get(0, {})->get('textoff')
|
||||||
|
repeat('x', &columns - leftcol - 1)->setline(1)
|
||||||
|
'second line'->setline(2)
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XscriptShowbreak')
|
||||||
|
let buf = RunVimInTerminal('-S XscriptShowbreak', #{rows: 6})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, "AX")
|
||||||
|
call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('XscriptShowbreak')
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_no_spurious_match()
|
func Test_no_spurious_match()
|
||||||
let s:input = printf('- y %s y %s', repeat('x', 50), repeat('x', 50))
|
let s:input = printf('- y %s y %s', repeat('x', 50), repeat('x', 50))
|
||||||
call s:test_windows('setl breakindent breakindentopt=list:-1 formatlistpat=^- hls')
|
call s:test_windows('setl breakindent breakindentopt=list:-1 formatlistpat=^- hls')
|
||||||
|
@@ -754,6 +754,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 */
|
||||||
|
/**/
|
||||||
|
4501,
|
||||||
/**/
|
/**/
|
||||||
4500,
|
4500,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user