Hi,

On Tue, Jan 11, 2022 at 7:21 AM Evgeni Chasnovski <[email protected]>
wrote:

> Steps to reproduce
>
> For :lcd:
>
>    1. vim --clean
>    2. :lcd .
>    3. :botright new
>    4. :verbose pwd
>
> For :tcd:
>
>    1. vim --clean
>    2. :tcd .
>    3. :tabnew
>    4. :verbose pwd
>
> Expected behaviour
>
> In both cases I expected to have [global] current directory to be active
> instead of [window] and [tabpage]. My reasoning:
>

When you open a window/tabpage, the new window/tabpage inherits the current
directory of the previous
window/tabpage. So if the previous window was using a window-local
directory, then the new window will
also use the same window-local directory.

Regards,
Yegappan


>
>    - Documentation states that change will be applied to *current* window
>    and tab respectively. Sources: for lcd
>    
> <https://github.com/vim/vim/blob/0bbca540f7377889e2154aa5731f6eeffcb5c0cc/runtime/doc/editing.txt#L1351-L1354>,
>    for tcd
>    
> <https://github.com/vim/vim/blob/0bbca540f7377889e2154aa5731f6eeffcb5c0cc/runtime/doc/editing.txt#L1337-L1341>
>    .
>    - A more detailed description
>    
> <https://github.com/vim/vim/blob/0bbca540f7377889e2154aa5731f6eeffcb5c0cc/runtime/doc/editing.txt#L1386-L1398>
>    of their behavior has the following statements:
>       - "When jumping to another [window|tab page], the current directory
>       is changed to the last specified local [current directory|for that tab
>       page]".
>       - "Windows where the :lcd command has not been used stick to the
>       global or tab-local current directory."
>       - "The current directory of other tab pages is not affected."
>
> My understanding is that when creating a *new* window or tabpage it
> conforms to all the statements:
>
>    - No local current directory was specified.
>    - Local command (:lcd or :tcd) has not been used.
>    - It is *other* instance.
>
> So, as always, this is indeed an intended behavior and documentation
> should be updated, or is not intended and subject for a fix.
> Version of Vim
>
> 8.2.4051
> Environment
>
> OS: Ubuntu 20.04
> Terminal: Kitty 0.23.1
> Value of $TERM: xterm-kitty
> Shell: zsh 5.8
> Logs and stack traces
>
> *No response*
>
>
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7mojgEekktzj7udgwdpdEPU0CWg_xT7EECA9nV9TkwtrQ%40mail.gmail.com.

Raspunde prin e-mail lui