Hi,
On Mon, Apr 8, 2019 at 9:59 AM Luc Hermitte <[email protected]> wrote:
>
> Or will Vim remember there is a current directory in the current tab?
>
> Yes. Vim will remember a separate working directory for each of the tab pages.
> You now have a global working directory, a tab-local working directory and a
> window-local working directory.
>
> In that case, it'll be interesting to have access to this information from
> vim scripts. This means that has_localdir() should return 1 or 2 depending on
> the locality of the directory (*). We can also imagine a 3 value the day we
> have real project-local directories.
>
In the first set of changes to haslocaldir(), I did implement haslocaldir() to
return 1 or 2 depending on whether the current window has a win-local or
a tab-local directory. But then I decided to change it to always return 1 for
both cases (because the existing scripts are not distinguishing between 1 and 2,
and to be consistent with the neovim implementation). We can change this
implementation, if it will be more useful to return different values.
Regards,
Yegappan
>
> (*) It's my cd_without_sideeffects() function that makes me guess we'll need
> more information
>
> function! lh#path#cd_without_sideeffects(path) abort
> let cd = exists('*haslocaldir') && haslocaldir()
> \ ? 'lcd '
> \ : 'cd '
> exe cd . a:path
> endfunction
>
> (I've seem a very similar pattern in plugins other than mine: I'm thinking
> about fugitive)
>
--
--
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].
For more options, visit https://groups.google.com/d/optout.