Mercurial > vim
view src/testdir/test_startup_utf8.vim @ 33575:8fc442c731ca v9.0.2032
patch 9.0.2032: cannot get mouse click pos for tab or virt text
Commit: https://github.com/vim/vim/commit/f5a94d5165bb9e390797da50a1fa7a87df3fbee4
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun Oct 15 10:03:30 2023 +0200
patch 9.0.2032: cannot get mouse click pos for tab or virt text
Problem: Cannot accurately get mouse clicking position when clicking on
a TAB or with virtual text.
Solution: Add a "coladd" field to getmousepos() result.
closes: #13335
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 15 Oct 2023 10:15:05 +0200 |
parents | ae10b91ac6b3 |
children |
line wrap: on
line source
" Tests for startup using utf-8. source check.vim source shared.vim source screendump.vim func Test_read_stdin_utf8() let linesin = ['テスト', '€ÀÈÌÒÙ'] call writefile(linesin, 'Xtestin', 'D') let before = [ \ 'set enc=utf-8', \ 'set fencs=cp932,utf-8', \ ] let after = [ \ 'write ++enc=utf-8 Xtestout', \ 'quit!', \ ] if has('win32') let pipecmd = 'type Xtestin | ' else let pipecmd = 'cat Xtestin | ' endif if RunVimPiped(before, after, '-', pipecmd) let lines = readfile('Xtestout') call assert_equal(linesin, lines) else call assert_equal('', 'RunVimPiped failed.') endif call delete('Xtestout') endfunc func Test_read_fifo_utf8() CheckUnix " Using bash/zsh's process substitution. if executable('bash') set shell=bash elseif executable('zsh') set shell=zsh else throw 'Skipped: bash or zsh is required' endif let linesin = ['テスト', '€ÀÈÌÒÙ'] call writefile(linesin, 'Xtestin', 'D') let before = [ \ 'set enc=utf-8', \ 'set fencs=cp932,utf-8', \ ] let after = [ \ 'write ++enc=utf-8 Xtestout', \ 'quit!', \ ] if RunVim(before, after, '<(cat Xtestin)') let lines = readfile('Xtestout') call assert_equal(linesin, lines) else call assert_equal('', 'RunVim failed.') endif call delete('Xtestout') endfunc func Test_detect_ambiwidth() CheckRunVimInTerminal " Use the title termcap entries to output the escape sequence. call writefile([ \ 'set enc=utf-8', \ 'set ambiwidth=double', \ 'call test_option_not_set("ambiwidth")', \ 'redraw', \ ], 'Xscript', 'D') let buf = RunVimInTerminal('-S Xscript', #{keep_t_u7: 1}) call TermWait(buf) call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>") call WaitForAssert({-> assert_match('single', term_getline(buf, 1))}) call StopVimInTerminal(buf) endfunc " vim: shiftwidth=2 sts=2 expandtab