fix(picker): handle optional reversed last icon in tree lists
#2549
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.
Description
Pickers that list items in a tree structure (including
explore,treesitter,undo, andlsp_symbols) use box-drawing characters to indicate tree hierarchy:snacks.nvim/lua/snacks/picker/config/defaults.lua
Lines 357 to 361 in dec29f5
The
verticalandmiddlecharacters exhibit vertical symmetry, but thelastcharacter does not. This means that whenever a picker is opened using a layout withreverse = true(e.g.telescope), the last icon points in the wrong direction (see screenshots).This change addresses this issue by using an optional
icons.tree.last_ricon for the last sibling when it is available and the layout hasreverse = true. It also adds the appropriatelast_ricons to the default config and theundopicker config.Screenshots
These screenshots show both preserved "good" behavior for non-reversed layouts and fixed "bad" behavior for reversed layouts.