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

In readme, seems like nvim_wd_heel should be vimwd_heel #48

Closed
Euthoniel opened this issue Jun 8, 2022 · 10 comments
Closed

In readme, seems like nvim_wd_heel should be vimwd_heel #48

Euthoniel opened this issue Jun 8, 2022 · 10 comments

Comments

@Euthoniel
Copy link

I didn't want a change in perspective to change the working directly. I tried switching nvim_wd_heel to false, but it did nothing. I looked at the code a bit, set vimwd_heel to false in my config, and the functionality was disabled as expected.

@jakewvincent
Copy link
Owner

Thanks for reporting this! It's all consistently nvim_wd_heel now. (vimwd_heel will still work for now--the compat module will convert it to nvim_wd_heel if it finds the vimwd_heel key.)

@idr4n
Copy link

idr4n commented Aug 30, 2022

Hi and thanks for this cool plugin!

It seems like nvim_wd_heel is not working for me either (I just installed your plugin) . This is my perspective setting:

perspective = {
	priority = "root",
	fallback = "root",
	root_tell = ".wiki_root",
	nvim_wd_heel = false,
},

Say that I start an nvim session in cwd ~/foo which is not a wiki directory (it doesn't have a.wiki_root file). Then I start editing a note in a subdirectory, say ~/foo/bar/note.md, then nvim's current working directory changes to ~/foo/bar, but I want it to stay in ~/foo.

The only way in which I have managed to get the behavior I want is with fallback = false, irrespective of nvim_wd_heel being set to true or false. Could you please clarify if this is the expected behavior? I'm asking as I didn't see in the documentation that fallback = false is a valid setting.

Thanks in advance!

@jakewvincent
Copy link
Owner

Hi @idr4n, thanks for trying out the plugin! Oddly, I can't reproduce this. false is not technically a valid setting for fallback, but I don't know if it will specifically cause any issues--you could probably keep it like that. When you start editing the note in the subdirectory, how are you opening that note? Are you following it using the plugin's mappings, or are you opening it with another tool, such as Telescope?

@idr4n
Copy link

idr4n commented Aug 30, 2022

Hi and thanks for the quick reply.

Yes, I open the note with Telescope or fzf.vim. By plugin mapping you mean with <CR> when on top of a link?

@jakewvincent
Copy link
Owner

Right, that's what I meant. I think it may be Telescope/fzf that is changing your working directory since I can't reproduce this on my end. I double-checked the function that changes working directory and can't see any accidental loopholes that would cause mkdnflow to change working directories without nvim_wd_heel being true. Can you run the following for me from a vim session just to make sure that your nvim_wd_heel setting is correctly recognized?

lua print(require('mkdnflow').config.perspective.nvim_wd_heel)

@idr4n
Copy link

idr4n commented Aug 31, 2022

Hi again,

lua print(require('mkdnflow').config.perspective.nvim_wd_heel) prints false.

I think it may be Telescope/fzf that is changing your working directory since I can't reproduce this on my end.

It might be something in my config. However, without your plugin installed, Telescope/fzf does not change my working directory, it only happens when your plugin is installed/enable.

Don't worry, however, I have been using fallback set to false and at least for now I have not encountered issues with that. Actually, it seems that the main functionality such as MkdnEnter does not work with that setting, so setting it back to root.

Thanks again!

@jakewvincent
Copy link
Owner

I see, how strange! Let me do a little more testing (with Telescope) to see if I can reproduce this and what might be causing the working directory change.

@jakewvincent
Copy link
Owner

Still having trouble reproducing this, even with Telescope and various perspective settings. At first I thought maybe the plugin was being initialized each time you're switching buffers using Telescope, but it doesn't seem like that's happening in testing. In a session with mkdnflow enabled, what do you get when you issue :set autochdir? (including the question mark)?

@idr4n
Copy link

idr4n commented Aug 31, 2022

:set autochdir? prints noautochdir.

If you are not being able to reproduce this don't worry then, it might be some hidden setting in my config. I will explore it on my side. Thanks again!

@jakewvincent
Copy link
Owner

Huh, puzzling! Please do comment again if you figure out what's causing it.

jakewvincent added a commit that referenced this issue Oct 8, 2022
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

3 participants