if (compl_status_adding())
{
- edit_submode_pre = (char_u *)_(" Adding");
+ if (!shortmess(SHM_COMPLETIONMENU))
+ edit_submode_pre = (char_u *)_(" Adding");
if (ctrl_x_mode_line_or_eval())
{
// Insert a new line, keep indentation but ignore 'comments'.
compl_startpos.col = compl_col;
}
- if (compl_cont_status & CONT_LOCAL)
- edit_submode = (char_u *)_(ctrl_x_msgs[CTRL_X_LOCAL_MSG]);
- else
- edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode));
+ if (!shortmess(SHM_COMPLETIONMENU))
+ {
+ if (compl_cont_status & CONT_LOCAL)
+ edit_submode = (char_u *)_(ctrl_x_msgs[CTRL_X_LOCAL_MSG]);
+ else
+ edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode));
+ }
// If any of the original typed text has been changed we need to fix
// the redo buffer.
// showmode might reset the internal line pointers, so it must
// be called before line = ml_get(), or when this address is no
// longer needed. -- Acevedo.
- edit_submode_extra = (char_u *)_("-- Searching...");
- edit_submode_highl = HLF_COUNT;
- showmode();
- edit_submode_extra = NULL;
- out_flush();
+ if (!shortmess(SHM_COMPLETIONMENU))
+ {
+ edit_submode_extra = (char_u *)_("-- Searching...");
+ edit_submode_highl = HLF_COUNT;
+ showmode();
+ edit_submode_extra = NULL;
+ out_flush();
+ }
return OK;
}
else
compl_cont_status &= ~CONT_S_IPOS;
- ins_compl_show_statusmsg();
+ if (!shortmess(SHM_COMPLETIONMENU))
+ ins_compl_show_statusmsg();
// Show the popup menu, unless we got interrupted.
if (enable_pum && !compl_interrupted)
unlet g:CallCount
endfunc
+" Test that option shortmess=c turns off completion messages
+func Test_shortmess()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, ['hello', 'hullo', 'heee'])
+ END
+
+ call writefile(lines, 'Xpumscript', 'D')
+ let buf = RunVimInTerminal('-S Xpumscript', #{rows: 12})
+ call term_sendkeys(buf, "Goh\<C-N>")
+ call TermWait(buf, 200)
+ call VerifyScreenDump(buf, 'Test_shortmess_complmsg_1', {})
+ call term_sendkeys(buf, "\<ESC>:set shm+=c\<CR>")
+ call term_sendkeys(buf, "Sh\<C-N>")
+ call TermWait(buf, 200)
+ call VerifyScreenDump(buf, 'Test_shortmess_complmsg_2', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab nofoldenable