aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/stdlib.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-23 15:59:37 +0800
committerGitHub <noreply@github.com>2023-09-23 15:59:37 +0800
commit5331d5772ffbbdb3635d0a4b41306817097e86de (patch)
tree259eea5584b6e0aa2452da474db434eda521cc08 /src/nvim/lua/stdlib.c
parentc0a29931e29bbb40650df01918826cdb64e8fc32 (diff)
downloadrneovim-5331d5772ffbbdb3635d0a4b41306817097e86de.tar.gz
rneovim-5331d5772ffbbdb3635d0a4b41306817097e86de.tar.bz2
rneovim-5331d5772ffbbdb3635d0a4b41306817097e86de.zip
fix(lua): show error message when failing to set variable (#25321)
Diffstat (limited to 'src/nvim/lua/stdlib.c')
-rw-r--r--src/nvim/lua/stdlib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c
index 4f9677650f..8f1b5c7b86 100644
--- a/src/nvim/lua/stdlib.c
+++ b/src/nvim/lua/stdlib.c
@@ -359,6 +359,9 @@ int nlua_setvar(lua_State *lstate)
Error err = ERROR_INIT;
dictitem_T *di = dict_check_writable(dict, key, del, &err);
if (ERROR_SET(&err)) {
+ nlua_push_errstr(lstate, "%s", err.msg);
+ api_clear_error(&err);
+ lua_error(lstate);
return 0;
}