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

Use absolute path to get bufnr when using select() issue #563 #564

Open
wants to merge 1 commit into
base: harpoon2
Choose a base branch
from

Conversation

sug44
Copy link

@sug44 sug44 commented Apr 8, 2024

function get_exact_name was created in #541 to fix issue #540 . This PR fixes #563 while not breaking the previous fix. Getting bufnr using absolute path gets the right buffer number regardless of how the path of a buffer was saved

@sug44 sug44 changed the base branch from master to harpoon2 April 8, 2024 08:32
@sug44
Copy link
Author

sug44 commented Apr 8, 2024

Just realized that list_item.value could already be an absolute path(this happens when you add a file thats not in cwd to the list). I guess we need to check if it is in to_absolute_path and if so just return it without concatenating? Does anyone know what other format list_item.value can have that im not accounting for?

@sug44
Copy link
Author

sug44 commented Apr 8, 2024

Fixed by using uv.fs_realpath() to get absolute path

@ThePrimeagen
Copy link
Owner

i wont use this fix, but i may try to figure this one out.

i do like the research done, but we are going to put a pin in this one

this doesn't fix every issue (/tmp/foo vs /tmp/foo1)

@sug44
Copy link
Author

sug44 commented Apr 9, 2024

@ThePrimeagen whats the (/tmp/foo vs /tmp/foo1) issue? The way you describe it it seems like there would be no problem with this approach

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.

None yet

2 participants