forked from aniani/vim
patch 9.0.0297: cursor position wrong after right aligned virtual text
Problem: Cursor position wrong after right aligned virtual text. (Iizuka
Masashi)
Solution: Take the width of the column offset into account. (closes #10997)
Also fix virtual text positioning.
This commit is contained in:
@@ -2574,11 +2574,11 @@ func Test_props_with_text_right_align_twice()
|
||||
|
||||
let lines =<< trim END
|
||||
call setline(1, ["some text some text some text some text", 'line two'])
|
||||
call prop_type_add( 'MyErrorText', #{ highlight: 'ErrorMsg' } )
|
||||
call prop_type_add( 'MyPadding', #{ highlight: 'DiffChange' } )
|
||||
call prop_add( 1, 0, #{ type: 'MyPadding', text: ' nothing here', text_wrap: 'wrap'} )
|
||||
call prop_add( 1, 0, #{ type: 'MyErrorText', text: 'Some error', text_wrap: 'wrap', text_align: 'right' } )
|
||||
call prop_add( 1, 0, #{ type: 'MyErrorText', text: 'Another error', text_wrap: 'wrap', text_align: 'right' } )
|
||||
call prop_type_add('MyErrorText', #{ highlight: 'ErrorMsg'})
|
||||
call prop_type_add('MyPadding', #{ highlight: 'DiffChange'})
|
||||
call prop_add(1, 0, #{type: 'MyPadding', text: ' nothing here', text_wrap: 'wrap'})
|
||||
call prop_add(1, 0, #{type: 'MyErrorText', text: 'Some error', text_wrap: 'wrap', text_align: 'right'})
|
||||
call prop_add(1, 0, #{type: 'MyErrorText', text: 'Another error', text_wrap: 'wrap', text_align: 'right'})
|
||||
normal G$
|
||||
END
|
||||
call writefile(lines, 'XscriptPropsRightAlign')
|
||||
@@ -2588,6 +2588,9 @@ func Test_props_with_text_right_align_twice()
|
||||
call term_sendkeys(buf, "ggisome more text\<Esc>G$")
|
||||
call VerifyScreenDump(buf, 'Test_prop_right_align_twice_2', {})
|
||||
|
||||
call term_sendkeys(buf, ":set signcolumn=yes\<CR>")
|
||||
call VerifyScreenDump(buf, 'Test_prop_right_align_twice_3', {})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('XscriptPropsRightAlign')
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user