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(builtin.buffers): previews with specified cwd option #3111

Merged
merged 1 commit into from
May 17, 2024

Conversation

jamestrew
Copy link
Contributor

Currently, the buffer name is normalized to the cwd option value. This buffer name is then used as the filename, which is used as the file path for the previewer. But if the cwd value is not the actual cwd, the buffer path can no longer be found by the previewer (relative to the true cwd).

This is fixed by adding a path value to the entry that's the full path of the buffer. The previewer will then use this full path to find the file to preview.

closes #3102

Currently, the buffer name is normalized to the `cwd` option value.
This buffer name is then used as the filename, which is used as the file
path for the previewer. But if the `cwd` value is not the actual cwd,
the buffer path can no longer be found by the previewer (relative to the
true cwd).

This is fixed by adding a `path` value to the entry that's the full path
of the buffer. The previewer will then use this full path to find the
file to preview.
@jamestrew jamestrew merged commit ccaeeb5 into nvim-telescope:master May 17, 2024
9 checks passed
@jamestrew jamestrew deleted the buffers-filename branch May 17, 2024 02:55
@jamestrew jamestrew added the backport-0.1.x PR to be backported to 0.1.x (Neovim 0.7 compat) label May 17, 2024
Conni2461 pushed a commit that referenced this pull request May 20, 2024
Currently, the buffer name is normalized to the `cwd` option value.
This buffer name is then used as the filename, which is used as the file
path for the previewer. But if the `cwd` value is not the actual cwd,
the buffer path can no longer be found by the previewer (relative to the
true cwd).

This is fixed by adding a `path` value to the entry that's the full path
of the buffer. The previewer will then use this full path to find the
file to preview.

(cherry picked from commit ccaeeb5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-0.1.x PR to be backported to 0.1.x (Neovim 0.7 compat)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

builtin.buffer preview shows an empty window when using the cwd option.
1 participant