mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor(messages): rename msg_trunc_attr and msg_multiline_attr without attr
This commit is contained in:
parent
b85f1dafc7
commit
448d4837be
@ -3233,7 +3233,7 @@ void fileinfo(int fullname, int shorthelp, int dont_truncate)
|
||||
msg(buffer, 0);
|
||||
msg_scroll = n;
|
||||
} else {
|
||||
p = msg_trunc_attr(buffer, false, 0);
|
||||
p = msg_trunc(buffer, false, 0);
|
||||
if (restart_edit != 0 || (msg_scrolled && !need_wait_return)) {
|
||||
// Need to repeat the message after redrawing when:
|
||||
// - When restart_edit is set (otherwise there will be a delay
|
||||
|
@ -1785,7 +1785,7 @@ restore_backup:
|
||||
}
|
||||
}
|
||||
|
||||
set_keep_msg(msg_trunc_attr(IObuff, false, 0), 0);
|
||||
set_keep_msg(msg_trunc(IObuff, false, 0), 0);
|
||||
}
|
||||
|
||||
// When written everything correctly: reset 'modified'. Unless not
|
||||
|
@ -8018,7 +8018,7 @@ void ex_echo(exarg_T *eap)
|
||||
char *tofree = encode_tv2echo(&rettv, NULL);
|
||||
if (*tofree != NUL) {
|
||||
msg_ext_set_kind("echo");
|
||||
msg_multiline_attr(tofree, echo_attr, true, &need_clear);
|
||||
msg_multiline(tofree, echo_attr, true, &need_clear);
|
||||
}
|
||||
xfree(tofree);
|
||||
}
|
||||
|
@ -1762,7 +1762,7 @@ failed:
|
||||
if (msg_col > 0) {
|
||||
msg_putchar('\r'); // overwrite previous message
|
||||
}
|
||||
p = (uint8_t *)msg_trunc_attr(IObuff, false, 0);
|
||||
p = (uint8_t *)msg_trunc(IObuff, false, 0);
|
||||
}
|
||||
|
||||
if (read_stdin || read_buffer || restart_edit != 0
|
||||
|
@ -1451,10 +1451,10 @@ static void ins_compl_files(int count, char **files, int thesaurus, int flags, r
|
||||
for (i = 0; i < count && !got_int && !compl_interrupted; i++) {
|
||||
fp = os_fopen(files[i], "r"); // open dictionary file
|
||||
if (flags != DICT_EXACT && !shortmess(SHM_COMPLETIONSCAN)) {
|
||||
msg_hist_off = true; // reset in msg_trunc_attr()
|
||||
msg_hist_off = true; // reset in msg_trunc()
|
||||
vim_snprintf(IObuff, IOSIZE,
|
||||
_("Scanning dictionary: %s"), files[i]);
|
||||
(void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R));
|
||||
(void)msg_trunc(IObuff, true, HL_ATTR(HLF_R));
|
||||
}
|
||||
|
||||
if (fp == NULL) {
|
||||
@ -2877,14 +2877,14 @@ static int process_next_cpt_value(ins_compl_next_state_T *st, int *compl_type_ar
|
||||
st->dict_f = DICT_EXACT;
|
||||
}
|
||||
if (!shortmess(SHM_COMPLETIONSCAN)) {
|
||||
msg_hist_off = true; // reset in msg_trunc_attr()
|
||||
msg_hist_off = true; // reset in msg_trunc()
|
||||
vim_snprintf(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(IObuff, true, HL_ATTR(HLF_R));
|
||||
(void)msg_trunc(IObuff, true, HL_ATTR(HLF_R));
|
||||
}
|
||||
} else if (*st->e_cpt == NUL) {
|
||||
status = INS_COMPL_CPT_END;
|
||||
@ -2908,9 +2908,9 @@ static int process_next_cpt_value(ins_compl_next_state_T *st, int *compl_type_ar
|
||||
} else if (*st->e_cpt == ']' || *st->e_cpt == 't') {
|
||||
compl_type = CTRL_X_TAGS;
|
||||
if (!shortmess(SHM_COMPLETIONSCAN)) {
|
||||
msg_hist_off = true; // reset in msg_trunc_attr()
|
||||
msg_hist_off = true; // reset in msg_trunc()
|
||||
vim_snprintf(IObuff, IOSIZE, "%s", _("Scanning tags."));
|
||||
(void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R));
|
||||
(void)msg_trunc(IObuff, true, HL_ATTR(HLF_R));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ int msg(const char *s, const int attr)
|
||||
}
|
||||
|
||||
/// Similar to msg_outtrans, but support newlines and tabs.
|
||||
void msg_multiline_attr(const char *s, int attr, bool check_int, bool *need_clear)
|
||||
void msg_multiline(const char *s, int attr, bool check_int, bool *need_clear)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
const char *next_spec = s;
|
||||
@ -273,7 +273,7 @@ void msg_multiattr(HlMessage hl_msg, const char *kind, bool history)
|
||||
msg_ext_set_kind(kind);
|
||||
for (uint32_t i = 0; i < kv_size(hl_msg); i++) {
|
||||
HlMessageChunk chunk = kv_A(hl_msg, i);
|
||||
msg_multiline_attr(chunk.text.data, chunk.attr, true, &need_clear);
|
||||
msg_multiline(chunk.text.data, chunk.attr, true, &need_clear);
|
||||
}
|
||||
if (history && kv_size(hl_msg)) {
|
||||
add_msg_hist_multiattr(NULL, 0, 0, true, hl_msg);
|
||||
@ -334,7 +334,7 @@ bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline)
|
||||
|
||||
bool need_clear = true;
|
||||
if (multiline) {
|
||||
msg_multiline_attr(s, attr, false, &need_clear);
|
||||
msg_multiline(s, attr, false, &need_clear);
|
||||
} else {
|
||||
msg_outtrans(s, attr);
|
||||
}
|
||||
@ -903,7 +903,7 @@ void msg_schedule_semsg_multiline(const char *const fmt, ...)
|
||||
/// Careful: The string may be changed by msg_may_trunc()!
|
||||
///
|
||||
/// @return a pointer to the printed message, if wait_return() not called.
|
||||
char *msg_trunc_attr(char *s, bool force, int attr)
|
||||
char *msg_trunc(char *s, bool force, int attr)
|
||||
{
|
||||
int n;
|
||||
|
||||
|
@ -3791,11 +3791,11 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool
|
||||
files[depth].lnum = 0;
|
||||
files[depth].matched = false;
|
||||
if (action == ACTION_EXPAND) {
|
||||
msg_hist_off = true; // reset in msg_trunc_attr()
|
||||
msg_hist_off = true; // reset in msg_trunc()
|
||||
vim_snprintf(IObuff, IOSIZE,
|
||||
_("Scanning included file: %s"),
|
||||
new_fname);
|
||||
msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R));
|
||||
msg_trunc(IObuff, true, HL_ATTR(HLF_R));
|
||||
} else if (p_verbose >= 5) {
|
||||
verbose_enter();
|
||||
smsg(_("Searching included file %s"), new_fname);
|
||||
|
Loading…
Reference in New Issue
Block a user