patch 8.1.2141: :tselect has an extra hit-enter prompt
Problem: :tselect has an extra hit-enter prompt.
Solution: Do not set need_wait_return when only moving the cursor.
(closes #5040)
This commit is contained in:
@ -1980,15 +1980,14 @@ msg_puts_attr_len(char *str, int maxlen, int attr)
|
|||||||
attr &= ~MSG_HIST;
|
attr &= ~MSG_HIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// When writing something to the screen after it has scrolled, requires a
|
||||||
* When writing something to the screen after it has scrolled, requires a
|
// wait-return prompt later. Needed when scrolling, resetting
|
||||||
* wait-return prompt later. Needed when scrolling, resetting
|
// need_wait_return after some prompt, and then outputting something
|
||||||
* need_wait_return after some prompt, and then outputting something
|
// without scrolling
|
||||||
* without scrolling
|
// Not needed when only using CR to move the cursor.
|
||||||
*/
|
if (msg_scrolled != 0 && !msg_scrolled_ign && STRCMP(str, "\r") != 0)
|
||||||
if (msg_scrolled != 0 && !msg_scrolled_ign)
|
|
||||||
need_wait_return = TRUE;
|
need_wait_return = TRUE;
|
||||||
msg_didany = TRUE; /* remember that something was outputted */
|
msg_didany = TRUE; // remember that something was outputted
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there is no valid screen, use fprintf so we can see error messages.
|
* If there is no valid screen, use fprintf so we can see error messages.
|
||||||
|
|||||||
10
src/testdir/dumps/Test_tselect_1.dump
Normal file
10
src/testdir/dumps/Test_tselect_1.dump
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
>i+0#00e0003#ffffff0|n|t| +0#0000000&|m|a|i|n|(|)| @39
|
||||||
|
|v+0#00e0003&|o|i|d| +0#0000000&|t|e|s|t|(|)| @38
|
||||||
|
|~+0#4040ff13&| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|"+0#0000000&|X|t|e|s|t|.|c|"| |2|L|,| |2|3|C| @14|1|,|1| @10|A|l@1|
|
||||||
@ -1,5 +1,8 @@
|
|||||||
" Tests for tagjump (tags and special searches)
|
" Tests for tagjump (tags and special searches)
|
||||||
|
|
||||||
|
source check.vim
|
||||||
|
source screendump.vim
|
||||||
|
|
||||||
" SEGV occurs in older versions. (At least 7.4.1748 or older)
|
" SEGV occurs in older versions. (At least 7.4.1748 or older)
|
||||||
func Test_ptag_with_notagstack()
|
func Test_ptag_with_notagstack()
|
||||||
set notagstack
|
set notagstack
|
||||||
@ -473,4 +476,34 @@ func Test_tag_line_toolong()
|
|||||||
let &verbose = old_vbs
|
let &verbose = old_vbs
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Check that using :tselect does not run into the hit-enter prompt.
|
||||||
|
" Requires a terminal to trigger that prompt.
|
||||||
|
func Test_tselect()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
call writefile([
|
||||||
|
\ 'main Xtest.h /^void test();$/;" f',
|
||||||
|
\ 'main Xtest.c /^int main()$/;" f',
|
||||||
|
\ 'main Xtest.x /^void test()$/;" f',
|
||||||
|
\ ], 'Xtags')
|
||||||
|
cal writefile([
|
||||||
|
\ 'int main()',
|
||||||
|
\ 'void test()',
|
||||||
|
\ ], 'Xtest.c')
|
||||||
|
|
||||||
|
let lines =<< trim [SCRIPT]
|
||||||
|
set tags=Xtags
|
||||||
|
[SCRIPT]
|
||||||
|
call writefile(lines, 'XTest_tselect')
|
||||||
|
let buf = RunVimInTerminal('-S XTest_tselect', {'rows': 10, 'cols': 50})
|
||||||
|
|
||||||
|
call term_wait(buf, 100)
|
||||||
|
call term_sendkeys(buf, ":tselect main\<CR>2\<CR>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_tselect_1', {})
|
||||||
|
|
||||||
|
call delete('Xtags')
|
||||||
|
call delete('Xtest.c')
|
||||||
|
call delete('XTest_tselect')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
|||||||
@ -753,6 +753,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2141,
|
||||||
/**/
|
/**/
|
||||||
2140,
|
2140,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user