mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 07:48:18 +00:00
tcd: Use user-provided tab page for getcwd()
/haslocaldir()
The initial implementation for `:tcd` always used `curtab` to find the specified window. This would result in either inaccurate information or an unexpected error (e.g., when there are more windows in the user-specified tab page vs. the current tab page).
This commit is contained in:
@@ -9954,7 +9954,7 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
|
||||
if (scope_number[kCdScopeWindow] > 0) {
|
||||
win = find_win_by_nr(&argvars[0], curtab);
|
||||
win = find_win_by_nr(&argvars[0], tp);
|
||||
if (!win) {
|
||||
EMSG(_("E5002: Cannot find window number."));
|
||||
return;
|
||||
@@ -10897,7 +10897,7 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
|
||||
if (scope_number[kCdScopeWindow] > 0) {
|
||||
win = find_win_by_nr(&argvars[0], curtab);
|
||||
win = find_win_by_nr(&argvars[0], tp);
|
||||
if (!win) {
|
||||
EMSG(_("E5002: Cannot find window number."));
|
||||
return;
|
||||
|
Reference in New Issue
Block a user