aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-03 02:12:54 -0400
committerGitHub <noreply@github.com>2020-10-03 02:12:54 -0400
commitf6ac375604238c94d3dc3eeb9b82e67417460806 (patch)
tree8a3b978d3daa8cc32bf626daaad54f2d35ae30ec /src/nvim/ex_docmd.c
parentc10c2fab5b4509a7ff50526b56c669f30ebf87c9 (diff)
parent86ab4a1cb4cbf377d2ddf90f785d811a0be50cfc (diff)
downloadrneovim-f6ac375604238c94d3dc3eeb9b82e67417460806.tar.gz
rneovim-f6ac375604238c94d3dc3eeb9b82e67417460806.tar.bz2
rneovim-f6ac375604238c94d3dc3eeb9b82e67417460806.zip
Merge pull request #13026 from janlazo/vim-8.2.1779
vim-patch:8.1.{2143},8.2.{841,1779,1780,1784,1787}
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 7bb4bd32a3..ccaa0b0e52 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 "*".
*/
@@ -567,17 +588,8 @@ 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;
+ if ((p_verbose >= 15 && sourcing_name != NULL) || p_verbose >= 16) {
+ msg_verbose_cmd(sourcing_lnum, cmdline_copy);
}
/*