Skip to content

SideSearch(): if cmd is called with a path at the end, convert it to absolute path #17

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

Merged
merged 2 commits into from
Nov 19, 2021

Conversation

jakutis
Copy link
Contributor

@jakutis jakutis commented Nov 19, 2021

This fixes use case, when for example user specifies a relative path as the last argument to :SideSearch and then navigates from one file to another while his Vim config changes current Vim dir on every file/buffer opening/selection, for example with this config:

set autochdir
autocmd BufEnter * lcd %:p:h

Sorry for not noticing this in #16

…absolute path

This fixes use case, when for example user specifies a relative path as the last argument to `:SideSearch` and then navigates from one file to another while his Vim config changes current Vim dir on every file/buffer opening/selection, for example with this config:
```
set autochdir
autocmd BufEnter * lcd %:p:h
```
@ddrscott
Copy link
Owner

The nested if statements are breaking my brain. I'll trust that it works, but for the sake of my 2 remaining brain cells, I'd like to get the logic cleaned up a bit. It's probably time to add some tests 😊

I'll try to play with the code again this weekend and see if I can get some tests in place to help explain what's going on.

@jakutis
Copy link
Contributor Author

jakutis commented Nov 19, 2021

The nested if statements are breaking my brain. I'll trust that it works, but for the sake of my 2 remaining brain cells, I'd like to get the logic cleaned up a bit. It's probably time to add some tests blush

I'll try to play with the code again this weekend and see if I can get some tests in place to help explain what's going on.

Yes, the cleanup was low-hanging, pushed it..

@ddrscott
Copy link
Owner

Brain un-broken. Thanks for the update!

@ddrscott ddrscott merged commit b947d51 into ddrscott:master Nov 19, 2021
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

Successfully merging this pull request may close these issues.

2 participants