aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cjson/lua_cjson.c55
-rw-r--r--src/nvim/api/buffer.c8
-rw-r--r--src/nvim/api/command.c2
-rw-r--r--src/nvim/api/extmark.c29
-rw-r--r--src/nvim/api/private/converter.c4
-rw-r--r--src/nvim/api/private/defs.h4
-rw-r--r--src/nvim/api/private/helpers.c8
-rw-r--r--src/nvim/api/private/helpers.h4
-rw-r--r--src/nvim/api/vim.c6
-rw-r--r--src/nvim/api/vimscript.c26
-rw-r--r--src/nvim/api/window.c6
-rw-r--r--src/nvim/drawline.c58
-rw-r--r--src/nvim/eval.c10
-rw-r--r--src/nvim/eval.lua2
-rw-r--r--src/nvim/eval/decode.c6
-rw-r--r--src/nvim/eval/encode.c2
-rw-r--r--src/nvim/eval/encode.h4
-rw-r--r--src/nvim/eval/funcs.c2
-rw-r--r--src/nvim/eval/funcs.h4
-rw-r--r--src/nvim/eval/typval.c32
-rw-r--r--src/nvim/eval/typval.h4
-rw-r--r--src/nvim/eval/typval_defs.h4
-rw-r--r--src/nvim/eval/typval_encode.h4
-rw-r--r--src/nvim/event/multiqueue.c2
-rw-r--r--src/nvim/ex_getln.c2
-rw-r--r--src/nvim/func_attr.h4
-rw-r--r--src/nvim/highlight_group.c1
-rw-r--r--src/nvim/insexpand.c2
-rw-r--r--src/nvim/lua/converter.c9
-rw-r--r--src/nvim/lua/executor.c8
-rw-r--r--src/nvim/quickfix.c2
-rw-r--r--src/nvim/runtime.c2
-rw-r--r--src/nvim/shada.c6
-rw-r--r--src/nvim/strings.c22
-rw-r--r--src/nvim/types.h2
-rw-r--r--src/nvim/viml/parser/expressions.c12
36 files changed, 214 insertions, 144 deletions
diff --git a/src/cjson/lua_cjson.c b/src/cjson/lua_cjson.c
index c243f93c05..6af43d8eb7 100644
--- a/src/cjson/lua_cjson.c
+++ b/src/cjson/lua_cjson.c
@@ -1,3 +1,5 @@
+// Upstream: https://github.com/openresty/lua-cjson/blob/master/lua_cjson.c
+
/* Lua CJSON - JSON support for Lua
*
* Copyright (c) 2010-2012 Mark Pulford <mark@kyne.com.au>
@@ -252,6 +254,7 @@ static json_config_t *json_fetch_config(lua_State *l)
/* Ensure the correct number of arguments have been provided.
* Pad with nil to allow other functions to simply check arg[i]
* to find whether an argument was provided */
+/*
static json_config_t *json_arg_init(lua_State *l, int args)
{
luaL_argcheck(l, lua_gettop(l) <= args, args + 1,
@@ -262,8 +265,10 @@ static json_config_t *json_arg_init(lua_State *l, int args)
return json_fetch_config(l);
}
+*/
/* Process integer options for configuration functions */
+/*
static int json_integer_option(lua_State *l, int optindex, int *setting,
int min, int max)
{
@@ -281,8 +286,10 @@ static int json_integer_option(lua_State *l, int optindex, int *setting,
return 1;
}
+*/
/* Process enumerated arguments for a configuration function */
+/*
static int json_enum_option(lua_State *l, int optindex, int *setting,
const char **options, int bool_true)
{
@@ -307,11 +314,13 @@ static int json_enum_option(lua_State *l, int optindex, int *setting,
return 1;
}
+*/
/* Configures handling of extremely sparse arrays:
* convert: Convert extremely sparse arrays into objects? Otherwise error.
* ratio: 0: always allow sparse; 1: never allow sparse; >1: use ratio
* safe: Always use an array when the max index <= safe */
+/*
static int json_cfg_encode_sparse_array(lua_State *l)
{
json_config_t *cfg = json_arg_init(l, 3);
@@ -322,42 +331,52 @@ static int json_cfg_encode_sparse_array(lua_State *l)
return 3;
}
+*/
/* Configures the maximum number of nested arrays/objects allowed when
* encoding */
+/*
static int json_cfg_encode_max_depth(lua_State *l)
{
json_config_t *cfg = json_arg_init(l, 1);
return json_integer_option(l, 1, &cfg->encode_max_depth, 1, INT_MAX);
}
+*/
/* Configures the maximum number of nested arrays/objects allowed when
* encoding */
+/*
static int json_cfg_decode_max_depth(lua_State *l)
{
json_config_t *cfg = json_arg_init(l, 1);
return json_integer_option(l, 1, &cfg->decode_max_depth, 1, INT_MAX);
}
+*/
/* Configures number precision when converting doubles to text */
+/*
static int json_cfg_encode_number_precision(lua_State *l)
{
json_config_t *cfg = json_arg_init(l, 1);
return json_integer_option(l, 1, &cfg->encode_number_precision, 1, 16);
}
+*/
/* Configures how to treat empty table when encode lua table */
+/*
static int json_cfg_encode_empty_table_as_object(lua_State *l)
{
json_config_t *cfg = json_arg_init(l, 1);
return json_enum_option(l, 1, &cfg->encode_empty_table_as_object, NULL, 1);
}
+*/
/* Configures how to decode arrays */
+/*
static int json_cfg_decode_array_with_array_mt(lua_State *l)
{
json_config_t *cfg = json_arg_init(l, 1);
@@ -366,8 +385,10 @@ static int json_cfg_decode_array_with_array_mt(lua_State *l)
return 1;
}
+*/
/* Configures JSON encoding buffer persistence */
+/*
static int json_cfg_encode_keep_buffer(lua_State *l)
{
json_config_t *cfg = json_arg_init(l, 1);
@@ -377,7 +398,7 @@ static int json_cfg_encode_keep_buffer(lua_State *l)
json_enum_option(l, 1, &cfg->encode_keep_buffer, NULL, 1);
- /* Init / free the buffer if the setting has changed */
+ // Init / free the buffer if the setting has changed
if (old_value ^ cfg->encode_keep_buffer) {
if (cfg->encode_keep_buffer)
strbuf_init(&cfg->encode_buf, 0);
@@ -387,6 +408,7 @@ static int json_cfg_encode_keep_buffer(lua_State *l)
return 1;
}
+*/
#if defined(DISABLE_INVALID_NUMBERS) && !defined(USE_INTERNAL_FPCONV)
void json_verify_invalid_number_setting(lua_State *l, int *setting)
@@ -400,6 +422,7 @@ void json_verify_invalid_number_setting(lua_State *l, int *setting)
#define json_verify_invalid_number_setting(l, s) do { } while(0)
#endif
+/*
static int json_cfg_encode_invalid_numbers(lua_State *l)
{
static const char *options[] = { "off", "on", "null", NULL };
@@ -411,7 +434,9 @@ static int json_cfg_encode_invalid_numbers(lua_State *l)
return 1;
}
+*/
+/*
static int json_cfg_decode_invalid_numbers(lua_State *l)
{
json_config_t *cfg = json_arg_init(l, 1);
@@ -422,7 +447,9 @@ static int json_cfg_decode_invalid_numbers(lua_State *l)
return 1;
}
+*/
+/*
static int json_cfg_encode_escape_forward_slash(lua_State *l)
{
int ret;
@@ -436,6 +463,7 @@ static int json_cfg_encode_escape_forward_slash(lua_State *l)
}
return ret;
}
+*/
static int json_destroy_config(lua_State *l)
{
@@ -1417,9 +1445,9 @@ static int json_decode(lua_State *l)
lua_getfield(l, 2, "luanil");
/* We only handle the luanil option for now */
- if (lua_isnil(l, -1)) {
- lua_pop(l, 1);
- break;
+ if (lua_isnil(l, -1)) {
+ lua_pop(l, 1);
+ break;
}
luaL_checktype(l, -1, LUA_TTABLE);
@@ -1534,6 +1562,8 @@ int lua_cjson_new(lua_State *l)
luaL_Reg reg[] = {
{ "encode", json_encode },
{ "decode", json_decode },
+ // Nvim: don't expose options which cause global side-effects.
+ /*
{ "encode_empty_table_as_object", json_cfg_encode_empty_table_as_object },
{ "decode_array_with_array_mt", json_cfg_decode_array_with_array_mt },
{ "encode_sparse_array", json_cfg_encode_sparse_array },
@@ -1544,6 +1574,7 @@ int lua_cjson_new(lua_State *l)
{ "encode_invalid_numbers", json_cfg_encode_invalid_numbers },
{ "decode_invalid_numbers", json_cfg_decode_invalid_numbers },
{ "encode_escape_forward_slash", json_cfg_encode_escape_forward_slash },
+ */
{ "new", lua_cjson_new },
{ NULL, NULL }
};
@@ -1589,23 +1620,31 @@ int lua_cjson_new(lua_State *l)
json_create_config(l);
compat_luaL_setfuncs(l, reg, 1);
- /* Set cjson.null */
+ // Nvim: don't expose "null", it is identical to vim.NIL.
+ /*
nlua_pushref(l, nlua_get_nil_ref(l));
lua_setfield(l, -2, "null");
+ */
- /* Set cjson.empty_array_mt */
+ // Nvim: don't expose empty_array_mt.
+ /*
lua_pushlightuserdata(l, json_lightudata_mask(&json_empty_array));
lua_rawget(l, LUA_REGISTRYINDEX);
lua_setfield(l, -2, "empty_array_mt");
+ */
- /* Set cjson.array_mt */
+ // Nvim: don't expose array_mt.
+ /*
lua_pushlightuserdata(l, json_lightudata_mask(&json_array));
lua_rawget(l, LUA_REGISTRYINDEX);
lua_setfield(l, -2, "array_mt");
+ */
- /* Set cjson.empty_array */
+ // Nvim: don't expose empty_array.
+ /*
lua_pushlightuserdata(l, json_lightudata_mask(&json_array));
lua_setfield(l, -2, "empty_array");
+ */
/* Set module name / version fields */
lua_pushliteral(l, CJSON_MODNAME);
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 82a62c3192..4c3faf8d8b 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -112,7 +112,7 @@ Integer nvim_buf_line_count(Buffer buffer, Error *err)
/// - byte count of previous contents
/// - deleted_codepoints (if `utf_sizes` is true)
/// - deleted_codeunits (if `utf_sizes` is true)
-/// - on_bytes: lua callback invoked on change.
+/// - on_bytes: Lua callback invoked on change.
/// This callback receives more granular information about the
/// change compared to on_lines.
/// Return `true` to detach.
@@ -1250,11 +1250,11 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err)
/// buffer/window currently, like |termopen()|.
///
/// @param buffer Buffer handle, or 0 for current buffer
-/// @param fun Function to call inside the buffer (currently lua callable
+/// @param fun Function to call inside the buffer (currently Lua callable
/// only)
/// @param[out] err Error details, if any
-/// @return Return value of function. NB: will deepcopy lua values
-/// currently, use upvalues to send lua references in and out.
+/// @return Return value of function. NB: will deepcopy Lua values
+/// currently, use upvalues to send Lua references in and out.
Object nvim_buf_call(Buffer buffer, LuaRef fun, Error *err)
FUNC_API_SINCE(7)
FUNC_API_LUA_ONLY
diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c
index 6d715bcf46..eba209b424 100644
--- a/src/nvim/api/command.c
+++ b/src/nvim/api/command.c
@@ -306,7 +306,7 @@ end:
/// make their usage simpler with |vim.cmd()|. For example, instead of
/// `vim.cmd.bdelete{ count = 2 }`, you may do `vim.cmd.bdelete(2)`.
///
-/// On execution error: fails with VimL error, updates v:errmsg.
+/// On execution error: fails with Vimscript error, updates v:errmsg.
///
/// @see |nvim_exec2()|
/// @see |nvim_command()|
diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c
index aca290494b..a101e1bbf1 100644
--- a/src/nvim/api/extmark.c
+++ b/src/nvim/api/extmark.c
@@ -478,7 +478,7 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e
/// shifting the underlying text.
/// - "right_align": display right aligned in the window.
/// - "inline": display at the specified column, and
-/// shift the buffer text to the right as needed
+/// shift the buffer text to the right as needed
/// - virt_text_win_col : position the virtual text at a fixed
/// window column (starting from the first
/// text column)
@@ -490,10 +490,10 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e
/// highlights of the text. Currently only affects
/// virt_text highlights, but might affect `hl_group`
/// in later versions.
-/// - "replace": only show the virt_text color. This is the
-/// default
-/// - "combine": combine with background text color
+/// - "replace": only show the virt_text color. This is the default.
+/// - "combine": combine with background text color.
/// - "blend": blend with background text color.
+/// Not supported for "inline" virt_text.
///
/// - virt_lines : virtual lines to add next to this mark
/// This should be an array over lines, where each line in
@@ -701,7 +701,7 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
} else if (strequal("inline", str.data)) {
decor.virt_text_pos = kVTInline;
} else {
- VALIDATE_S(false, "virt_text_pos", "", {
+ VALIDATE_S(false, "virt_text_pos", str.data, {
goto error;
});
}
@@ -719,23 +719,28 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
OPTION_TO_BOOL(decor.virt_text_hide, virt_text_hide, false);
OPTION_TO_BOOL(decor.hl_eol, hl_eol, false);
- if (opts->hl_mode.type == kObjectTypeString) {
+ if (HAS_KEY(opts->hl_mode)) {
+ VALIDATE_T("hl_mode", kObjectTypeString, opts->hl_mode.type, {
+ goto error;
+ });
+
String str = opts->hl_mode.data.string;
if (strequal("replace", str.data)) {
decor.hl_mode = kHlModeReplace;
} else if (strequal("combine", str.data)) {
decor.hl_mode = kHlModeCombine;
} else if (strequal("blend", str.data)) {
+ if (decor.virt_text_pos == kVTInline) {
+ VALIDATE(false, "%s", "cannot use 'blend' hl_mode with inline virtual text", {
+ goto error;
+ });
+ }
decor.hl_mode = kHlModeBlend;
} else {
- VALIDATE_S(false, "virt_text_pos", "", {
+ VALIDATE_S(false, "hl_mode", str.data, {
goto error;
});
}
- } else if (HAS_KEY(opts->hl_mode)) {
- VALIDATE_T("hl_mode", kObjectTypeString, opts->hl_mode.type, {
- goto error;
- });
}
bool virt_lines_leftcol = false;
@@ -1048,7 +1053,7 @@ void nvim_buf_clear_namespace(Buffer buffer, Integer ns_id, Integer line_start,
/// Set or change decoration provider for a |namespace|
///
-/// This is a very general purpose interface for having lua callbacks
+/// This is a very general purpose interface for having Lua callbacks
/// being triggered during the redraw code.
///
/// The expected usage is to set |extmarks| for the currently
diff --git a/src/nvim/api/private/converter.c b/src/nvim/api/private/converter.c
index a62f975cfd..68939e609c 100644
--- a/src/nvim/api/private/converter.c
+++ b/src/nvim/api/private/converter.c
@@ -256,7 +256,7 @@ Object vim_to_object(typval_T *obj)
return ret;
}
-/// Converts from type Object to a VimL value.
+/// Converts from type Object to a Vimscript value.
///
/// @param obj Object to convert from.
/// @param tv Conversion result is placed here. On failure member v_type is
@@ -283,7 +283,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
case kObjectTypeTabpage:
case kObjectTypeInteger:
STATIC_ASSERT(sizeof(obj.data.integer) <= sizeof(varnumber_T),
- "Integer size must be <= VimL number size");
+ "Integer size must be <= Vimscript number size");
tv->v_type = VAR_NUMBER;
tv->vval.v_number = (varnumber_T)obj.data.integer;
break;
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h
index 7c5559f096..b1b9e383b0 100644
--- a/src/nvim/api/private/defs.h
+++ b/src/nvim/api/private/defs.h
@@ -42,10 +42,10 @@ typedef enum {
/// Mask for all internal calls
#define INTERNAL_CALL_MASK (((uint64_t)1) << (sizeof(uint64_t) * 8 - 1))
-/// Internal call from VimL code
+/// Internal call from Vimscript code
#define VIML_INTERNAL_CALL INTERNAL_CALL_MASK
-/// Internal call from lua code
+/// Internal call from Lua code
#define LUA_INTERNAL_CALL (VIML_INTERNAL_CALL + 1)
static inline bool is_internal_call(uint64_t channel_id)
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c
index 2544809553..f9861c82bf 100644
--- a/src/nvim/api/private/helpers.c
+++ b/src/nvim/api/private/helpers.c
@@ -40,10 +40,10 @@
# include "api/private/ui_events_metadata.generated.h"
#endif
-/// Start block that may cause VimL exceptions while evaluating another code
+/// Start block that may cause Vimscript exceptions while evaluating another code
///
-/// Used when caller is supposed to be operating when other VimL code is being
-/// processed and that “other VimL code” must not be affected.
+/// Used when caller is supposed to be operating when other Vimscript code is being
+/// processed and that “other Vimscript code” must not be affected.
///
/// @param[out] tstate Location where try state should be saved.
void try_enter(TryState *const tstate)
@@ -806,7 +806,7 @@ bool api_object_to_bool(Object obj, const char *what, bool nil_value, Error *err
} else if (obj.type == kObjectTypeInteger) {
return obj.data.integer; // C semantics: non-zero int is true
} else if (obj.type == kObjectTypeNil) {
- return nil_value; // caller decides what NIL (missing retval in lua) means
+ return nil_value; // caller decides what NIL (missing retval in Lua) means
} else {
api_set_error(err, kErrorTypeValidation, "%s is not a boolean", what);
return false;
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h
index 3887a11dd1..cb74c655cd 100644
--- a/src/nvim/api/private/helpers.h
+++ b/src/nvim/api/private/helpers.h
@@ -135,8 +135,8 @@ EXTERN PMap(int) tabpage_handles INIT(= MAP_INIT);
/// Structure used for saving state for :try
///
-/// Used when caller is supposed to be operating when other VimL code is being
-/// processed and that “other VimL code” must not be affected.
+/// Used when caller is supposed to be operating when other Vimscript code is being
+/// processed and that “other Vimscript code” must not be affected.
typedef struct {
except_T *current_exception;
msglist_T *private_msg_list;
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index a6f98a1915..9996dae247 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -544,7 +544,7 @@ String nvim__get_lib_dir(void)
///
/// @param pat pattern of files to search for
/// @param all whether to return all matches or only the first
-/// @param opts is_lua: only search lua subdirs
+/// @param opts is_lua: only search Lua subdirs
/// @return list of absolute paths to the found files
ArrayOf(String) nvim__get_runtime(Array pat, Boolean all, Dict(runtime) *opts, Error *err)
FUNC_API_SINCE(8)
@@ -941,7 +941,7 @@ fail:
///
/// @param buffer the buffer to use (expected to be empty)
/// @param opts Optional parameters.
-/// - on_input: lua callback for input sent, i e keypresses in terminal
+/// - on_input: Lua callback for input sent, i e keypresses in terminal
/// mode. Note: keypresses are sent raw as they would be to the pty
/// master end. For instance, a carriage return is sent
/// as a "\r", not as a "\n". |textlock| applies. It is possible
@@ -1009,7 +1009,7 @@ static void term_write(char *buf, size_t size, void *data) // NOLINT(readabilit
static void term_resize(uint16_t width, uint16_t height, void *data)
{
- // TODO(bfredl): lua callback
+ // TODO(bfredl): Lua callback
}
static void term_close(void *data)
diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c
index 1a67be8860..eb573e2556 100644
--- a/src/nvim/api/vimscript.c
+++ b/src/nvim/api/vimscript.c
@@ -38,7 +38,7 @@
/// Unlike |nvim_command()| this function supports heredocs, script-scope (s:),
/// etc.
///
-/// On execution error: fails with VimL error, updates v:errmsg.
+/// On execution error: fails with Vimscript error, updates v:errmsg.
///
/// @see |execute()|
/// @see |nvim_command()|
@@ -126,7 +126,7 @@ theend:
/// Executes an Ex command.
///
-/// On execution error: fails with VimL error, updates v:errmsg.
+/// On execution error: fails with Vimscript error, updates v:errmsg.
///
/// Prefer using |nvim_cmd()| or |nvim_exec2()| over this. To evaluate multiple lines of Vim script
/// or an Ex command directly, use |nvim_exec2()|. To construct an Ex command using a structured
@@ -143,12 +143,12 @@ void nvim_command(String command, Error *err)
try_end(err);
}
-/// Evaluates a VimL |expression|.
+/// Evaluates a Vimscript |expression|.
/// Dictionaries and Lists are recursively expanded.
///
-/// On execution error: fails with VimL error, updates v:errmsg.
+/// On execution error: fails with Vimscript error, updates v:errmsg.
///
-/// @param expr VimL expression string
+/// @param expr Vimscript expression string
/// @param[out] err Error details, if any
/// @return Evaluation result or expanded object
Object nvim_eval(String expr, Error *err)
@@ -192,7 +192,7 @@ Object nvim_eval(String expr, Error *err)
return rv;
}
-/// Calls a VimL function.
+/// Calls a Vimscript function.
///
/// @param fn Function name
/// @param args Function arguments
@@ -258,9 +258,9 @@ free_vim_args:
return rv;
}
-/// Calls a VimL function with the given arguments.
+/// Calls a Vimscript function with the given arguments.
///
-/// On execution error: fails with VimL error, updates v:errmsg.
+/// On execution error: fails with Vimscript error, updates v:errmsg.
///
/// @param fn Function to call
/// @param args Function arguments packed in an Array
@@ -272,12 +272,12 @@ Object nvim_call_function(String fn, Array args, Error *err)
return _call_function(fn, args, NULL, err);
}
-/// Calls a VimL |Dictionary-function| with the given arguments.
+/// Calls a Vimscript |Dictionary-function| with the given arguments.
///
-/// On execution error: fails with VimL error, updates v:errmsg.
+/// On execution error: fails with Vimscript error, updates v:errmsg.
///
-/// @param dict Dictionary, or String evaluating to a VimL |self| dict
-/// @param fn Name of the function defined on the VimL dict
+/// @param dict Dictionary, or String evaluating to a Vimscript |self| dict
+/// @param fn Name of the function defined on the Vimscript dict
/// @param args Function arguments packed in an Array
/// @param[out] err Error details, if any
/// @return Result of the function call
@@ -363,7 +363,7 @@ typedef struct {
typedef kvec_withinit_t(ExprASTConvStackItem, 16) ExprASTConvStack;
/// @endcond
-/// Parse a VimL expression.
+/// Parse a Vimscript expression.
///
/// @param[in] expr Expression to parse. Always treated as a single line.
/// @param[in] flags Flags:
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index 97bf0f377a..e5a824fec9 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -412,11 +412,11 @@ void nvim_win_close(Window window, Boolean force, Error *err)
/// @see |nvim_buf_call()|
///
/// @param window Window handle, or 0 for current window
-/// @param fun Function to call inside the window (currently lua callable
+/// @param fun Function to call inside the window (currently Lua callable
/// only)
/// @param[out] err Error details, if any
-/// @return Return value of function. NB: will deepcopy lua values
-/// currently, use upvalues to send lua references in and out.
+/// @return Return value of function. NB: will deepcopy Lua values
+/// currently, use upvalues to send Lua references in and out.
Object nvim_win_call(Window window, LuaRef fun, Error *err)
FUNC_API_SINCE(7)
FUNC_API_LUA_ONLY
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 7da8bfae14..b8dc1297cc 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -128,11 +128,13 @@ typedef struct {
VirtText virt_inline;
size_t virt_inline_i;
+ HlMode virt_inline_hl_mode;
bool reset_extra_attr;
int skip_cells; // nr of cells to skip for virtual text
int skipped_cells; // nr of skipped virtual text cells
+ bool more_virt_inline_chunks; // indicates if there is more inline virtual text after n_extra
} winlinevars_T;
/// for line_putchar. Contains the state that needs to be remembered from
@@ -869,7 +871,26 @@ static void apply_cursorline_highlight(win_T *wp, winlinevars_T *wlv)
}
}
-static void handle_inline_virtual_text(win_T *wp, winlinevars_T *wlv, ptrdiff_t v, bool *do_save)
+// Checks if there is more inline virtual text that need to be drawn
+// and sets has_more_virt_inline_chunks to reflect that.
+static bool has_more_inline_virt(winlinevars_T *wlv, ptrdiff_t v)
+{
+ DecorState *state = &decor_state;
+ for (size_t i = 0; i < kv_size(state->active); i++) {
+ DecorRange *item = &kv_A(state->active, i);
+ if (item->start_row != state->row
+ || !kv_size(item->decor.virt_text)
+ || item->decor.virt_text_pos != kVTInline) {
+ continue;
+ }
+ if (item->draw_col >= -1 && item->start_col >= v) {
+ return true;
+ }
+ }
+ return false;
+}
+
+static void handle_inline_virtual_text(win_T *wp, winlinevars_T *wlv, ptrdiff_t v)
{
while (wlv->n_extra == 0) {
if (wlv->virt_inline_i >= kv_size(wlv->virt_inline)) {
@@ -886,10 +907,12 @@ static void handle_inline_virtual_text(win_T *wp, winlinevars_T *wlv, ptrdiff_t
}
if (item->draw_col >= -1 && item->start_col == v) {
wlv->virt_inline = item->decor.virt_text;
+ wlv->virt_inline_hl_mode = item->decor.hl_mode;
item->draw_col = INT_MIN;
break;
}
}
+ wlv->more_virt_inline_chunks = has_more_inline_virt(wlv, v);
if (!kv_size(wlv->virt_inline)) {
// no more inline virtual text here
break;
@@ -897,15 +920,21 @@ static void handle_inline_virtual_text(win_T *wp, winlinevars_T *wlv, ptrdiff_t
} else {
// already inside existing inline virtual text with multiple chunks
VirtTextChunk vtc = kv_A(wlv->virt_inline, wlv->virt_inline_i);
+ wlv->virt_inline_i++;
wlv->p_extra = vtc.text;
- wlv->n_extra = (int)strlen(wlv->p_extra);
- wlv->extra_for_extmark = true;
+ wlv->n_extra = (int)strlen(vtc.text);
+ if (wlv->n_extra == 0) {
+ continue;
+ }
wlv->c_extra = NUL;
wlv->c_final = NUL;
wlv->extra_attr = vtc.hl_id ? syn_id2attr(vtc.hl_id) : 0;
wlv->n_attr = mb_charlen(vtc.text);
- wlv->virt_inline_i++;
- *do_save = true;
+
+ // Checks if there is more inline virtual text chunks that need to be drawn.
+ wlv->more_virt_inline_chunks = has_more_inline_virt(wlv, v)
+ || wlv->virt_inline_i < kv_size(wlv->virt_inline);
+
// If the text didn't reach until the first window
// column we need to skip cells.
if (wlv->skip_cells > 0) {
@@ -926,11 +955,12 @@ static void handle_inline_virtual_text(win_T *wp, winlinevars_T *wlv, ptrdiff_t
wlv->skipped_cells += virt_text_len;
wlv->n_attr = 0;
wlv->n_extra = 0;
-
// go to the start so the next virtual text chunk can be selected.
continue;
}
}
+ assert(wlv->n_extra > 0);
+ wlv->extra_for_extmark = true;
}
}
}
@@ -1523,7 +1553,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
// If there the text doesn't reach to the desired column, need to skip
// "skip_cells" cells when virtual text follows.
- if (!wp->w_p_wrap && v > wlv.vcol) {
+ if ((!wp->w_p_wrap || (lnum == wp->w_topline && wp->w_skipcol > 0)) && v > wlv.vcol) {
wlv.skip_cells = (int)(v - wlv.vcol);
}
@@ -1789,15 +1819,14 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
wlv.reset_extra_attr = false;
}
- if (has_decor && v >= 0 && wlv.n_extra == 0) {
+ if (has_decor && wlv.n_extra == 0) {
bool selected = (area_active || (area_highlighting && noinvcur
&& wlv.vcol == wp->w_virtcol));
extmark_attr = decor_redraw_col(wp, (colnr_T)v, wlv.off, selected, &decor_state);
if (!has_fold) {
- bool do_save = false;
- handle_inline_virtual_text(wp, &wlv, v, &do_save);
- if (do_save) {
+ handle_inline_virtual_text(wp, &wlv, v);
+ if (wlv.n_extra > 0 && wlv.virt_inline_hl_mode <= kHlModeReplace) {
// restore search_attr and area_attr when n_extra is down to zero
// TODO(bfredl): this is ugly as fuck. look if we can do this some other way.
saved_search_attr = search_attr;
@@ -1812,7 +1841,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
}
}
- if (wlv.n_extra == 0) {
+ if (!has_fold && wlv.n_extra == 0) {
// Check for start/end of 'hlsearch' and other matches.
// After end, check for start/end of next match.
// When another match, have to check for start again.
@@ -2871,7 +2900,8 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
&& !has_fold
&& (*ptr != NUL
|| lcs_eol_one > 0
- || (wlv.n_extra > 0 && (wlv.c_extra != NUL || *wlv.p_extra != NUL)))) {
+ || (wlv.n_extra > 0 && (wlv.c_extra != NUL || *wlv.p_extra != NUL))
+ || wlv.more_virt_inline_chunks)) {
c = wp->w_p_lcs_chars.ext;
wlv.char_attr = win_hl_attr(wp, HLF_AT);
mb_c = c;
@@ -3061,7 +3091,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
|| (wp->w_p_list && wp->w_p_lcs_chars.eol != NUL
&& wlv.p_extra != at_end_str)
|| (wlv.n_extra != 0
- && (wlv.c_extra != NUL || *wlv.p_extra != NUL)))) {
+ && (wlv.c_extra != NUL || *wlv.p_extra != NUL)) || wlv.more_virt_inline_chunks)) {
bool wrap = wp->w_p_wrap // Wrapping enabled.
&& wlv.filler_todo <= 0 // Not drawing diff filler lines.
&& lcs_eol_one != -1 // Haven't printed the lcs_eol character.
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 771824af71..1c9fdef20d 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -5364,7 +5364,7 @@ theend:
xfree(trans_name);
}
-/// Get the line number from VimL object
+/// Get the line number from Vimscript object
///
/// @note Unlike tv_get_lnum(), this one supports only "$" special string.
///
@@ -5517,9 +5517,9 @@ void get_user_input(const typval_T *const argvars, typval_T *const rettv, const
cmd_silent = cmd_silent_save;
}
-/// Builds a process argument vector from a VimL object (typval_T).
+/// Builds a process argument vector from a Vimscript object (typval_T).
///
-/// @param[in] cmd_tv VimL object
+/// @param[in] cmd_tv Vimscript object
/// @param[out] cmd Returns the command or executable name.
/// @param[out] executable Returns `false` if argv[0] is not executable.
///
@@ -6192,7 +6192,7 @@ int read_blob(FILE *const fd, typval_T *rettv, off_T offset, off_T size_arg)
/// @param[out] len Length of the resulting string or -1 on error.
/// @param[in] endnl If true, the output will end in a newline (if a list).
/// @param[in] crlf If true, list items will be joined with CRLF (if a list).
-/// @returns an allocated string if `tv` represents a VimL string, list, or
+/// @returns an allocated string if `tv` represents a Vimscript string, list, or
/// number; NULL otherwise.
char *save_tv_as_string(typval_T *tv, ptrdiff_t *const len, bool endnl, bool crlf)
FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_ALL
@@ -6338,7 +6338,7 @@ int buf_charidx_to_byteidx(buf_T *buf, linenr_T lnum, int charidx)
return (int)(t - str);
}
-/// Translate a VimL object into a position
+/// Translate a Vimscript object into a position
///
/// Accepts VAR_LIST and VAR_STRING objects. Does not give an error for invalid
/// type.
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index d9c7208c02..fd4108813e 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -8,7 +8,7 @@
-- base For methods: the argument to use as the base argument (1-indexed):
-- base->method()
-- Defaults to BASE_NONE (function cannot be used as a method).
--- func Name of the C function which implements the VimL function. Defaults to
+-- func Name of the C function which implements the Vimscript function. Defaults to
-- `f_{funcname}`.
-- fast Function can run in |api-fast| events. Defaults to false.
diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c
index acef37e0e8..70a629ea91 100644
--- a/src/nvim/eval/decode.c
+++ b/src/nvim/eval/decode.c
@@ -227,7 +227,7 @@ static inline int json_decoder_pop(ValuesStackItem obj, ValuesStack *const stack
///
/// @param[out] ret_tv Address where new special dictionary is saved.
/// @param[in] len Expected number of items to be populated before list
-/// becomes accessible from VimL. It is still valid to
+/// becomes accessible from Vimscript. It is still valid to
/// underpopulate a list, value only controls how many elements
/// will be allocated in advance. @see ListLenSpecials.
///
@@ -645,7 +645,7 @@ parse_json_number_ret:
} \
} while (0)
-/// Convert JSON string into VimL object
+/// Convert JSON string into Vimscript object
///
/// @param[in] buf String to convert. UTF-8 encoding is assumed.
/// @param[in] buf_len Length of the string.
@@ -921,7 +921,7 @@ json_decode_string_ret:
#undef DICT_LEN
-/// Convert msgpack object to a VimL one
+/// Convert msgpack object to a Vimscript one
int msgpack_to_vim(const msgpack_object mobj, typval_T *const rettv)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c
index be0cf79e85..fc9904a2d9 100644
--- a/src/nvim/eval/encode.c
+++ b/src/nvim/eval/encode.c
@@ -3,7 +3,7 @@
/// @file encode.c
///
-/// File containing functions for encoding and decoding VimL values.
+/// File containing functions for encoding and decoding Vimscript values.
///
/// Split out from eval.c.
diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h
index 41e7614fc0..b589b8b13f 100644
--- a/src/nvim/eval/encode.h
+++ b/src/nvim/eval/encode.h
@@ -12,7 +12,7 @@
#include "nvim/garray.h"
#include "nvim/vim.h"
-/// Convert VimL value to msgpack string
+/// Convert Vimscript value to msgpack string
///
/// @param[out] packer Packer to save results in.
/// @param[in] tv Dumped value.
@@ -21,7 +21,7 @@
/// @return OK in case of success, FAIL otherwise.
int encode_vim_to_msgpack(msgpack_packer *packer, typval_T *tv, const char *objname);
-/// Convert VimL value to :echo output
+/// Convert Vimscript value to :echo output
///
/// @param[out] packer Packer to save results in.
/// @param[in] tv Dumped value.
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 788efe1e84..33f1ed51e5 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -8304,7 +8304,7 @@ static void f_synstack(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
}
}
-/// f_system - the VimL system() function
+/// f_system - the Vimscript system() function
static void f_system(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
get_system_output_as_rettv(argvars, rettv, false);
diff --git a/src/nvim/eval/funcs.h b/src/nvim/eval/funcs.h
index 65a95196de..5dab12787b 100644
--- a/src/nvim/eval/funcs.h
+++ b/src/nvim/eval/funcs.h
@@ -9,14 +9,14 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/types.h"
-/// Prototype of C function that implements VimL function
+/// Prototype of C function that implements Vimscript function
typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, EvalFuncData data);
/// Special flags for base_arg @see EvalFuncDef
#define BASE_NONE 0 ///< Not a method (no base argument).
#define BASE_LAST UINT8_MAX ///< Use the last argument as the method base.
-/// Structure holding VimL function definition
+/// Structure holding Vimscript function definition
typedef struct {
char *name; ///< Name of the function.
uint8_t min_argc; ///< Minimal number of arguments.
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c
index a891ba1570..bae9880377 100644
--- a/src/nvim/eval/typval.c
+++ b/src/nvim/eval/typval.c
@@ -170,7 +170,7 @@ void tv_list_watch_fix(list_T *const l, const listitem_T *const item)
/// Caller should take care of the reference count.
///
/// @param[in] len Expected number of items to be populated before list
-/// becomes accessible from VimL. It is still valid to
+/// becomes accessible from Vimscript. It is still valid to
/// underpopulate a list, value only controls how many elements
/// will be allocated in advance. Currently does nothing.
/// @see ListLenSpecials.
@@ -398,7 +398,7 @@ void tv_list_insert(list_T *const l, listitem_T *const ni, listitem_T *const ite
}
}
-/// Insert VimL value into a list
+/// Insert Vimscript value into a list
///
/// @param[out] l List to insert to.
/// @param[in,out] tv Value to insert. Is copied (@see tv_copy()) to an
@@ -434,7 +434,7 @@ void tv_list_append(list_T *const l, listitem_T *const item)
item->li_next = NULL;
}
-/// Append VimL value to the end of list
+/// Append Vimscript value to the end of list
///
/// @param[out] l List to append to.
/// @param[in,out] tv Value to append. Is copied (@see tv_copy()) to an
@@ -3086,7 +3086,7 @@ void f_list2blob(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
///
/// @param[out] ret_tv Structure where list is saved.
/// @param[in] len Expected number of items to be populated before list
-/// becomes accessible from VimL. It is still valid to
+/// becomes accessible from Vimscript. It is still valid to
/// underpopulate a list, value only controls how many elements
/// will be allocated in advance. @see ListLenSpecials.
///
@@ -3538,7 +3538,7 @@ void tv_clear(typval_T *const tv)
//{{{3 Free
-/// Free allocated VimL object and value stored inside
+/// Free allocated Vimscript object and value stored inside
///
/// @param tv Object to free.
void tv_free(typval_T *tv)
@@ -3716,7 +3716,7 @@ void tv_item_lock(typval_T *const tv, const int deep, const bool lock, const boo
recurse--;
}
-/// Check whether VimL value is locked itself or refers to a locked container
+/// Check whether Vimscript value is locked itself or refers to a locked container
///
/// @warning Fixed container is not the same as locked.
///
@@ -3815,7 +3815,7 @@ bool value_check_lock(VarLockStatus lock, const char *name, size_t name_len)
static int tv_equal_recurse_limit;
-/// Compare two VimL values
+/// Compare two Vimscript values
///
/// Like "==", but strings and numbers are different, as well as floats and
/// numbers.
@@ -4011,7 +4011,7 @@ static const char *const str_errors[] = {
#undef FUNC_ERROR
-/// Check that given value is a VimL String or can be "cast" to it.
+/// Check that given value is a Vimscript String or can be "cast" to it.
///
/// Error messages are compatible with tv_get_string_chk() previously used for
/// the same purpose.
@@ -4044,7 +4044,7 @@ bool tv_check_str(const typval_T *const tv)
//{{{2 Get
-/// Get the number value of a VimL object
+/// Get the number value of a Vimscript object
///
/// @note Use tv_get_number_chk() if you need to determine whether there was an
/// error.
@@ -4060,7 +4060,7 @@ varnumber_T tv_get_number(const typval_T *const tv)
return tv_get_number_chk(tv, &error);
}
-/// Get the number value of a VimL object
+/// Get the number value of a Vimscript object
///
/// @param[in] tv Object to get value from.
/// @param[out] ret_error If type error occurred then `true` will be written
@@ -4119,7 +4119,7 @@ varnumber_T tv_get_bool_chk(const typval_T *const tv, bool *const ret_error)
return tv_get_number_chk(tv, ret_error);
}
-/// Get the line number from VimL object
+/// Get the line number from Vimscript object
///
/// @param[in] tv Object to get value from. Is expected to be a number or
/// a special string like ".", "$", … (works with current buffer
@@ -4142,7 +4142,7 @@ linenr_T tv_get_lnum(const typval_T *const tv)
return lnum;
}
-/// Get the floating-point value of a VimL object
+/// Get the floating-point value of a Vimscript object
///
/// Raises an error if object is not number or floating-point.
///
@@ -4385,7 +4385,7 @@ int tv_check_for_list_or_blob_arg(const typval_T *const args, const int idx)
return OK;
}
-/// Get the string value of a "stringish" VimL object.
+/// Get the string value of a "stringish" Vimscript object.
///
/// @param[in] tv Object to get value of.
/// @param buf Buffer used to hold numbers and special variables converted to
@@ -4430,7 +4430,7 @@ const char *tv_get_string_buf_chk(const typval_T *const tv, char *const buf)
return NULL;
}
-/// Get the string value of a "stringish" VimL object.
+/// Get the string value of a "stringish" Vimscript object.
///
/// @warning For number and special values it uses a single, static buffer. It
/// may be used only once, next call to tv_get_string may reuse it. Use
@@ -4449,7 +4449,7 @@ const char *tv_get_string_chk(const typval_T *const tv)
return tv_get_string_buf_chk(tv, mybuf);
}
-/// Get the string value of a "stringish" VimL object.
+/// Get the string value of a "stringish" Vimscript object.
///
/// @warning For number and special values it uses a single, static buffer. It
/// may be used only once, next call to tv_get_string may reuse it. Use
@@ -4471,7 +4471,7 @@ const char *tv_get_string(const typval_T *const tv)
return tv_get_string_buf((typval_T *)tv, mybuf);
}
-/// Get the string value of a "stringish" VimL object.
+/// Get the string value of a "stringish" Vimscript object.
///
/// @note tv_get_string_chk() and tv_get_string_buf_chk() are similar, but
/// return NULL on error.
diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h
index e7b2499346..0b42a473cf 100644
--- a/src/nvim/eval/typval.h
+++ b/src/nvim/eval/typval.h
@@ -312,7 +312,7 @@ static inline void tv_blob_set(blob_T *const blob, int idx, uint8_t c)
((uint8_t *)blob->bv_ga.ga_data)[idx] = c;
}
-/// Initialize VimL object
+/// Initialize Vimscript object
///
/// Initializes to unlocked VAR_UNKNOWN object.
///
@@ -424,7 +424,7 @@ static inline bool tv_get_float_chk(const typval_T *tv, float_T *ret_f)
///
/// Raises an error if object is not number or floating-point.
///
-/// @param[in] tv VimL object to get value from.
+/// @param[in] tv Vimscript object to get value from.
/// @param[out] ret_f Location where resulting float is stored.
///
/// @return true in case of success, false if tv is not a number or float.
diff --git a/src/nvim/eval/typval_defs.h b/src/nvim/eval/typval_defs.h
index 767603ac0e..4099877539 100644
--- a/src/nvim/eval/typval_defs.h
+++ b/src/nvim/eval/typval_defs.h
@@ -10,7 +10,7 @@
#include "nvim/pos.h"
#include "nvim/types.h"
-/// Type used for VimL VAR_NUMBER values
+/// Type used for Vimscript VAR_NUMBER values
typedef int64_t varnumber_T;
typedef uint64_t uvarnumber_T;
@@ -100,7 +100,7 @@ typedef enum {
VAR_FIXED = 2, ///< Locked forever.
} VarLockStatus;
-/// VimL variable types, for use in typval_T.v_type
+/// Vimscript variable types, for use in typval_T.v_type
typedef enum {
VAR_UNKNOWN = 0, ///< Unknown (unspecified) value.
VAR_NUMBER, ///< Number, .v_number is used.
diff --git a/src/nvim/eval/typval_encode.h b/src/nvim/eval/typval_encode.h
index 171b0417d0..cf01926030 100644
--- a/src/nvim/eval/typval_encode.h
+++ b/src/nvim/eval/typval_encode.h
@@ -30,7 +30,7 @@ typedef enum {
kMPConvPartialEnd, ///< Already converted everything.
} MPConvPartialStage;
-/// Structure representing current VimL to messagepack conversion state
+/// Structure representing current Vimscript to messagepack conversion state
typedef struct {
MPConvStackValType type; ///< Type of the stack entry.
typval_T *tv; ///< Currently converted typval_T.
@@ -60,7 +60,7 @@ typedef struct {
} data; ///< Data to convert.
} MPConvStackVal;
-/// Stack used to convert VimL values to messagepack.
+/// Stack used to convert Vimscript values to messagepack.
typedef kvec_withinit_t(MPConvStackVal, 8) MPConvStack;
// Defines for MPConvStack
diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c
index 0096d0e11e..262d141b26 100644
--- a/src/nvim/event/multiqueue.c
+++ b/src/nvim/event/multiqueue.c
@@ -40,7 +40,7 @@
//
// The main reason for this queue hierarchy is to allow focusing on a single
// event emitter while blocking the main loop. For example, if the `jobwait`
-// VimL function is called on job1, the main loop will temporarily stop polling
+// Vimscript function is called on job1, the main loop will temporarily stop polling
// the event loop queue and poll job1 queue instead. Same with channels, when
// calling `rpcrequest` we want to temporarily stop processing events from
// other sources and focus on a specific channel.
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 77b09a5f73..969023b70d 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -791,7 +791,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent, bool clea
// Redraw the statusline in case it uses the current mode using the mode()
// function.
- if (!cmd_silent) {
+ if (!cmd_silent && !exmode_active) {
bool found_one = false;
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h
index 4b434f6771..57e5766f67 100644
--- a/src/nvim/func_attr.h
+++ b/src/nvim/func_attr.h
@@ -222,9 +222,9 @@
# define FUNC_API_FAST
/// Internal C function not exposed in the RPC API.
# define FUNC_API_NOEXPORT
-/// API function not exposed in VimL/eval.
+/// API function not exposed in Vimscript/eval.
# define FUNC_API_REMOTE_ONLY
-/// API function not exposed in VimL/remote.
+/// API function not exposed in Vimscript/remote.
# define FUNC_API_LUA_ONLY
/// API function checked textlock.
# define FUNC_API_CHECK_TEXTLOCK
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index 48e4479c58..da43f678bc 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -231,6 +231,7 @@ static const char *highlight_init_both[] = {
"default link DiagnosticSignOk DiagnosticOk",
"default DiagnosticDeprecated cterm=strikethrough gui=strikethrough guisp=Red",
"default link DiagnosticUnnecessary Comment",
+ "default link LspInlayHint NonText",
// Text
"default link @text.literal Comment",
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c
index d6860fff30..8285c0c2b8 100644
--- a/src/nvim/insexpand.c
+++ b/src/nvim/insexpand.c
@@ -2432,7 +2432,7 @@ theend:
}
}
-/// Add a match to the list of matches from VimL object
+/// Add a match to the list of matches from Vimscript object
///
/// @param[in] tv Object to get matches from.
/// @param[in] dir Completion direction.
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c
index 9ff03bc67d..5b3b4dbe08 100644
--- a/src/nvim/lua/converter.c
+++ b/src/nvim/lua/converter.c
@@ -183,7 +183,7 @@ typedef struct {
int idx; ///< Container index (used to detect self-referencing structures).
} TVPopStackItem;
-/// Convert lua object to VimL typval_T
+/// Convert lua object to Vimscript typval_T
///
/// Should pop exactly one value from lua stack.
///
@@ -601,7 +601,7 @@ static bool typval_conv_special = false;
#undef TYPVAL_ENCODE_CONV_RECURSE
#undef TYPVAL_ENCODE_ALLOW_SPECIALS
-/// Convert VimL typval_T to lua value
+/// Convert Vimscript typval_T to lua value
///
/// Should leave single value in lua stack. May only fail if lua failed to grow
/// stack.
@@ -628,8 +628,7 @@ bool nlua_push_typval(lua_State *lstate, typval_T *const tv, bool special)
/// Push value which is a type index
///
-/// Used for all “typed” tables: i.e. for all tables which represent VimL
-/// values.
+/// Used for all “typed” tables: i.e. for all tables which represent Vimscript values.
static inline void nlua_push_type_idx(lua_State *lstate)
FUNC_ATTR_NONNULL_ALL
{
@@ -657,7 +656,7 @@ static inline void nlua_push_type(lua_State *lstate, ObjectType type)
lua_pushnumber(lstate, (lua_Number)type);
}
-/// Create lua table which has an entry that determines its VimL type
+/// Create Lua table which has an entry that determines its Vimscript type
///
/// @param[out] lstate Lua state.
/// @param[in] narr Number of “array” entries to be populated later.
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 35540de99e..ed84e2a601 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -1487,7 +1487,7 @@ int nlua_source_using_linegetter(LineGetter fgetline, void *cookie, char *name)
/// Call a LuaCallable given some typvals
///
-/// Used to call any lua callable passed from Lua into VimL
+/// Used to call any Lua callable passed from Lua into Vimscript.
///
/// @param[in] lstate Lua State
/// @param[in] lua_cb Lua Callable
@@ -1622,7 +1622,7 @@ bool nlua_is_deferred_safe(void)
///
/// Used for :lua.
///
-/// @param eap VimL command being run.
+/// @param eap Vimscript command being run.
void ex_lua(exarg_T *const eap)
FUNC_ATTR_NONNULL_ALL
{
@@ -1654,7 +1654,7 @@ void ex_lua(exarg_T *const eap)
///
/// Used for :luado.
///
-/// @param eap VimL command being run.
+/// @param eap Vimscript command being run.
void ex_luado(exarg_T *const eap)
FUNC_ATTR_NONNULL_ALL
{
@@ -1735,7 +1735,7 @@ void ex_luado(exarg_T *const eap)
///
/// Used for :luafile.
///
-/// @param eap VimL command being run.
+/// @param eap Vimscript command being run.
void ex_luafile(exarg_T *const eap)
FUNC_ATTR_NONNULL_ALL
{
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 90dac4d3bf..d42e0ed24f 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -7276,7 +7276,7 @@ void f_getqflist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
get_qf_loc_list(true, NULL, &argvars[0], rettv);
}
-/// Create quickfix/location list from VimL values
+/// Create quickfix/location list from Vimscript values
///
/// Used by `setqflist()` and `setloclist()` functions. Accepts invalid
/// args argument in which case errors out, including VAR_UNKNOWN parameters.
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c
index 70d7261973..0503c08af9 100644
--- a/src/nvim/runtime.c
+++ b/src/nvim/runtime.c
@@ -1770,7 +1770,7 @@ static FILE *fopen_noinh_readbin(char *filename)
return fdopen(fd_tmp, READBIN);
}
-/// Concatenate VimL line if it starts with a line continuation into a growarray
+/// Concatenate Vimscript line if it starts with a line continuation into a growarray
/// (excluding the continuation chars and leading whitespace)
///
/// @note Growsize of the growarray may be changed to speed up concatenations!
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index db911f4bfd..f8c448dce0 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -3396,7 +3396,7 @@ static ShaDaReadResult msgpack_read_uint64(ShaDaReadDef *const sd_reader, const
if (msgpack_to_vim(obj, &adtv) == FAIL \
|| adtv.v_type != VAR_DICT) { \
semsg(_(READERR(name, \
- "cannot be converted to a VimL dictionary")), \
+ "cannot be converted to a Vimscript dictionary")), \
initial_fpos); \
ga_clear(&ad_ga); \
tv_clear(&adtv); \
@@ -3420,7 +3420,7 @@ static ShaDaReadResult msgpack_read_uint64(ShaDaReadDef *const sd_reader, const
}; \
typval_T aetv; \
if (msgpack_to_vim(obj, &aetv) == FAIL) { \
- semsg(_(READERR(name, "cannot be converted to a VimL list")), \
+ semsg(_(READERR(name, "cannot be converted to a Vimscript list")), \
initial_fpos); \
tv_clear(&aetv); \
goto shada_read_next_item_error; \
@@ -3819,7 +3819,7 @@ shada_read_next_item_start:
} else if (msgpack_to_vim(unpacked.data.via.array.ptr[1],
&(entry->data.global_var.value)) == FAIL) {
semsg(_(READERR("variable", "has value that cannot "
- "be converted to the VimL value")), initial_fpos);
+ "be converted to the Vimscript value")), initial_fpos);
goto shada_read_next_item_error;
}
break;
diff --git a/src/nvim/strings.c b/src/nvim/strings.c
index ada3a45d60..6fe2fd8ff3 100644
--- a/src/nvim/strings.c
+++ b/src/nvim/strings.c
@@ -500,13 +500,10 @@ static const char *const e_printf =
/// Get number argument from idxp entry in tvs
///
-/// Will give an error message for VimL entry with invalid type or for
-/// insufficient entries.
+/// Will give an error message for Vimscript entry with invalid type or for insufficient entries.
///
-/// @param[in] tvs List of VimL values. List is terminated by VAR_UNKNOWN
-/// value.
-/// @param[in,out] idxp Index in a list. Will be incremented. Indexing starts
-/// at 1.
+/// @param[in] tvs List of Vimscript values. List is terminated by VAR_UNKNOWN value.
+/// @param[in,out] idxp Index in a list. Will be incremented. Indexing starts at 1.
///
/// @return Number value or 0 in case of error.
static varnumber_T tv_nr(typval_T *tvs, int *idxp)
@@ -530,10 +527,10 @@ static varnumber_T tv_nr(typval_T *tvs, int *idxp)
/// Get string argument from idxp entry in tvs
///
-/// Will give an error message for VimL entry with invalid type or for
+/// Will give an error message for Vimscript entry with invalid type or for
/// insufficient entries.
///
-/// @param[in] tvs List of VimL values. List is terminated by VAR_UNKNOWN
+/// @param[in] tvs List of Vimscript values. List is terminated by VAR_UNKNOWN
/// value.
/// @param[in,out] idxp Index in a list. Will be incremented.
/// @param[out] tofree If the idxp entry in tvs is not a String or a Number,
@@ -564,7 +561,7 @@ static const char *tv_str(typval_T *tvs, int *idxp, char **const tofree)
/// Get pointer argument from the next entry in tvs
///
-/// Will give an error message for VimL entry with invalid type or for
+/// Will give an error message for Vimscript entry with invalid type or for
/// insufficient entries.
///
/// @param[in] tvs List of typval_T values.
@@ -595,11 +592,10 @@ static const void *tv_ptr(const typval_T *const tvs, int *const idxp)
/// Get float argument from idxp entry in tvs
///
-/// Will give an error message for VimL entry with invalid type or for
+/// Will give an error message for Vimscript entry with invalid type or for
/// insufficient entries.
///
-/// @param[in] tvs List of VimL values. List is terminated by VAR_UNKNOWN
-/// value.
+/// @param[in] tvs List of Vimscript values. List is terminated by VAR_UNKNOWN value.
/// @param[in,out] idxp Index in a list. Will be incremented.
///
/// @return Floating-point value or zero in case of error.
@@ -727,7 +723,7 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap)
/// @param[in] str_m String length.
/// @param[in] fmt String format.
/// @param[in] ap Values that should be formatted. Ignored if tvs is not NULL.
-/// @param[in] tvs Values that should be formatted, for printf() VimL
+/// @param[in] tvs Values that should be formatted, for printf() Vimscript
/// function. Must be NULL in other cases.
///
/// @return Number of bytes excluding NUL byte that would be written to the
diff --git a/src/nvim/types.h b/src/nvim/types.h
index ca0ae16a66..3a05223023 100644
--- a/src/nvim/types.h
+++ b/src/nvim/types.h
@@ -18,7 +18,7 @@ typedef int handle_T;
// absent callback etc.
typedef int LuaRef;
-/// Type used for VimL VAR_FLOAT values
+/// Type used for Vimscript VAR_FLOAT values
typedef double float_T;
typedef struct MsgpackRpcRequestHandler MsgpackRpcRequestHandler;
diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c
index 830d8c5f34..b53508bc6c 100644
--- a/src/nvim/viml/parser/expressions.c
+++ b/src/nvim/viml/parser/expressions.c
@@ -1,10 +1,10 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
-/// VimL expression parser
+/// Vimscript expression parser
// Planned incompatibilities (to be included into vim_diff.txt when this parser
-// will be an actual part of VimL evaluation process):
+// will be an actual part of Vimscript evaluation process):
//
// 1. Expressions are first fully parsed and only then executed. This means
// that while ":echo [system('touch abc')" will create file "abc" in Vim and
@@ -89,7 +89,7 @@ typedef enum {
/// Parse type: what is being parsed currently
typedef enum {
- /// Parsing regular VimL expression
+ /// Parsing regular Vimscript expression
kEPTExpr = 0,
/// Parsing lambda arguments
///
@@ -171,7 +171,7 @@ static inline float_T scale_number(const float_T num, const uint8_t base,
return ret;
}
-/// Get next token for the VimL expression input
+/// Get next token for the Vimscript expression input
///
/// @param pstate Parser state.
/// @param[in] flags Flags, @see LexExprFlags.
@@ -1168,7 +1168,7 @@ static struct {
// represented as "list(comma(a, comma(b, comma(c, d))))" then if it is
// "list(comma(comma(comma(a, b), c), d))" in which case you will need to
// traverse all three comma() structures. And with comma operator (including
- // actual comma operator from C which is not present in VimL) nobody cares
+ // actual comma operator from C which is not present in Vimscript) nobody cares
// about associativity, only about order of execution.
[kExprNodeComma] = { kEOpLvlComma, kEOpAssRight },
@@ -1915,7 +1915,7 @@ static const uint8_t base_to_prefix_length[] = {
[16] = 2,
};
-/// Parse one VimL expression
+/// Parse one Vimscript expression
///
/// @param pstate Parser state.
/// @param[in] flags Additional flags, see ExprParserFlags