Repository navigation
fix(picker): Resolve picker paths in their own cwd and keep caller actions - #54
Merged
Merged
Conversation
The grep provider ran rg in whatever directory was current when the prompt was answered and resolved its relative paths against the directory current when the results arrived. Changing directory while the prompt or rg was pending opened files with the same name in the other directory. The cwd is now pinned before prompting and used both to run rg and to resolve its output.
The fzf-lua wrappers and the generic push action parsed the selected entry without the picker opts, so a picker opened with its own cwd resolved relative files and grep matches against the editor cwd. The action now receives the opts fzf-lua passes to it, and peekstack's provider and mode move to a separate argument. The mode option is no longer forwarded to fzf-lua, and a missing line or column no longer becomes position -1.
The fzf-lua wrappers replaced the whole actions table and the Telescope pickers replaced attach_mappings, so custom actions such as ctrl-q or mappings passed by the caller were silently dropped. fzf-lua now gets the caller's actions with only the confirm action swapped, and Telescope runs the caller's attach_mappings after mapping <CR>, returning its result. The mode option is no longer forwarded to Telescope either.
The stack view cleared highlights for the replaced range after the new lines were in place, so when entries or preview lines were removed the unchanged lines that moved up into that range lost their highlights, including Tree-sitter preview colors. The old range is now cleared before it is replaced. The first render also replaces the empty line of the new buffer instead of leaving it below the list.
The popup underline compared the start and end columns even when they were on different lines, so a range ending on a later line before its start column was stretched to that column. On a short end line the extmark then failed and the whole underline disappeared. Columns are now only ordered within one line, each is clamped to its own line, and a range crossing the top or bottom of the popup buffer is clipped to it.
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.
Summary
attach_mappingspassed by the caller are kept; only the confirm action is replacedChanges
rg >prompt and used both to run rg and to resolve its relative paths, so:cdwhile the prompt or rg is pending no longer opens a same-named file in the other directory$VARare no longer expanded during resolutionactions.pushparse the entry with the picker opts fzf-lua passes to the action, so a picker opened with its owncwdresolves relative files, grep matches and references correctlyactions.push(selected, opts, push_opts)now takes the picker opts and peekstack's provider/mode separately;modeis no longer forwarded to fzf-lua, and a missing line or column no longer becomes position -1ctrl-qkeep working<CR>and then runs the caller'sattach_mappings, returning its result so callers can still override keys