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

fix: return a String instead of a PathBuf in nvim_buf_get_name #115

Closed
wants to merge 1 commit into from

Conversation

NyCodeGHG
Copy link

The buffer name is not always a path to a file,
it can also be e.g. a terminal buffer which's name starts with term:// and gets truncated to an empty string when used with PathBuf.

@noib3 noib3 force-pushed the main branch 3 times, most recently from e70b241 to 6124b57 Compare October 11, 2023 13:17
@noib3
Copy link
Owner

noib3 commented Oct 11, 2023

PathBuf::new doesn't truncate term://, and I've just added a test to confirm that Buffer::get_name returns the correct result in terminal buffers.

If you experience something else it's a bug, in which case please provide an example to test.

@NyCodeGHG
Copy link
Author

oh i see, i didn't use display() on the PathBuf, i should have openend an issue first, thank you for your time :)

@NyCodeGHG NyCodeGHG closed this Oct 11, 2023
@NyCodeGHG NyCodeGHG deleted the fix-get-name branch October 11, 2023 13:48
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