[vim/vim] Cannot read working directory from non-current tab (Issue #9832)

5 views
Skip to first unread message

Sergey Vlasov

unread,
Feb 23, 2022, 8:24:40 AM2/23/22
to vim/vim, Subscribed

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

When working with multiple tab pages, it is impossible to tell if :tcd was used in a tab, without switching to that tab first.

Describe the solution you'd like
There could be t:cwd and w:cwd variables that would be synchronized with :tcd and :lcd.

Describe alternatives you've considered

  • getcwd(-1, <tabnr>) returns the working directory for specific tab page but it is impossible to tell if the value is global or local.
  • :verbose pwd can tell is the value is local or global but the command works only for the current tab. One has to switch to another tab and then parse the output from :verbose pwd.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9832@github.com>

matveyt

unread,
Feb 23, 2022, 8:48:54 AM2/23/22
to vim/vim, Subscribed

it is impossible to tell if the value is global or local.

:echo haslocaldir(-1, tabno)


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9832/1048800062@github.com>

Sergey Vlasov

unread,
Feb 23, 2022, 8:51:20 AM2/23/22
to vim/vim, Subscribed

Thank you. Couldn't figure it out myself.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9832/1048802085@github.com>

Sergey Vlasov

unread,
Feb 23, 2022, 8:51:22 AM2/23/22
to vim/vim, Subscribed

Closed #9832.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/9832/issue_event/6125161606@github.com>

Yegappan Lakshmanan

unread,
Feb 23, 2022, 9:27:00 AM2/23/22
to vim_dev, reply+ACY5DGBYM6KOD26YXQ...@reply.github.com, vim/vim, Subscribed
Hi,

On Wed, Feb 23, 2022 at 5:24 AM Sergey Vlasov <vim-dev...@256bit.org> wrote:

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

When working with multiple tab pages, it is impossible to tell if :tcd was used in a tab, without switching to that tab first.

Describe the solution you'd like
There could be t:cwd and w:cwd variables that would be synchronized with :tcd and :lcd.

Describe alternatives you've considered

  • getcwd(-1, <tabnr>) returns the working directory for specific tab page but it is impossible to tell if the value is global or local.
  • :verbose pwd can tell is the value is local or global but the command works only for the current tab. One has to switch to another tab and then parse the output from :verbose pwd.


Did you try using the haslocaldir() function? This function will return 2 if a tabpage
has a  tab-local directory.

- Yegappan

 

vim-dev ML

unread,
Feb 23, 2022, 9:27:16 AM2/23/22
to vim/vim, vim-dev ML, Your activity

Hi,

On Wed, Feb 23, 2022 at 5:24 AM Sergey Vlasov ***@***.***>
wrote:

> *Is your feature request about something that is currently impossible or
> hard to do? Please describe the problem.*

>
> When working with multiple tab pages, it is impossible to tell if :tcd
> was used in a tab, without switching to that tab first.
>
> *Describe the solution you'd like*

> There could be t:cwd and w:cwd variables that would be synchronized with
> :tcd and :lcd.
>
> *Describe alternatives you've considered*
>
> - getcwd(-1, <tabnr>) returns the working directory for specific tab

> page but it is impossible to tell if the value is global or local.
> - :verbose pwd can tell is the value is local or global but the

> command works only for the current tab. One has to switch to another tab
> and then parse the output from :verbose pwd.
>
>
> Did you try using the haslocaldir() function? This function will return 2
if a tabpage
has a tab-local directory.

- Yegappan


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9832/1048836360@github.com>

Sergey Vlasov

unread,
Feb 23, 2022, 9:29:13 AM2/23/22
to vim/vim, vim-dev ML, Comment

Yes, haslocaldir() solves the problem.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you commented.Message ID: <vim/vim/issues/9832/1048838412@github.com>

Reply all
Reply to author
Forward
0 new messages