fix(session-picker): fix fzf-lua preview gutter and list entry layout#399
Merged
sudo-tee merged 1 commit intoJun 5, 2026
Merged
Conversation
Three fzf-lua-specific issues with the session picker preview: 1. The formatter's vertical border extmarks use virt_text_win_col = -3, targeting the 3-column gutter (signcolumn + foldcolumn) present in the main output window. The fzf-lua preview window has no gutter by default (set_style_minimal), so the overlay lands on column 0 of the text. Set signcolumn='yes' and foldcolumn='1' in the preview window to match. 2. Entries are formatted to opts.width (e.g. 100 columns), but fzf-lua's preview split leaves ~40% of the window for the list pane. Time columns end up off-screen. After building the fzf config (which keeps the full winopts.width), narrow opts.width to the list pane width so the format function sizes entries to fit. 3. Drop session IDs from picker list entries. The title + datetime is sufficient for identification, and IDs are visible in the preview pane when a session is selected.
Owner
|
Thanks for ther PR |
Contributor
Author
|
@sudo-tee Unfortunately, I have introduced a bug with this PR, I will create a follow-up PR with fix and test cases. Sorry for that 👀 |
Owner
No worries. As I don;t use fzf myself, I didn't notice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue
The session picker message preview (#398) has rendering issues specific to fzf-lua:
First column obscured in preview pane — The formatter renders vertical border extmarks at
virt_text_win_col = -3, relying on the main output window's 3-column gutter (signcolumn='yes'+foldcolumn='1'). The fzf-lua preview window has zero gutter (set_style_minimalsetssigncolumn='no',foldcolumn='0'), so the border overlay lands on column 0 of the text area, obscuring the first column of every bordered line.Time column pushed off-screen — Entries are formatted to @
opts.width(e.g. 100 columns), but fzf-lua's preview split leaves only ~40% of the window for the list pane (~43 columns). The right-aligned time column renders beyond the visible area.Session IDs add clutter — The list entries included session IDs that consumed layout space without adding value. IDs are already visible in the preview pane when a session is selected.
Solution
Match the preview window's gutter configuration to the main output window so the formatter's extmarks render correctly. Adjust the format width to fit the actual list pane when a preview split is active. Drop session IDs from list entries since title + datetime is sufficient for identification.
Changes
Preview window gutter (@
session_picker.lua) — Setsigncolumn='yes',foldcolumn='1', andstatuscolumn=''inrender_preview_bufferto provide the 3-column gutter that the formatter'svirt_text_win_col = -3border extmarks target.List entry width with preview (@
base_picker.lua) — After building the fzf config (which retains the full @winopts.width), narrowopts.widthto the list pane width (~40% of the window minus border padding) when a preview pane is active. The format function closure readsopts.widthon each call, so entries are sized to fit.Session picker entries (
session_picker.lua) — Remove session ID fromformat_session_item. The picker now shows title + datetime only.