mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
tabpage_S: Name tp_localdir per convention.
This commit is contained in:
parent
c8f0f8fea6
commit
82117da5df
@ -825,8 +825,7 @@ struct tabpage_S {
|
||||
frame_T *(tp_snapshot[SNAP_COUNT]); ///< window layout snapshots
|
||||
dictitem_T tp_winvar; ///< variable for "t:" Dictionary
|
||||
dict_T *tp_vars; ///< internal variables, local to tab page
|
||||
char_u *localdir; ///< Absolute path of local directory or
|
||||
///< NULL
|
||||
char_u *tp_localdir; ///< Absolute path of local CWD or NULL
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -10901,7 +10901,7 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
}
|
||||
case kCdScopeTab: // FALLTHROUGH
|
||||
assert(tp);
|
||||
from = tp->localdir;
|
||||
from = tp->tp_localdir;
|
||||
if (from) {
|
||||
break;
|
||||
}
|
||||
@ -12015,7 +12015,7 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
break;
|
||||
case kCdScopeTab:
|
||||
assert(tp);
|
||||
rettv->vval.v_number = tp->localdir ? 1 : 0;
|
||||
rettv->vval.v_number = tp->tp_localdir ? 1 : 0;
|
||||
break;
|
||||
case kCdScopeGlobal:
|
||||
// The global scope never has a local directory
|
||||
|
@ -6949,8 +6949,8 @@ void post_chdir(CdScope scope)
|
||||
|
||||
// Overwrite the local directory of the current tab page for `cd` and `tcd`
|
||||
if (scope >= kCdScopeTab) {
|
||||
xfree(curtab->localdir);
|
||||
curtab->localdir = NULL;
|
||||
xfree(curtab->tp_localdir);
|
||||
curtab->tp_localdir = NULL;
|
||||
}
|
||||
|
||||
if (scope < kCdScopeGlobal) {
|
||||
@ -6970,7 +6970,7 @@ void post_chdir(CdScope scope)
|
||||
case kCdScopeTab:
|
||||
// Remember this local directory for the tab page.
|
||||
if (os_dirname(NameBuff, MAXPATHL) == OK) {
|
||||
curtab->localdir = vim_strsave(NameBuff);
|
||||
curtab->tp_localdir = vim_strsave(NameBuff);
|
||||
}
|
||||
break;
|
||||
case kCdScopeWindow:
|
||||
|
@ -2998,8 +2998,7 @@ void free_tabpage(tabpage_T *tp)
|
||||
hash_init(&tp->tp_vars->dv_hashtab);
|
||||
unref_var_dict(tp->tp_vars);
|
||||
|
||||
|
||||
xfree(tp->localdir); // Free tab-local working directory
|
||||
xfree(tp->tp_localdir);
|
||||
xfree(tp);
|
||||
}
|
||||
|
||||
@ -3025,7 +3024,7 @@ int win_new_tabpage(int after, char_u *filename)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
newtp->localdir = tp->localdir ? vim_strsave(tp->localdir) : NULL;
|
||||
newtp->tp_localdir = tp->tp_localdir ? vim_strsave(tp->tp_localdir) : NULL;
|
||||
|
||||
curtab = newtp;
|
||||
|
||||
@ -3617,9 +3616,9 @@ static void win_enter_ext(win_T *wp, bool undo_sync, int curwin_invalid,
|
||||
curwin->w_cursor.coladd = 0;
|
||||
changed_line_abv_curs(); /* assume cursor position needs updating */
|
||||
|
||||
// The new directory is either the local directory of the window, of the tab
|
||||
// or NULL.
|
||||
char_u *new_dir = curwin->w_localdir ? curwin->w_localdir : curtab->localdir;
|
||||
// The new directory is either the local directory of the window, tab or NULL.
|
||||
char_u *new_dir = curwin->w_localdir
|
||||
? curwin->w_localdir : curtab->tp_localdir;
|
||||
|
||||
if (new_dir) {
|
||||
// Window/tab has a local directory: Save current directory as global
|
||||
|
Loading…
Reference in New Issue
Block a user