mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
fix: runtimepath always updates lua package.path
This commit is contained in:
@@ -543,6 +543,14 @@ static lua_State *nlua_enter(void)
|
||||
return lstate;
|
||||
}
|
||||
|
||||
/// Force an update of lua's package paths if runtime path has changed.
|
||||
bool nlua_update_package_path(void)
|
||||
{
|
||||
lua_State *const lstate = nlua_enter();
|
||||
|
||||
return !!lstate;
|
||||
}
|
||||
|
||||
static void nlua_print_event(void **argv)
|
||||
{
|
||||
char *str = argv[0];
|
||||
|
@@ -80,6 +80,7 @@
|
||||
#ifdef WIN32
|
||||
# include "nvim/os/pty_conpty_win.h"
|
||||
#endif
|
||||
#include "nvim/lua/executor.h"
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/os/lang.h"
|
||||
@@ -3344,6 +3345,10 @@ ambw_end:
|
||||
if (!parse_winhl_opt(curwin)) {
|
||||
errmsg = e_invarg;
|
||||
}
|
||||
} else if (varp == &p_rtp) { // 'runtimepath'
|
||||
if (!nlua_update_package_path()) {
|
||||
errmsg = (char_u *)N_("E970: Failed to initialize lua interpreter");
|
||||
}
|
||||
} else {
|
||||
// Options that are a list of flags.
|
||||
p = NULL;
|
||||
|
Reference in New Issue
Block a user