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

rooter_patterns child directories not working as expected #138

Open
cdalsass opened this issue May 22, 2024 · 5 comments
Open

rooter_patterns child directories not working as expected #138

cdalsass opened this issue May 22, 2024 · 5 comments

Comments

@cdalsass
Copy link

cdalsass commented May 22, 2024

In g_rooters, I notice that

'>/Users/charlie/dev/'

Where I'd like to match the folder /Users/charlie/dev/project1, /Users/charlie/dev/project2 etc.

Does not work properly.

Looks like an easy fix, and will provide a PR - assuming I'm understanding the configuration properly.

Is anyone else seeing this?

@airblade
Copy link
Owner

What do you mean by not working properly? Please provide repro steps.

@cdalsass
Copy link
Author

cdalsass commented May 22, 2024

Configure vim as follows:

let g:rooter_patterns = ['>/Users/chucky/projects' ]

Setup a few projects.

 mkdir -p /Users/chucky/projects/project1
 mkdir -p /Users/chucky/projects/project2
 echo "test" > /Users/chucky/projects/project1/test.txt
 echo "test" > /Users/chucky/projects/project2/test.txt

open vim and edit project1/test.txt. Type ":pwd". Plugin doesn't switch to /Users/chucky/projects/project1/, as expected.
Similarly, edit project2/test.txt. Does not correctly switch to project2.

NVIM v0.9.0
https://github.com/airblade/vim-rooter.git version 1353fa4

@cdalsass cdalsass changed the title rooter_patterns child directories not working properly rooter_patterns child directories not working as expected May 22, 2024
@cdalsass
Copy link
Author

@airblade let me know if my understanding is correct. Also, it would be great to refresh NerdTree when switching projects, as I've missed the console a few times and been confused. (I can include that too).

@airblade
Copy link
Owner

Thank you for the example – it's much easier to debug something concrete.

And your understanding of the pattern '>/some/dir' is correct.

Plugin doesn't switch to /Users/chucky/projects/project1/
...
Does not correctly switch to project2.

It does for me.

I wonder what differs between your setup and mine? You mentioned NerdTree; if you uninstall that, does your example start behaving as expected?

@cdalsass
Copy link
Author

Even after uninstall of Nerdtree, the issue is there. Switching back to my branch does resolve it.

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