feat: Show filepath context in bufferline #13565
Open
+207
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds functionality that computes the shortest unique filepath for each document in the editor to display as the title in the bufferline, along with the appropriate configuration options.
Configuration changes
editor.bufferline
has been moved toeditor.bufferline.show
, and a new keyeditor.bufferline.context
has been added with the following variants:"none"
: Don't provide any additional context in the bufferline. This maintains previous functionality."minimal"
: Show the shortest unique filepath for each document in the bufferline. This is the new default.Setting the render mode directly in
editor.bufferline
is still supported, so existing configs won't break.Functionality
With
editor.bufferline.context = "none"
, the following set of documents is mapped as follows:book/src/editor.md
editor.md
helix-term/src/ui/editor.rs
editor.rs
helix-view/src/editor.rs
editor.rs
With
editor.bufferline.context = "minimal"
, the same set of documents is now mapped as follows:book/src/editor.md
editor.md
helix-term/src/ui/editor.rs
ui/editor.rs
helix-view/src/editor.rs
src/editor.rs
Verification steps
editor.bufferline.show
toalways
.editor.bufferline.context
tonone
.Possible additions
We could add another context variant
"full"
which would map documents to their full path (either from Helix's working directory or, if outside that, from the user's home directory (e.g.~/...
) or from the system root (e.g./...
).