Skip to content

Commit

Permalink
Add support for :verbose set options + bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shadmansaleh committed Jul 14, 2021
1 parent aac37f2 commit e2db8be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/nvim/ex_cmds2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2901,8 +2901,7 @@ int do_source(char_u *fname, int check_other, int is_vimrc)
save_funccal(&funccalp_entry);

const sctx_T save_current_sctx = current_sctx;
si = get_current_script_id(fname_exp, &current_sctx);
fname_exp = vim_strsave(si->sn_name); // used for autocmd
si = get_current_script_id(vim_strsave(fname_exp), &current_sctx);

if (l_do_profiling == PROF_YES) {
bool forceit = false;
Expand Down
14 changes: 7 additions & 7 deletions src/nvim/lua/executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,21 +1811,21 @@ sctx_T *nlua_get_sctx(void)
retval->sc_lnum = -1;
lua_Debug *info = (lua_Debug *)xmalloc(sizeof(lua_Debug));
char *runtime_path = vim_getenv("VIMRUNTIME");
bool valid_location = false;
for (int depth = 1; !valid_location; depth++) {
if (lua_getstack(lstate, depth, info) == 0) {
for (int level = 1; true; level++) {
if (lua_getstack(lstate, level, info) != 1) {
goto cleanup;
}
if (lua_getinfo(lstate, "nSl", info) == 0) {
goto cleanup;
}

if (info->what[0] != 'C' && strstr(info->source, runtime_path) == NULL) {
break;
if (info->what[0] == 'C' || info->source[0] != '@'
|| strstr(info->source, runtime_path) == info->source + 1) {
continue;
}
xfree(info);
break;
}
get_current_script_id((const char_u *)info->source + 1, retval);
get_current_script_id((const char_u *)fix_fname(info->source + 1), retval);
retval->sc_lnum = info->currentline;

cleanup:
Expand Down
1 change: 1 addition & 0 deletions src/nvim/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -3760,6 +3760,7 @@ static void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx)
{
int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
int indir = (int)options[opt_idx].indir;
nlua_set_sctx(&script_ctx);
const LastSet last_set = {
.script_ctx = {
script_ctx.sc_sid,
Expand Down

0 comments on commit e2db8be

Please sign in to comment.