robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqMerge pull request #23367 from zeertzjq/vim-8.2.1108727ec8d59d

master
2.4 KiB97 linesraw
1" Helper functions for generating mouse events
2
3let g:Ttymouse_values = ['sgr']
4let g:Ttymouse_dec = []
5let g:Ttymouse_netterm = []
6
7func MouseLeftClick(row, col)
8  call nvim_input_mouse('left', 'press', '', 0, a:row - 1, a:col - 1)
9  call getchar(1)
10  call feedkeys('', 'x!')
11endfunc
12
13func MouseMiddleClick(row, col)
14  call nvim_input_mouse('middle', 'press', '', 0, a:row - 1, a:col - 1)
15  call getchar(1)
16  call feedkeys('', 'x!')
17endfunc
18
19func MouseRightClick(row, col)
20  call nvim_input_mouse('right', 'press', '', 0, a:row - 1, a:col - 1)
21  call getchar(1)
22  call feedkeys('', 'x!')
23endfunc
24
25func MouseCtrlLeftClick(row, col)
26  call nvim_input_mouse('left', 'press', 'C', 0, a:row - 1, a:col - 1)
27  call getchar(1)
28  call feedkeys('', 'x!')
29endfunc
30
31func MouseCtrlRightClick(row, col)
32  call nvim_input_mouse('right', 'press', 'C', 0, a:row - 1, a:col - 1)
33  call getchar(1)
34  call feedkeys('', 'x!')
35endfunc
36
37func MouseAltLeftClick(row, col)
38  call nvim_input_mouse('left', 'press', 'A', 0, a:row - 1, a:col - 1)
39  call getchar(1)
40  call feedkeys('', 'x!')
41endfunc
42
43func MouseAltRightClick(row, col)
44  call nvim_input_mouse('right', 'press', 'A', 0, a:row - 1, a:col - 1)
45  call getchar(1)
46  call feedkeys('', 'x!')
47endfunc
48
49func MouseLeftRelease(row, col)
50  call nvim_input_mouse('left', 'release', '', 0, a:row - 1, a:col - 1)
51  call getchar(1)
52  call feedkeys('', 'x!')
53endfunc
54
55func MouseMiddleRelease(row, col)
56  call nvim_input_mouse('middle', 'release', '', 0, a:row - 1, a:col - 1)
57  call getchar(1)
58  call feedkeys('', 'x!')
59endfunc
60
61func MouseRightRelease(row, col)
62  call nvim_input_mouse('right', 'release', '', 0, a:row - 1, a:col - 1)
63  call getchar(1)
64  call feedkeys('', 'x!')
65endfunc
66
67func MouseLeftDrag(row, col)
68  call nvim_input_mouse('left', 'drag', '', 0, a:row - 1, a:col - 1)
69  call getchar(1)
70  call feedkeys('', 'x!')
71endfunc
72
73func MouseWheelUp(row, col)
74  call nvim_input_mouse('wheel', 'up', '', 0, a:row - 1, a:col - 1)
75  call getchar(1)
76  call feedkeys('', 'x!')
77endfunc
78
79func MouseWheelDown(row, col)
80  call nvim_input_mouse('wheel', 'down', '', 0, a:row - 1, a:col - 1)
81  call getchar(1)
82  call feedkeys('', 'x!')
83endfunc
84
85func MouseWheelLeft(row, col)
86  call nvim_input_mouse('wheel', 'left', '', 0, a:row - 1, a:col - 1)
87  call getchar(1)
88  call feedkeys('', 'x!')
89endfunc
90
91func MouseWheelRight(row, col)
92  call nvim_input_mouse('wheel', 'right', '', 0, a:row - 1, a:col - 1)
93  call getchar(1)
94  call feedkeys('', 'x!')
95endfunc
96
97" vim: shiftwidth=2 sts=2 expandtab