aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2025-02-05 23:09:29 +0000
committerJosh Rahm <joshuarahm@gmail.com>2025-02-05 23:09:29 +0000
commitd5f194ce780c95821a855aca3c19426576d28ae0 (patch)
treed45f461b19f9118ad2bb1f440a7a08973ad18832 /src/nvim/eval.c
parentc5d770d311841ea5230426cc4c868e8db27300a8 (diff)
parent44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff)
downloadrneovim-rahm.tar.gz
rneovim-rahm.tar.bz2
rneovim-rahm.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309HEADrahm
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index faacf3c65a..97d1a3c75d 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -270,6 +270,7 @@ static struct vimvar {
VV(VV_COLLATE, "collate", VAR_STRING, VV_RO),
VV(VV_EXITING, "exiting", VAR_NUMBER, VV_RO),
VV(VV_MAXCOL, "maxcol", VAR_NUMBER, VV_RO),
+ VV(VV_STACKTRACE, "stacktrace", VAR_LIST, VV_RO),
// Neovim
VV(VV_STDERR, "stderr", VAR_NUMBER, VV_RO),
VV(VV_MSGPACK_TYPES, "msgpack_types", VAR_DICT, VV_RO),
@@ -4112,10 +4113,10 @@ int eval_option(const char **const arg, typval_T *const rettv, const bool evalua
{
const bool working = (**arg == '+'); // has("+option")
OptIndex opt_idx;
- int scope;
+ int opt_flags;
// Isolate the option name and find its value.
- char *const option_end = (char *)find_option_var_end(arg, &opt_idx, &scope);
+ char *const option_end = (char *)find_option_var_end(arg, &opt_idx, &opt_flags);
if (option_end == NULL) {
if (rettv != NULL) {
@@ -4143,7 +4144,7 @@ int eval_option(const char **const arg, typval_T *const rettv, const bool evalua
ret = FAIL;
} else if (rettv != NULL) {
- OptVal value = is_tty_opt ? get_tty_option(*arg) : get_option_value(opt_idx, scope);
+ OptVal value = is_tty_opt ? get_tty_option(*arg) : get_option_value(opt_idx, opt_flags);
assert(value.type != kOptValTypeNil);
*rettv = optval_as_tv(value, true);
@@ -7965,8 +7966,7 @@ void ex_execute(exarg_T *eap)
} else if (eap->cmdidx == CMD_echoerr) {
// We don't want to abort following commands, restore did_emsg.
int save_did_emsg = did_emsg;
- msg_ext_set_kind("echoerr");
- emsg_multiline(ga.ga_data, true);
+ emsg_multiline(ga.ga_data, "echoerr", HLF_E, true);
if (!force_abort) {
did_emsg = save_did_emsg;
}
@@ -7986,24 +7986,25 @@ void ex_execute(exarg_T *eap)
/// Skip over the name of an option variable: "&option", "&g:option" or "&l:option".
///
-/// @param[in,out] arg Points to the "&" or '+' when called, to "option" when returning.
-/// @param[out] opt_idxp Set to option index in options[] table.
-/// @param[out] scope Set to option scope.
+/// @param[in,out] arg Points to the "&" or '+' when called, to "option" when returning.
+/// @param[out] opt_idxp Set to option index in options[] table.
+/// @param[out] opt_flags Option flags.
///
/// @return NULL when no option name found. Otherwise pointer to the char after the option name.
-const char *find_option_var_end(const char **const arg, OptIndex *const opt_idxp, int *const scope)
+const char *find_option_var_end(const char **const arg, OptIndex *const opt_idxp,
+ int *const opt_flags)
{
const char *p = *arg;
p++;
if (*p == 'g' && p[1] == ':') {
- *scope = OPT_GLOBAL;
+ *opt_flags = OPT_GLOBAL;
p += 2;
} else if (*p == 'l' && p[1] == ':') {
- *scope = OPT_LOCAL;
+ *opt_flags = OPT_LOCAL;
p += 2;
} else {
- *scope = 0;
+ *opt_flags = 0;
}
const char *end = find_option_end(p, opt_idxp);
@@ -8490,7 +8491,7 @@ char *do_string_sub(char *str, size_t len, char *pat, char *sub, typval_T *expr,
return ret;
}
-/// common code for getting job callbacks for jobstart, termopen and rpcstart
+/// Common code for getting job callbacks for `jobstart`.
///
/// @return true/false on success/failure.
bool common_job_callbacks(dict_T *vopts, CallbackReader *on_stdout, CallbackReader *on_stderr,