Mercurial > vim
comparison src/testdir/test_textprop.vim @ 29826:bfd08e50e2c0 v9.0.0252
patch 9.0.0252: cursor in wrong place after virtual text
Commit: https://github.com/vim/vim/commit/f5240b96f721b08d703340ff0b2e67b79fb8b821
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 24 12:24:37 2022 +0100
patch 9.0.0252: cursor in wrong place after virtual text
Problem: Cursor in wrong place after virtual text.
Solution: Do not change the length of a virtual text property.
(closes #10964)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 24 Aug 2022 13:30:03 +0200 |
parents | bbe62ea78aac |
children | e6e0f1c39edb |
comparison
equal
deleted
inserted
replaced
29825:e0a5c4895556 | 29826:bfd08e50e2c0 |
---|---|
3089 | 3089 |
3090 call StopVimInTerminal(buf) | 3090 call StopVimInTerminal(buf) |
3091 call delete('XscriptPropsPadded') | 3091 call delete('XscriptPropsPadded') |
3092 endfunc | 3092 endfunc |
3093 | 3093 |
3094 func Test_insert_text_change_arg() | |
3095 CheckRunVimInTerminal | |
3096 | |
3097 let lines =<< trim END | |
3098 vim9script | |
3099 setline(1, ['SetErrorCode( 10, 20 )', 'second line']) | |
3100 prop_type_add('param', {highlight: 'DiffChange', start_incl: 1}) | |
3101 prop_type_add('padd', {highlight: 'NonText', start_incl: 1}) | |
3102 prop_add(1, 15, { | |
3103 type: 'param', | |
3104 text: 'id:', | |
3105 }) | |
3106 prop_add(1, 15, { | |
3107 type: 'padd', | |
3108 text: '-', | |
3109 }) | |
3110 prop_add(1, 19, { | |
3111 type: 'param', | |
3112 text: 'id:', | |
3113 }) | |
3114 prop_add(1, 19, { | |
3115 type: 'padd', | |
3116 text: '-', | |
3117 }) | |
3118 END | |
3119 call writefile(lines, 'XscriptPropsChange') | |
3120 let buf = RunVimInTerminal('-S XscriptPropsChange', #{rows: 5, cols: 60}) | |
3121 call VerifyScreenDump(buf, 'Test_prop_text_change_arg_1', {}) | |
3122 | |
3123 call term_sendkeys(buf, "ggf1cw1234\<Esc>") | |
3124 call VerifyScreenDump(buf, 'Test_prop_text_change_arg_2', {}) | |
3125 | |
3126 call StopVimInTerminal(buf) | |
3127 call delete('XscriptPropsChange') | |
3128 endfunc | |
3129 | |
3094 " vim: shiftwidth=2 sts=2 expandtab | 3130 " vim: shiftwidth=2 sts=2 expandtab |