diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-11-11 12:26:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-11 12:26:35 +0100 |
commit | d0e78b587195d201d643f3e131dd1ea951d906db (patch) | |
tree | 2a08bef2c02751daf28a33be8c57049554b57726 /src/nvim/eval.c | |
parent | 7919aa9102e1b9b7a9f7feaea6b134a98f5b60fc (diff) | |
parent | 4f9260d06a48216862ebb34fc33744486b058f58 (diff) | |
download | rneovim-d0e78b587195d201d643f3e131dd1ea951d906db.tar.gz rneovim-d0e78b587195d201d643f3e131dd1ea951d906db.tar.bz2 rneovim-d0e78b587195d201d643f3e131dd1ea951d906db.zip |
Merge pull request #27813 from luukvbaal/msgid
feat(ext_messages): add hl_id to ext_messages chunks
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 58c98c42ff..1fb7666167 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -126,7 +126,7 @@ bool *eval_lavars_used = NULL; #define SCRIPT_SV(id) (SCRIPT_ITEM(id)->sn_vars) #define SCRIPT_VARS(id) (SCRIPT_SV(id)->sv_dict.dv_hashtab) -static int echo_attr = 0; // attributes used for ":echo" +static int echo_hl_id = 0; // highlight id used for ":echo" /// Info used by a ":for" loop. typedef struct { @@ -7876,12 +7876,12 @@ void ex_echo(exarg_T *eap) msg_start(); } } else if (eap->cmdidx == CMD_echo) { - msg_puts_attr(" ", echo_attr); + msg_puts_hl(" ", echo_hl_id, false); } char *tofree = encode_tv2echo(&rettv, NULL); if (*tofree != NUL) { msg_ext_set_kind("echo"); - msg_multiline(tofree, echo_attr, true, &need_clear); + msg_multiline(tofree, echo_hl_id, true, false, &need_clear); } xfree(tofree); } @@ -7907,13 +7907,13 @@ void ex_echo(exarg_T *eap) /// ":echohl {name}". void ex_echohl(exarg_T *eap) { - echo_attr = syn_name2attr(eap->arg); + echo_hl_id = syn_name2id(eap->arg); } -/// Returns the :echo attribute -int get_echo_attr(void) +/// Returns the :echo highlight id +int get_echo_hl_id(void) { - return echo_attr; + return echo_hl_id; } /// ":execute expr1 ..." execute the result of an expression. @@ -7964,7 +7964,7 @@ void ex_execute(exarg_T *eap) if (ret != FAIL && ga.ga_data != NULL) { if (eap->cmdidx == CMD_echomsg) { msg_ext_set_kind("echomsg"); - msg(ga.ga_data, echo_attr); + msg(ga.ga_data, echo_hl_id); } else if (eap->cmdidx == CMD_echoerr) { // We don't want to abort following commands, restore did_emsg. int save_did_emsg = did_emsg; |