comparison src/testdir/test_popupwin.vim @ 18751:aa385f88f900 v8.1.2365

patch 8.1.2365: missing tests for recent popupwin changes Commit: https://github.com/vim/vim/commit/20ebbeac461ffc2a5e5dbfbb0ba380b8854615bd Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 30 17:58:27 2019 +0100 patch 8.1.2365: missing tests for recent popupwin changes Problem: Missing tests for recent popupwin changes. Solution: Add test cases.
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Nov 2019 18:00:05 +0100
parents 7369756d05de
children 49b78d6465e5
comparison
equal deleted inserted replaced
18750:82a28df1e2d5 18751:aa385f88f900
3051 3051
3052 call popup_clear() 3052 call popup_clear()
3053 delfunc CloseFilter 3053 delfunc CloseFilter
3054 endfunc 3054 endfunc
3055 3055
3056 func Test_popupwin_double_width()
3057 CheckScreendump
3058
3059 let lines =<< trim END
3060 call setline(1, 'x你好世界你好世你好世界你好')
3061 call setline(2, '你好世界你好世你好世界你好')
3062 call setline(3, 'x你好世界你好世你好世界你好')
3063 call popup_create('你好,世界 - 你好,世界xxxxx', #{line: 1, col: 3, maxwidth: 14})
3064 END
3065 call writefile(lines, 'XtestPopupWide')
3066
3067 let buf = RunVimInTerminal('-S XtestPopupWide', #{rows: 10})
3068 call VerifyScreenDump(buf, 'Test_popupwin_doublewidth_1', {})
3069
3070 call StopVimInTerminal(buf)
3071 call delete('XtestPopupWide')
3072 endfunc
3073
3074 func Test_popupwin_sign()
3075 CheckScreendump
3076
3077 let lines =<< trim END
3078 call setline(1, range(10))
3079 call sign_define('Current', {
3080 \ 'text': '>>',
3081 \ 'texthl': 'WarningMsg',
3082 \ 'linehl': 'Error',
3083 \ })
3084 call sign_define('Other', {
3085 \ 'text': '#!',
3086 \ 'texthl': 'Error',
3087 \ 'linehl': 'Search',
3088 \ })
3089 let winid = popup_create(['hello', 'bright', 'world'], {
3090 \ 'minwidth': 20,
3091 \ })
3092 call setwinvar(winid, "&signcolumn", "yes")
3093 let winbufnr = winbufnr(winid)
3094
3095 " add sign to current buffer, shows
3096 call sign_place(1, 'Selected', 'Current', bufnr('%'), {'lnum': 1})
3097 " add sign to current buffer, does not show
3098 call sign_place(2, 'PopUpSelected', 'Other', bufnr('%'), {'lnum': 2})
3099
3100 " add sign to popup buffer, shows
3101 call sign_place(3, 'PopUpSelected', 'Other', winbufnr, {'lnum': 1})
3102 " add sign to popup buffer, does not show
3103 call sign_place(4, 'Selected', 'Current', winbufnr, {'lnum': 2})
3104 END
3105 call writefile(lines, 'XtestPopupSign')
3106
3107 let buf = RunVimInTerminal('-S XtestPopupSign', #{rows: 10})
3108 call VerifyScreenDump(buf, 'Test_popupwin_sign_1', {})
3109
3110 call StopVimInTerminal(buf)
3111 call delete('XtestPopupSign')
3112 endfunc
3113
3056 " vim: shiftwidth=2 sts=2 3114 " vim: shiftwidth=2 sts=2