summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author=?UTF-8?q?Bj=C3=B6rn=20Linse?= <bjorn.linse@gmail.com>2022-10-13 12:51:13 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-13 12:51:13 +0100
commit91ccbad5ded8bcf2cc93a873ff2c3179b0c548c7 (patch)
tree4a05f5002f9a6ecabb98dd90d014427eda955420
parentd26c5805bcbd630dab0478c2d22503a6e32a83c1 (diff)
downloadvim-git-9.0.0738.tar.gz
patch 9.0.0738: cannot suppress completion "scanning" messagesv9.0.0738
Problem: Cannot suppress completion "scanning" messages. Solution: Add the "C" flag in 'shortmess'. (Bjorn Linse, closes #11354)
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--src/insexpand.c30
-rw-r--r--src/option.h3
-rw-r--r--src/version.c2
4 files changed, 24 insertions, 13 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index b3c4a408e..ee6e5da20 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -7079,6 +7079,8 @@ A jump table for the options with a short description can be found at |Q_op|.
c don't give |ins-completion-menu| messages. For example,
"-- XXX completion (YYY)", "match 1 of 2", "The only match",
"Pattern not found", "Back at original", etc.
+ C don't give messages while scanning for ins-completion items,
+ for instance "scanning tags"
q use "recording" instead of "recording @a"
F don't give the file info when editing a file, like `:silent`
was used for the command; note that this also affects messages
diff --git a/src/insexpand.c b/src/insexpand.c
index 8f8157e01..36a8ab1fd 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -1573,7 +1573,7 @@ ins_compl_files(
for (i = 0; i < count && !got_int && !compl_interrupted; i++)
{
fp = mch_fopen((char *)files[i], "r"); // open dictionary file
- if (flags != DICT_EXACT)
+ if (flags != DICT_EXACT && !shortmess(SHM_COMPLETIONSCAN))
{
msg_hist_off = TRUE; // reset in msg_trunc_attr()
vim_snprintf((char *)IObuff, IOSIZE,
@@ -3281,14 +3281,17 @@ process_next_cpt_value(
st->dict = st->ins_buf->b_fname;
st->dict_f = DICT_EXACT;
}
- msg_hist_off = TRUE; // reset in msg_trunc_attr()
- vim_snprintf((char *)IObuff, IOSIZE, _("Scanning: %s"),
- st->ins_buf->b_fname == NULL
- ? buf_spname(st->ins_buf)
- : st->ins_buf->b_sfname == NULL
- ? st->ins_buf->b_fname
- : st->ins_buf->b_sfname);
- (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R));
+ if (!shortmess(SHM_COMPLETIONSCAN))
+ {
+ msg_hist_off = TRUE; // reset in msg_trunc_attr()
+ vim_snprintf((char *)IObuff, IOSIZE, _("Scanning: %s"),
+ st->ins_buf->b_fname == NULL
+ ? buf_spname(st->ins_buf)
+ : st->ins_buf->b_sfname == NULL
+ ? st->ins_buf->b_fname
+ : st->ins_buf->b_sfname);
+ (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R));
+ }
}
else if (*st->e_cpt == NUL)
status = INS_COMPL_CPT_END;
@@ -3316,10 +3319,13 @@ process_next_cpt_value(
#endif
else if (*st->e_cpt == ']' || *st->e_cpt == 't')
{
- msg_hist_off = TRUE; // reset in msg_trunc_attr()
compl_type = CTRL_X_TAGS;
- vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags."));
- (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R));
+ if (!shortmess(SHM_COMPLETIONSCAN))
+ {
+ msg_hist_off = TRUE; // reset in msg_trunc_attr()
+ vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags."));
+ (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R));
+ }
}
else
compl_type = -1;
diff --git a/src/option.h b/src/option.h
index 0e98824dc..19e2a781a 100644
--- a/src/option.h
+++ b/src/option.h
@@ -265,11 +265,12 @@ typedef enum {
#define SHM_ATTENTION 'A' // no ATTENTION messages
#define SHM_INTRO 'I' // intro messages
#define SHM_COMPLETIONMENU 'c' // completion menu messages
+#define SHM_COMPLETIONSCAN 'C' // completion scanning messages
#define SHM_RECORDING 'q' // short recording message
#define SHM_FILEINFO 'F' // no file info messages
#define SHM_SEARCHCOUNT 'S' // search stats: '[1/10]'
#define SHM_POSIX "AS" // POSIX value
-#define SHM_ALL "rmfixlnwaWtToOsAIcqFS" // all possible flags for 'shm'
+#define SHM_ALL "rmfixlnwaWtToOsAIcCqFS" // all possible flags for 'shm'
// characters for p_go:
#define GO_TERMINAL '!' // use terminal for system commands
diff --git a/src/version.c b/src/version.c
index 9a485a098..e3a6f360f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 738,
+/**/
737,
/**/
736,