Patch 8.1.2143
Problem: Cannot see each command even when 'verbose' is set.
Solution: List each command when 'verbose' is at least 16.
Files: src/ex_docmd.c src/testdir/test_tagjump.vim,
src/testdir/test_cmdline.vim,
src/testdir/dumps/Test_verbose_option_1.dump
*** ../vim-8.1.2142/src/ex_docmd.c 2019-09-21 23:09:00.971830733 +0200
--- src/ex_docmd.c 2019-10-12 20:16:57.193887540 +0200
***************
*** 559,564 ****
--- 559,585 ----
}
/*
+ * Print the executed command for when 'verbose' is set.
+ * When "lnum" is 0 only print the command.
+ */
+ static void
+ msg_verbose_cmd(linenr_T lnum, char_u *cmd)
+ {
+ ++no_wait_return;
+ verbose_enter_scroll();
+
+ if (lnum == 0)
+ smsg(_("Executing: %s"), cmd);
+ else
+ smsg(_("line %ld: %s"), (long)lnum, cmd);
+ if (msg_silent == 0)
+ msg_puts("\n"); // don't overwrite this
+
+ verbose_leave_scroll();
+ --no_wait_return;
+ }
+
+ /*
* Execute a simple command line. Used for translated commands like "*".
*/
int
***************
*** 944,961 ****
}
if (p_verbose >= 15 && sourcing_name != NULL)
! {
! ++no_wait_return;
! verbose_enter_scroll();
!
! smsg(_("line %ld: %s"),
! (long)sourcing_lnum, cmdline_copy);
! if (msg_silent == 0)
! msg_puts("\n"); /* don't overwrite this */
!
! verbose_leave_scroll();
! --no_wait_return;
! }
/*
* 2. Execute one '|' separated command.
--- 965,971 ----
}
if (p_verbose >= 15 && sourcing_name != NULL)
! msg_verbose_cmd(sourcing_lnum, cmdline_copy);
/*
* 2. Execute one '|' separated command.
***************
*** 1666,1671 ****
--- 1676,1684 ----
if ((*cmdlinep)[0] == '#' && (*cmdlinep)[1] == '!')
goto doend;
+ if (p_verbose >= 16)
+ msg_verbose_cmd(0, *cmdlinep);
+
/*
* 1. Skip comment lines and leading white space and colons.
* 2. Handle command modifiers.
***************
*** 8534,8542 ****
{
linenr_T lnum;
! #ifdef FEAT_CLIPBOARD
start_global_changes();
! #endif
/* First set the marks for all lines closed/open. */
for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
--- 8547,8555 ----
{
linenr_T lnum;
! # ifdef FEAT_CLIPBOARD
start_global_changes();
! # endif
/* First set the marks for all lines closed/open. */
for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
***************
*** 8546,8554 ****
/* Execute the command on the marked lines. */
global_exe(eap->arg);
ml_clearmarked(); /* clear rest of the marks */
! #ifdef FEAT_CLIPBOARD
end_global_changes();
! #endif
}
#endif
--- 8559,8567 ----
/* Execute the command on the marked lines. */
global_exe(eap->arg);
ml_clearmarked(); /* clear rest of the marks */
! # ifdef FEAT_CLIPBOARD
end_global_changes();
! # endif
}
#endif
***************
*** 8566,8572 ****
}
#endif
! # if defined(FEAT_TIMERS) || defined(PROTO)
int
get_pressedreturn(void)
{
--- 8579,8585 ----
}
#endif
! #if defined(FEAT_TIMERS) || defined(PROTO)
int
get_pressedreturn(void)
{
*** ../vim-8.1.2142/src/testdir/test_tagjump.vim 2019-10-12
17:06:48.798440368 +0200
--- src/testdir/test_tagjump.vim 2019-10-12 19:47:30.377447463 +0200
***************
*** 501,506 ****
--- 501,507 ----
call term_sendkeys(buf, ":tselect main\<CR>2\<CR>")
call VerifyScreenDump(buf, 'Test_tselect_1', {})
+ call StopVimInTerminal(buf)
call delete('Xtags')
call delete('Xtest.c')
call delete('XTest_tselect')
*** ../vim-8.1.2142/src/testdir/test_cmdline.vim 2019-09-15
17:26:04.940719209 +0200
--- src/testdir/test_cmdline.vim 2019-10-12 20:02:32.633680879 +0200
***************
*** 1,5 ****
--- 1,8 ----
" Tests for editing the command line.
+ source check.vim
+ source screendump.vim
+
func Test_complete_tab()
call writefile(['testfile'], 'Xtestfile')
call feedkeys(":e Xtest\t\r", "tx")
***************
*** 687,692 ****
--- 690,715 ----
call delete('Xlog')
endfunc
+ func Test_verbose_option()
+ CheckScreendump
+
+ let lines =<< trim [SCRIPT]
+ command DoSomething echo 'hello' |set ts=4 |let v = '123' |echo v
+ call feedkeys("\r", 't') " for the hit-enter prompt
+ set verbose=20
+ [SCRIPT]
+ call writefile(lines, 'XTest_verbose')
+
+ let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12})
+ call term_wait(buf, 100)
+ call term_sendkeys(buf, ":DoSomething\<CR>")
+ call VerifyScreenDump(buf, 'Test_verbose_option_1', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XTest_verbose')
+ endfunc
+
func Test_setcmdpos()
func InsertTextAtPos(text, pos)
call assert_equal(0, setcmdpos(a:pos))
*** ../vim-8.1.2142/src/testdir/dumps/Test_verbose_option_1.dump
2019-10-12 20:16:16.014059421 +0200
--- src/testdir/dumps/Test_verbose_option_1.dump 2019-10-12
20:02:39.225649502 +0200
***************
*** 0 ****
--- 1,12 ----
+ |~+0#4040ff13#ffffff0| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |E+0#0000000&|x|e|c|u|t|i|n|g|:| |D|o|S|o|m|e|t|h|i|n|g| @52
+ |E|x|e|c|u|t|i|n|g|:| |e|c|h|o| |'|h|e|l@1|o|'| |||s|e|t| |t|s|=|4| |||l|e|t|
|v| |=| |'|1|2|3|'| |||e|c|h|o| |v| @18
+ |h|e|l@1|o| @69
+ |E|x|e|c|u|t|i|n|g|:| |s|e|t| |t|s|=|4| |||l|e|t| |v| |=| |'|1|2|3|'|
|||e|c|h|o| |v| @32
+ |E|x|e|c|u|t|i|n|g|:| |l|e|t| |v| |=| |'|1|2|3|'| |||e|c|h|o| |v| @42
+ |E|x|e|c|u|t|i|n|g|:| |e|c|h|o| |v| @57
+ |1|2|3| @71
+ |P+0#00e0003&|r|e|s@1| |E|N|T|E|R| |o|r| |t|y|p|e| |c|o|m@1|a|n|d| |t|o|
|c|o|n|t|i|n|u|e> +0#0000000&@35
*** ../vim-8.1.2142/src/version.c 2019-10-12 18:22:46.957511288 +0200
--- src/version.c 2019-10-12 19:36:43.883791207 +0200
***************
*** 755,756 ****
--- 755,758 ----
{ /* Add new patch number below this line */
+ /**/
+ 2143,
/**/
--
It is illegal for anyone to give lighted cigars to dogs, cats, and other
domesticated animal kept as pets.
[real standing law in Illinois, United States of America]
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/201910121818.x9CIIbiq017002%40masaka.moolenaar.net.