Mercurial > vim
comparison src/testdir/test_textprop.vim @ 29583:32aee589fc9a v9.0.0132
patch 9.0.0132: multi-byte characters in virtual text not handled correctly
Commit: https://github.com/vim/vim/commit/09ff4b54fb86a64390ba9c609853c6410ea6197c
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 1 16:51:02 2022 +0100
patch 9.0.0132: multi-byte characters in virtual text not handled correctly
Problem: Multi-byte characters in virtual text not handled correctly.
Solution: Count screen cells instead of bytes.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 01 Aug 2022 18:00:05 +0200 |
parents | 4a79bca8a76e |
children | e357bc89bb95 |
comparison
equal
deleted
inserted
replaced
29582:902abc03f8ee | 29583:32aee589fc9a |
---|---|
2197 call prop_type_add('otherprop', #{highlight: 'Search'}) | 2197 call prop_type_add('otherprop', #{highlight: 'Search'}) |
2198 call prop_type_add('moreprop', #{highlight: 'DiffAdd'}) | 2198 call prop_type_add('moreprop', #{highlight: 'DiffAdd'}) |
2199 call prop_add(1, 18, #{type: 'someprop', text: 'SOME '}) | 2199 call prop_add(1, 18, #{type: 'someprop', text: 'SOME '}) |
2200 call prop_add(1, 38, #{type: 'otherprop', text: "OTHER\t"}) | 2200 call prop_add(1, 38, #{type: 'otherprop', text: "OTHER\t"}) |
2201 call prop_add(1, 69, #{type: 'moreprop', text: 'MORE '}) | 2201 call prop_add(1, 69, #{type: 'moreprop', text: 'MORE '}) |
2202 redraw | |
2203 normal $ | 2202 normal $ |
2203 | |
2204 call setline(2, 'prepost') | |
2205 call prop_type_add('multibyte', #{highlight: 'Visual'}) | |
2206 call prop_add(2, 4, #{type: 'multibyte', text: 'söme和平téxt'}) | |
2204 END | 2207 END |
2205 call writefile(lines, 'XscriptPropsWithText') | 2208 call writefile(lines, 'XscriptPropsWithText') |
2206 let buf = RunVimInTerminal('-S XscriptPropsWithText', #{rows: 6, cols: 60}) | 2209 let buf = RunVimInTerminal('-S XscriptPropsWithText', #{rows: 6, cols: 60}) |
2207 call VerifyScreenDump(buf, 'Test_prop_inserts_text_1', {}) | 2210 call VerifyScreenDump(buf, 'Test_prop_inserts_text_1', {}) |
2208 | 2211 |
2226 call prop_add(1, 0, #{type: 'belowprop', text: ' BELOW ', text_align: 'below'}) | 2229 call prop_add(1, 0, #{type: 'belowprop', text: ' BELOW ', text_align: 'below'}) |
2227 | 2230 |
2228 call setline(2, 'Last line.') | 2231 call setline(2, 'Last line.') |
2229 call prop_add(2, 0, #{type: 'afterprop', text: ' After Last ', text_align: 'after'}) | 2232 call prop_add(2, 0, #{type: 'afterprop', text: ' After Last ', text_align: 'after'}) |
2230 normal G$ | 2233 normal G$ |
2234 | |
2235 call setline(3, 'right here') | |
2236 call prop_add(3, 0, #{type: 'rightprop', text: 'söme和平téxt', text_align: 'right'}) | |
2231 END | 2237 END |
2232 call writefile(lines, 'XscriptPropsWithTextAfter') | 2238 call writefile(lines, 'XscriptPropsWithTextAfter') |
2233 let buf = RunVimInTerminal('-S XscriptPropsWithTextAfter', #{rows: 6, cols: 60}) | 2239 let buf = RunVimInTerminal('-S XscriptPropsWithTextAfter', #{rows: 6, cols: 60}) |
2234 call VerifyScreenDump(buf, 'Test_prop_with_text_after_1', {}) | 2240 call VerifyScreenDump(buf, 'Test_prop_with_text_after_1', {}) |
2235 | 2241 |