Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening wiki changes the working directory. #23

Closed
typhooncamel opened this issue Mar 18, 2019 · 5 comments
Closed

Opening wiki changes the working directory. #23

typhooncamel opened this issue Mar 18, 2019 · 5 comments

Comments

@typhooncamel
Copy link

When I open the wiki from a session I'm currently working on, edit a wiki file, and quit the buffer, the working directory is changed. E.g.:

  • open ~/test.py in neovim, edit, so current directory is ~/;
  • open wiki (located in ~/documents/diary) with <leader>ww, edit wiki, exit buffer;
  • return to ~/test.py. The working directory is now ~/documents/diary (i.e., it never changed back to ~/, which I would have thought would be the more intuitive behaviour).
@lervag
Copy link
Owner

lervag commented Mar 20, 2019

Strange. I've tried to reproduce with no luck. I've pushed my test files to the repo, see test/issues/23. I do:

  1. nvim -u minivimrc. This opens test.py with neovim (should work with Vim as well).
  2. Do <leader>ww to open the example wiki index. The current path has not changed.
  3. Do :bwipe to kill the wiki buffer and return to the test.py buffer. Still, the path is as expected.

Could you provide the configuration that is relevant in order to reproduce your problem?

lervag added a commit that referenced this issue Mar 20, 2019
@typhooncamel
Copy link
Author

I'm really sorry, you're right, I should've checked with a minimal configuration. That's true - in that case the path does not change. For some reason (I can only guess it's something else in my configuration), with my setup it does change, which is a bit annoying. I'll try to figure it out. Thanks for your response! And great work on the plugin.

@lervag
Copy link
Owner

lervag commented Mar 21, 2019

And great work on the plugin.

Thanks! I'm happy it is useful to others as well as myself.

Note: The autochdir option could look relevant here. But it is not enough to add it to reproduce your problem. I suspect that there is some conflict with another plugin or with some of your settings.

I propose that you attempt to make a detailed step-by-step list of instructions to produce your problem. Then strip down your vimrc file (e.g. bisect by commenting out half and half of your content) in order to find the relevant settings/plugins.

@typhooncamel
Copy link
Author

I eventually figured out the problem. It involves the vim-pandoc plugin, which I suspect some people using wiki.vim might also use. The plugin automatically enables a CHDIR option (see vim-pandoc-chdir-module) which "changes the current window directory to the one the file is in". This needs to be disabled.

@lervag
Copy link
Owner

lervag commented Mar 23, 2019

Ah, I see. At a first glance, it strikes me as a strange option, since Vim already has the 'autochdir' option. In any case, I'm happy to see the issue resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants