aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-02 01:05:12 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-02 23:13:28 -0400
commit970d6ee0d1fafb92eeaa56a3d767e704c6ef42c2 (patch)
treea97286d989f9cd0998542a7e9713c4517a214d55 /src/nvim/ex_docmd.c
parent2000e1621d5e529d660dc0a7534f0884b6179c8b (diff)
downloadrneovim-970d6ee0d1fafb92eeaa56a3d767e704c6ef42c2.tar.gz
rneovim-970d6ee0d1fafb92eeaa56a3d767e704c6ef42c2.tar.bz2
rneovim-970d6ee0d1fafb92eeaa56a3d767e704c6ef42c2.zip
vim-patch:8.1.2143: cannot see each command even when 'verbose' is set
Problem: Cannot see each command even when 'verbose' is set. Solution: List each command when 'verbose' is at least 16. https://github.com/vim/vim/commit/4facea310c2788c88f021b262658b847381a50a8 Cherry-pick Test_tselect() from patch 8.1.2141. It requires screendump so it won't run. I cannot port it to a lua screen test.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 7bb4bd32a3..a4ed86e4c0 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -258,6 +258,27 @@ void do_exmode(int improved)
msg_scroll = save_msg_scroll;
}
+// 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)
+ FUNC_ATTR_NONNULL_ALL
+{
+ no_wait_return++;
+ verbose_enter_scroll();
+
+ if (lnum == 0) {
+ smsg(_("Executing: %s"), cmd);
+ } else {
+ smsg(_("line %" PRIdLINENR ": %s"), 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 "*".
*/
@@ -568,16 +589,7 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
}
if (p_verbose >= 15 && sourcing_name != NULL) {
- ++no_wait_return;
- verbose_enter_scroll();
-
- smsg(_("line %" PRIdLINENR ": %s"), sourcing_lnum, cmdline_copy);
- if (msg_silent == 0) {
- msg_puts("\n"); // don't overwrite this either
- }
-
- verbose_leave_scroll();
- --no_wait_return;
+ msg_verbose_cmd(sourcing_lnum, cmdline_copy);
}
/*
@@ -1269,6 +1281,10 @@ static char_u * do_one_cmd(char_u **cmdlinep,
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.