mirror of
https://github.com/neovim/neovim.git
synced 2026-04-22 23:35:32 +00:00
vim-patch:8.2.4603: sourcing buffer lines is too complicated
Problem: Sourcing buffer lines is too complicated.
Solution: Simplify the code. Make it possible to source Vim9 script lines.
(Yegappan Lakshmanan, closes vim/vim#9974)
85b43c6cb7
This commit changes the behavior of sourcing buffer lines to always have
a script ID, although sourcing the same buffer always produces the same
script ID.
vim-patch:9.1.0372: Calling CLEAR_FIELD() on the same struct twice
Problem: Calling CLEAR_FIELD() on the same struct twice.
Solution: Remove the second CLEAR_FIELD(). Move the assignment of
cookie.sourceing_lnum (zeertzjq).
closes: vim/vim#14627
f68517c167
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -1461,19 +1461,12 @@ static void nlua_typval_exec(const char *lcmd, size_t lcmd_len, const char *name
|
||||
}
|
||||
}
|
||||
|
||||
void nlua_source_str(const char *code, char *name)
|
||||
void nlua_exec_ga(garray_T *ga, char *name)
|
||||
{
|
||||
const sctx_T save_current_sctx = current_sctx;
|
||||
current_sctx.sc_sid = SID_STR;
|
||||
current_sctx.sc_seq = 0;
|
||||
current_sctx.sc_lnum = 0;
|
||||
estack_push(ETYPE_SCRIPT, name, 0);
|
||||
|
||||
char *code = ga_concat_strings_sep(ga, "\n");
|
||||
size_t len = strlen(code);
|
||||
nlua_typval_exec(code, len, name, NULL, 0, false, NULL);
|
||||
|
||||
estack_pop();
|
||||
current_sctx = save_current_sctx;
|
||||
xfree(code);
|
||||
}
|
||||
|
||||
/// Call a LuaCallable given some typvals
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/garray_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/macros_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/usercmd.h" // IWYU pragma: keep
|
||||
|
||||
Reference in New Issue
Block a user