Problem: Cannot detect whether modifyOtherKeys is enabled.
Solution: Use XTQMODKEYS introduced by xterm version 377 to request the
modifyOtherKeys level. Update the keycode check results.
static int
key_protocol_enabled(void)
{
- return seenModifyOtherKeys || kitty_protocol_state == KKPS_ENABLED;
+ // If xterm has responded to XTQMODKEYS it overrules seenModifyOtherKeys.
+ int using_mok = modify_otherkeys_state != MOKS_INITIAL
+ ? modify_otherkeys_state == MOKS_ENABLED
+ : seenModifyOtherKeys;
+ return using_mok || kitty_protocol_state == KKPS_ENABLED;
}
/*
EXTERN int pending_end_reg_executing INIT(= 0);
// Set when a modifyOtherKeys sequence was seen, then simplified mappings will
-// no longer be used.
+// no longer be used. To be combined with modify_otherkeys_state.
EXTERN int seenModifyOtherKeys INIT(= FALSE);
+// The state for the modifyOtherKeys level
+typedef enum {
+ // Initially we have no clue if the protocol is on or off.
+ MOKS_INITIAL,
+ // Used when receiving the state and the level is not two.
+ MOKS_OFF,
+ // Used when receiving the state and the level is two.
+ MOKS_ENABLED,
+ // Used after outputting t_KE when the state was MOKS_ENABLED. We do not
+ // really know if t_KE actually disabled the protocol, the following t_KI
+ // is expected to request the state, but the response may come only later.
+ MOKS_DISABLED,
+ // Used after outputting t_KE when the state was not MOKS_ENABLED.
+ MOKS_AFTER_T_KE,
+} mokstate_T;
+
+// Set when a response to XTQMODKEYS was received. Only works for xterm
+// version 377 and later.
+EXTERN mokstate_T modify_otherkeys_state INIT(= MOKS_INITIAL);
+
// The state for the Kitty keyboard protocol.
typedef enum {
// Initially we have no clue if the protocol is on or off.
if (p_verbose > 0 && keyround == 1)
{
if (seenModifyOtherKeys)
- msg_puts(_("Seen modifyOtherKeys: true"));
+ msg_puts(_("Seen modifyOtherKeys: true\n"));
+
+ if (modify_otherkeys_state != MOKS_INITIAL)
+ {
+ char *name = _("Unknown");
+ switch (modify_otherkeys_state)
+ {
+ case MOKS_INITIAL: break;
+ case MOKS_OFF: name = _("Off"); break;
+ case MOKS_ENABLED: name = _("On"); break;
+ case MOKS_DISABLED: name = _("Disabled"); break;
+ case MOKS_AFTER_T_KE: name = _("Cleared"); break;
+ }
+
+ char buf[200];
+ vim_snprintf(buf, sizeof(buf),
+ _("modifyOtherKeys detected: %s\n"), name);
+ msg_puts(buf);
+ }
+
if (kitty_protocol_state != KKPS_INITIAL)
{
char *name = _("Unknown");
}
char buf[200];
- vim_snprintf(buf, sizeof(buf), _("Kitty keyboard protocol: %s"), name);
+ vim_snprintf(buf, sizeof(buf),
+ _("Kitty keyboard protocol: %s\n"), name);
msg_puts(buf);
}
}
{(int)KS_TI, "\0337\033[?47h"},
{(int)KS_TE, "\033[?47l\0338"},
# endif
- {(int)KS_CTI, "\033[>4;2m"},
+ {(int)KS_CTI, "\033[>4;2m\033[?4m"}, // see "builtin_mok2"
{(int)KS_CTE, "\033[>4;m"},
{(int)KS_CIS, "\033]1;"},
{(int)KS_CIE, "\007"},
* xterm.
*/
static tcap_entry_T builtin_mok2[] = {
- {(int)KS_CTI, "\033[>4;2m"},
+ // XTQMODKEYS was added in xterm version 377: "CSI ? 4 m" which should
+ // return "{lead} > 4 ; Pv m". Before version 377 we expect it to have no
+ // effect.
+ {(int)KS_CTI, "\033[>4;2m\033[?4m"},
{(int)KS_CTE, "\033[>4;m"},
{(int)KS_NAME, NULL} // end marker
out_str(T_CTE);
// The seenModifyOtherKeys flag is not reset here. We do expect t_TE to
- // disable modifyOtherKeys, but there is no way to detect it's enabled
- // again after the following t_TI. We assume that when seenModifyOtherKeys
- // was set before it will still be valid.
+ // disable modifyOtherKeys, but until Xterm version 377 there is no way to
+ // detect it's enabled again after the following t_TI. We assume that when
+ // seenModifyOtherKeys was set before it will still be valid.
+
+ // When the modifyOtherKeys level is detected to be 2 we expect t_TE to
+ // disable it. Remembering that it was detected to be enabled is useful in
+ // some situations.
+ // The following t_TI is expected to request the state and then
+ // modify_otherkeys_state will be set again.
+ if (modify_otherkeys_state == MOKS_ENABLED
+ || modify_otherkeys_state == MOKS_DISABLED)
+ modify_otherkeys_state = MOKS_DISABLED;
+ else if (modify_otherkeys_state != MOKS_INITIAL)
+ modify_otherkeys_state = MOKS_AFTER_T_KE;
// When the kitty keyboard protocol is enabled we expect t_TE to disable
// it. Remembering that it was detected to be enabled is useful in some
* Handle a CSI escape sequence.
* - Xterm version string.
*
+ * - Response to XTQMODKEYS: "{lead} > 4 ; Pv m".
+ *
* - Cursor position report: {lead}{row};{col}R
* The final byte must be 'R'. It is used for checking the
* ambiguous-width character state.
* - key with modifiers when modifyOtherKeys is enabled:
* {lead}27;{modifier};{key}~
* {lead}{key};{modifier}u
+ *
* Return 0 for no match, -1 for partial match, > 0 for full match.
*/
static int
trail = *ap;
csi_len = (int)(ap - tp) + 1;
+ // Response to XTQMODKEYS: "CSI > 4 ; Pv m" where Pv indicates the
+ // modifyOtherKeys level. Drop similar responses.
+ if (first == '>' && (argc == 1 || argc == 2) && trail == 'm')
+ {
+ if (arg[0] == 4 && argc == 2)
+ modify_otherkeys_state = arg[1] == 2 ? MOKS_ENABLED : MOKS_OFF;
+
+ key_name[0] = (int)KS_EXTRA;
+ key_name[1] = (int)KE_IGNORE;
+ *slen = csi_len;
+ }
+
// Cursor position report: Eat it when there are 2 arguments
// and it ends in 'R'. Also when u7_status is not "sent", it
// may be from a previous Vim that just exited. But not for
// <S-F3>, it sends something similar, check for row and column
// to make sense.
- if (first == -1 && argc == 2 && trail == 'R')
+ else if (first == -1 && argc == 2 && trail == 'R')
{
handle_u7_response(arg, tp, csi_len);
* Also eat other possible responses to t_RV, rxvt returns
* "{lead}?1;2c".
*
+ * - Response to XTQMODKEYS: "{lead} > 4 ; Pv m".
+ *
* - Cursor position report: {lead}{row};{col}R
* The final byte must be 'R'. It is used for checking the
* ambiguous-width character state.
-{"31kitty":{"Space":"20","version":"1b5b3e313b343030303b323163","C-Tab":"","A-Esc":"1b5b32373b313175","C-Space":"1b5b33323b3575","status":"1b5b3f3175","S-C-I":"1b5b3130353b3675","C-I":"1b5b3130353b3575","S-Tab":"1b5b393b3275","Tab":"09","resource":"","A-Tab":"1b5b393b313175","S-Space":"20","C-Esc":"1b5b32373b3575","protocol":"kitty","A-Space":"1b5b33323b313175","S-Esc":"1b5b32373b3275","Esc":"1b5b323775"},"32libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b393b3575","A-Esc":"1b5b32373b3375","C-Space":"1b5b33323b3575","status":"1b5b3f3175","S-C-I":"1b5b3130353b3675","C-I":"1b5b3130353b3575","S-Tab":"1b5b393b3275","Tab":"09","resource":"","A-Tab":"1b5b393b3375","S-Space":"1b5b33323b3275","C-Esc":"1b5b32373b3575","protocol":"kitty","A-Space":"1b5b33323b3375","S-Esc":"1b5b323775","Esc":"1b5b323775"},"22libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b32373b353b397e","A-Esc":"1b5b32373b333b32377e","C-Space":"1b5b32373b353b33327e","status":"","S-C-I":"1b5b32373b363b37337e","C-I":"1b5b32373b353b3130357e","S-Tab":"1b5b5a","Tab":"09","resource":"","A-Tab":"1b5b32373b333b397e","S-Space":"1b5b32373b323b33327e","C-Esc":"1b5b32373b353b32377e","protocol":"mok2","A-Space":"1b5b32373b333b33327e","S-Esc":"1b","Esc":"1b"},"13kitty":{"Space":"20","version":"1b5b3e313b343030303b323163","C-Tab":"","A-Esc":"1b1b","status":"","S-C-I":"1b5b3130353b3675","C-I":"09","S-Tab":"1b5b5a","Tab":"09","resource":"","A-Tab":"1b09","S-Space":"20","C-Esc":"1b","protocol":"none","A-Space":"1b5b33323b313175","S-Esc":"1b","Esc":"1b"},"21xterm":{"Space":"20","version":"1b5b3e34313b3335363b3063","C-Tab":"1b5b32373b353b397e","A-Esc":"1b5b32373b333b32377e","C-Space":"1b5b32373b353b33327e","status":"","S-C-I":"1b5b32373b363b37337e","C-I":"1b5b32373b353b3130357e","S-Tab":"1b5b5a","Tab":"09","resource":"=30","A-Tab":"1b5b32373b333b397e","S-Space":"1b5b32373b323b33327e","C-Esc":"1b5b32373b353b32377e","protocol":"mok2","A-Space":"1b5b32373b333b33327e","S-Esc":"1b","Esc":"1b"},"12libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b393b3575","A-Esc":"9b00","status":"","S-C-I":"1b5b5a","C-I":"09","S-Tab":"1b5b5a","Tab":"09","S-Space":"1b5b33323b3275","A-Tab":"8900","resource":"","C-Esc":"1b5b32373b3575","protocol":"none","A-Space":"a000","S-Esc":"1b","Esc":"1b"},"11xterm":{"Space":"20","version":"1b5b3e34313b3335363b3063","C-Tab":"09","A-Esc":"9b00","status":"","S-C-I":"09","C-I":"09","S-Tab":"1b5b5a","Tab":"09","S-Space":"20","A-Tab":"8900","C-Esc":"1b","protocol":"none","A-Space":"a000","S-Esc":"1b","Esc":"1b"}}
+{"31kitty":{"Space":"20","version":"1b5b3e313b343030303b323163","C-Tab":"","A-Esc":"1b5b32373b313175","C-Space":"1b5b33323b3575","status":"1b5b3f3175","S-C-I":"1b5b3130353b3675","C-I":"1b5b3130353b3575","S-Tab":"1b5b393b3275","Tab":"09","resource":"","A-Tab":"1b5b393b313175","S-Space":"20","C-Esc":"1b5b32373b3575","protocol":"kitty","A-Space":"1b5b33323b313175","S-Esc":"1b5b32373b3275","Esc":"1b5b323775"},"32libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b393b3575","A-Esc":"1b5b32373b3375","C-Space":"1b5b33323b3575","status":"1b5b3f3175","S-C-I":"1b5b3130353b3675","C-I":"1b5b3130353b3575","S-Tab":"1b5b393b3275","Tab":"09","resource":"","A-Tab":"1b5b393b3375","S-Space":"1b5b33323b3275","C-Esc":"1b5b32373b3575","protocol":"kitty","A-Space":"1b5b33323b3375","S-Esc":"1b5b323775","Esc":"1b5b323775"},"22libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b32373b353b397e","A-Esc":"1b5b32373b333b32377e","C-Space":"1b5b32373b353b33327e","status":"","S-C-I":"1b5b32373b363b37337e","C-I":"1b5b32373b353b3130357e","S-Tab":"1b5b5a","Tab":"09","resource":"","A-Tab":"1b5b32373b333b397e","S-Space":"1b5b32373b323b33327e","C-Esc":"1b5b32373b353b32377e","protocol":"mok2","A-Space":"1b5b32373b333b33327e","S-Esc":"1b5b32373b323b32377e","Esc":"1b"},"13kitty":{"Space":"20","version":"1b5b3e313b343030303b323163","C-Tab":"","A-Esc":"1b1b","status":"","S-C-I":"1b5b3130353b3675","C-I":"09","S-Tab":"1b5b5a","Tab":"09","resource":"","A-Tab":"1b09","S-Space":"20","C-Esc":"1b","protocol":"none","A-Space":"1b5b33323b313175","S-Esc":"1b","Esc":"1b"},"21xterm":{"Space":"20","modkeys":"2","version":"1b5b3e34313b3337373b3063","C-Tab":"1b5b32373b353b397e","A-Esc":"1b5b32373b333b32377e","C-Space":"1b5b32373b353b33327e","status":"","S-C-I":"1b5b32373b363b37337e","C-I":"1b5b32373b353b3130357e","S-Tab":"1b5b5a","Tab":"09","resource":"=30","A-Tab":"1b5b32373b333b397e","S-Space":"1b5b32373b323b33327e","C-Esc":"1b5b32373b353b32377e","protocol":"mok2","A-Space":"1b5b32373b333b33327e","S-Esc":"1b5b32373b323b32377e","Esc":"1b"},"12libvterm":{"Space":"20","version":"1b5b3e303b3130303b3063","C-Tab":"1b5b393b3575","A-Esc":"9b00","status":"","S-C-I":"1b5b5a","C-I":"09","S-Tab":"1b5b5a","Tab":"09","S-Space":"1b5b33323b3275","A-Tab":"8900","resource":"","C-Esc":"1b5b32373b3575","protocol":"none","A-Space":"a000","S-Esc":"1b","Esc":"1b"},"11xterm":{"Space":"20","version":"1b5b3e34313b3337373b3063","C-Tab":"09","A-Esc":"9b00","status":"","S-C-I":"09","C-I":"09","S-Tab":"1b5b5a","Tab":"09","resource":"","A-Tab":"8900","S-Space":"20","C-Esc":"1b","protocol":"none","A-Space":"a000","S-Esc":"1b","Esc":"1b"}}
endif
sort(terms)
- var items = ['protocol', 'version', 'status', 'resource']
+ var items = ['protocol', 'version', 'status', 'modkeys']
+ key_entries->copy()->map((_, v) => v[1])
# For each terminal compute the needed width, add two.
if proto == 1
&t_TI = ""
elseif proto == 2
- # Enable modifyOtherKeys level 2
- # Request the resource value: DCS + Q modifyOtherKeys ST
- &t_TI = "\<Esc>[>4;2m" .. "\<Esc>P+Q6d6f646966794f746865724b657973\<Esc>\\"
+ # Enable modifyOtherKeys level 2. Request the XTQMODKEYS value.
+ &t_TI = "\<Esc>[>4;2m" .. "\<Esc>[?4m"
proto_name = 'mok2'
elseif proto == 3
# Enable Kitty keyboard protocol and request the status
# Pattern that matches the line with the version response.
const version_pattern = "\<Esc>\\[>\\d\\+;\\d\\+;\\d*c"
- # Pattern that matches the resource value response:
- # DCS 1 + R Pt ST valid
- # DCS 0 + R Pt ST invalid
- const resource_pattern = "\<Esc>P[01]+R.*\<Esc>\\\\"
+ # Pattern that matches the XTQMODKEYS response:
+ # CSI > 4;Pv m
+ # where Pv indicates the modifyOtherKeys level
+ const modkeys_pattern = "\<Esc>\\[>4;\\dm"
# Pattern that matches the line with the status. Currently what terminals
# return for the Kitty keyboard protocol.
keycodes[name]['protocol'] = proto_name
keycodes[name]['version'] = ''
keycodes[name]['status'] = ''
- keycodes[name]['resource'] = ''
+ keycodes[name]['modkeys'] = ''
# Check the log file for a status and the version response
ch_logfile('', '')
if line =~ 'raw key input'
var code = substitute(line, '.*raw key input: "\([^"]*\).*', '\1', '')
- # Check for resource value response
- if code =~ resource_pattern
- var resource = substitute(code, '.*\(' .. resource_pattern .. '\).*', '\1', '')
- # use the value as the resource, "=30" means zero
- resource = substitute(resource, '.*\(=\p\+\).*', '\1', '')
+ # Check for the XTQMODKEYS response.
+ if code =~ modkeys_pattern
+ var modkeys = substitute(code, '.*\(' .. modkeys_pattern .. '\).*', '\1', '')
+ # Get the level out of the response
+ modkeys = substitute(modkeys, '.*4;\(\d\)m', '\1', '')
- if keycodes[name]['resource'] != ''
- echomsg 'Another resource found after ' .. keycodes[name]['resource']
+ if keycodes[name]['modkeys'] != ''
+ echomsg 'Another modkeys found after ' .. keycodes[name]['modkeys']
endif
- keycodes[name]['resource'] = resource
+ keycodes[name]['modkeys'] = modkeys
endif
# Check for kitty keyboard protocol status
" Only load this once.
if 1
+
+ " When using xterm version 377 the response to the modifyOtherKeys status
+ " interferes with some tests. Remove the request from the t_TI termcap
+ " entry.
+ let &t_TI = substitute(&t_TI, "\<Esc>\\[?4m", '', '')
+
if exists('s:did_load')
finish
endif
source view_util.vim
+" When 'term' is changed some status requests may be sent. The responses may
+" interfere with what is being tested. A short sleep is used to process any of
+" those responses first.
+func WaitForResponses()
+ sleep 50m
+endfunc
+
" Get the name of the Python executable.
" Also keeps it in s:python.
func PythonProg()
\ execute('nmap ,n')->trim()->split("\n"))
" verbose map
- " first line might be "seen modifyOtherKeys"
let lines = execute('verbose map ,n')->trim()->split("\n")
+
+ " Remove "Seen modifyOtherKeys" and other optional info.
+ if lines[0] =~ 'Seen modifyOtherKeys'
+ call remove(lines, 0)
+ endif
+ if lines[0] =~ 'modifyOtherKeys detected:'
+ call remove(lines, 0)
+ endif
+ if lines[0] =~ 'Kitty keyboard protocol:'
+ call remove(lines, 0)
+ endif
+ if lines[0] == ''
+ call remove(lines, 0)
+ endif
+
let index = indexof(lines, 'v:val =~ "Last set"')
- call assert_inrange(1, 2, index)
+ call assert_equal(1, index)
call assert_match("\tLast set from .*/test_mapping.vim line \\d\\+$",
\ lines[index])
CheckNotGui
CheckUnix
+source shared.vim
source mouse.vim
" Test for modeless characterwise selection (single click)
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm mousetime=200
+ call WaitForResponses()
+
new
call setline(1, ['one two three', 'foo bar baz'])
redraw!
+ " Wait a bit for any terminal responses to get processed.
+ sleep 50m
+
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let msg = 'ttymouse=' .. ttymouse_val
exe 'set ttymouse=' .. ttymouse_val
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm mousetime=200
+ call WaitForResponses()
+
new
call setline(1, ['one two three', 'foo bar baz'])
redraw!
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm mousetime=200
+ call WaitForResponses()
+
new
call setline(1, ['one two three', 'foo bar baz'])
redraw!
func Test_normal50_commandline()
CheckFeature timers
CheckFeature cmdline_hist
+
func! DoTimerWork(id)
call assert_equal('[Command Line]', bufname(''))
+
" should fail, with E11, but does fail with E23?
"call feedkeys("\<c-^>", 'tm')
- " should also fail with E11
+ " should fail with E11 - "Invalid in command-line window"
call assert_fails(":wincmd p", 'E11:')
- " return from commandline window
- call feedkeys("\<cr>")
+
+ " Return from commandline window.
+ call feedkeys("\<CR>", 't')
endfunc
let oldlang=v:lang
catch /E23/
" no-op
endtry
+
" clean up
+ delfunc DoTimerWork
set updatetime=4000
exe "lang" oldlang
bw!
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
+
call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
for visual_mode in ["v", "V", "\<C-V>"]
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let save_term = &term
let save_ttymouse = &ttymouse
set mouse=a term=xterm
+ call WaitForResponses()
for ttymouse_val in g:Ttymouse_values
let msg = 'ttymouse=' .. ttymouse_val
let save_quotestar = @*
let save_quoteplus = @+
set mouse=a term=xterm
+ call WaitForResponses()
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let msg = 'ttymouse=' .. ttymouse_val
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let msg = 'ttymouse=' .. ttymouse_val
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let msg = 'ttymouse=' .. ttymouse_val
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm ttymouse=xterm2
+ call WaitForResponses()
call feedkeys('ivim' ..
\ MouseLeftClickCode(8, 6) .. MouseLeftReleaseCode(8, 6) ..
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm ttymouse=xterm2
+ call WaitForResponses()
+
5new
redraw!
let save_wrap = &wrap
let save_ttymouse = &ttymouse
set mouse=a term=xterm nowrap
+ call WaitForResponses()
+
call setline(1, range(100000000000000, 100000000000100))
for ttymouse_val in g:Ttymouse_values
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
+
let col = 1
call setline(1, range(1, 100))
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let msg = 'ttymouse=' .. ttymouse_val
call test_override('no_query_mouse', 1)
let save_laststatus = &laststatus
set mouse=a term=xterm laststatus=2
+ call WaitForResponses()
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let msg = 'ttymouse=' .. ttymouse_val
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
+
let row = 1
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
+
let row = 1
let col = &columns
call test_override('no_query_mouse', 1)
" Set 'mousetime' to 1 to avoid recognizing a double-click in the loop
set mouse=a term=xterm mousetime=1
+ call WaitForResponses()
+
let row = 1
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
" Set 'mousetime' to a small value, so that double-click works but we don't
" have to wait long to avoid a triple-click.
set mouse=a term=xterm mousetime=200
+ call WaitForResponses()
+
let row = 1
let col = 10
" 'mousetime' must be sufficiently large, or else the test is flaky when
" using a ssh connection with X forwarding; i.e. ssh -X (issue #7563).
set mouse=a term=xterm mousetime=600
+ call WaitForResponses()
+
new
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
call test_override('no_query_mouse', 1)
set mouse=a term=xterm mousetime=200
set mousemodel=popup
+ call WaitForResponses()
+
new
call setline(1, 'one (two) three')
let save_ttymouse = &ttymouse
let save_foldcolumn = &foldcolumn
set mouse=a term=xterm foldcolumn=3 ttymouse=xterm2
+ call WaitForResponses()
" Create 2 nested folds.
call setline(1, range(1, 7))
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
+
let row = &lines
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm
+ call WaitForResponses()
+
let row = &lines
" Column values does not matter, paste is done at position of cursor.
let col = 1
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm ttymouse=xterm2 mousemodel=
+ call WaitForResponses()
call test_setmouse(1, 1)
exe "normal \<S-MiddleMouse>"
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set term=xterm ttymouse=xterm2
+ call WaitForResponses()
" If visual mode is not present in 'mouse', then left click should not
" do anything in visal mode.
let save_mousemodel = &mousemodel
call test_override('no_query_mouse', 1)
set mouse=a term=xterm mousemodel=popup
+ call WaitForResponses()
menu PopUp.foo :let g:menustr = 'foo'<CR>
menu PopUp.bar :let g:menustr = 'bar'<CR>
let save_mousemodel = &mousemodel
call test_override('no_query_mouse', 1)
set mouse=a term=xterm mousemodel=popup_setpos
+ call WaitForResponses()
nmenu PopUp.foo :let g:menustr = 'foo'<CR>
nmenu PopUp.bar :let g:menustr = 'bar'<CR>
call test_override('no_query_mouse', 1)
set mouse=a term=xterm ttymouse=xterm2
set mousemodel=
+ call WaitForResponses()
" In normal mode, Shift-Left or Shift-Right click should search for the word
" under the cursor.
call test_override('no_query_mouse', 1)
set mouse=a term=xterm ttymouse=xterm2
set mousemodel=
+ call WaitForResponses()
cgetexpr "Xfile1:1:L1"
copen 5
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=h term=xterm mousetime=200
+ call WaitForResponses()
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
let msg = 'ttymouse=' .. ttymouse_val
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=xterm mousetime=200
+ call WaitForResponses()
new
for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm
" xterm < 95: "xterm" (actually unmodified)
set t_RV=
set term=xterm
+ call WaitForResponses()
+
set t_RV=x
set ttymouse=xterm
call test_option_not_set('ttymouse')
let save_term = &term
let save_ttymouse = &ttymouse
set term=xterm ttymouse=xterm2
+ call WaitForResponses()
au FocusGained * let g:focus_gained += 1
au FocusLost * let g:focus_lost += 1
" make this execute faster
set timeoutlen=10
+ call WaitForResponses()
+
" Escape sent as `CSI 27 u` should act as normal escape and not undo
call setline(1, 'a')
call feedkeys('a' .. GetEscCodeCSIuWithoutModifier("\e"), 'Lx!')
let save_ttymouse = &ttymouse
call test_override('no_query_mouse', 1)
set mouse=a term=gnome ttymouse=
+ call WaitForResponses()
execute "set <xF1>=\<Esc>[1;*P"
nnoremap <S-F1> agot it<Esc>
func Test_insert_literal()
set timeoutlen=10
+
+ call WaitForResponses()
+
new
" CTRL-V CTRL-X inserts a ^X
call feedkeys('a' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu('X', '5') .. "\<Esc>", 'Lx!')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 954,
/**/
953,
/**/