annotate src/testdir/test_popupwin_textprop.vim @ 17865:eaf8b21d80e7 v8.1.1929

patch 8.1.1929: no tests for text property popup window Commit: https://github.com/vim/vim/commit/8e95636a282f3eac808c0e00c053b33334cc283e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 25 23:08:17 2019 +0200 patch 8.1.1929: no tests for text property popup window Problem: No tests for text property popup window. Solution: Add a few tests.
author Bram Moolenaar <Bram@vim.org>
date Sun, 25 Aug 2019 23:15:03 +0200
parents
children f13a5c48320b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17865
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Tests for popup windows for text properties
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 source check.vim
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 CheckFeature textprop
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 source screendump.vim
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 CheckScreendump
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 func Test_textprop_popup()
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 let lines =<< trim END
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 call setline(1, range(1, 100))
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 call setline(50, 'some text to work with')
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 50
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 normal zz
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 set scrolloff=0
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 call prop_type_add('popupMarker', #{highlight: 'DiffAdd'})
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 call prop_add(50, 11, #{
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 \ length: 7,
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 \ type: 'popupMarker',
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 \ })
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 let winid = popup_create('the text', #{
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 \ pos: 'botleft',
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 \ textprop: 'popupMarker',
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 \ border: [],
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 \ padding: [0,1,0,1],
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 \ close: 'click',
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 \ })
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 END
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 call writefile(lines, 'XtestTextpropPopup')
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10})
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 call VerifyScreenDump(buf, 'Test_popup_textprop_01', {})
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 call term_sendkeys(buf, "zt")
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 call VerifyScreenDump(buf, 'Test_popup_textprop_02', {})
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 call term_sendkeys(buf, "zzIawe\<Esc>")
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 call VerifyScreenDump(buf, 'Test_popup_textprop_03', {})
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 call term_sendkeys(buf, "0dw")
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 call VerifyScreenDump(buf, 'Test_popup_textprop_04', {})
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 call term_sendkeys(buf, "Oinserted\<Esc>")
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 call VerifyScreenDump(buf, 'Test_popup_textprop_05', {})
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 call term_sendkeys(buf, "k2dd")
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 call VerifyScreenDump(buf, 'Test_popup_textprop_06', {})
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 " clean up
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 call StopVimInTerminal(buf)
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 call delete('XtestTextpropPopup')
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 endfunc
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53
eaf8b21d80e7 patch 8.1.1929: no tests for text property popup window
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 " vim: shiftwidth=2 sts=2