Skip to content

fix(picker): Resolve picker paths in their own cwd and keep caller actions - #54

Merged
mhiro2 merged 5 commits into
mainfrom
fix/picker-cwd-and-rendering
Oct 4, 2026
Merged

mhiro2 merged 5 commits into
mainfrom
fix/picker-cwd-and-rendering

Conversation

@mhiro2

@mhiro2 mhiro2 commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Grep and fzf-lua results are resolved against the directory the search ran in, not the editor cwd at confirm time
  • fzf-lua actions and Telescope attach_mappings passed by the caller are kept; only the confirm action is replaced
  • The stack view keeps highlights of unchanged lines after a partial redraw, and diagnostic popups underline multi-line ranges correctly

Changes

  • 3963bb8 : fix(grep): resolve results in the directory the search started in
    • The cwd is pinned before the rg > prompt and used both to run rg and to resolve its relative paths, so :cd while the prompt or rg is pending no longer opens a same-named file in the other directory
    • Directory names containing $VAR are no longer expanded during resolution
  • 54b99e0 : fix(fzf-lua): resolve entries against the picker cwd
    • The wrappers and actions.push parse the entry with the picker opts fzf-lua passes to the action, so a picker opened with its own cwd resolves relative files, grep matches and references correctly
    • actions.push(selected, opts, push_opts) now takes the picker opts and peekstack's provider/mode separately; mode is no longer forwarded to fzf-lua, and a missing line or column no longer becomes position -1
  • ca02d56 : fix(extensions): keep the caller's picker actions and mappings
    • fzf-lua receives the caller's actions (table or function) with only the confirm action swapped, so custom actions such as ctrl-q keep working
    • Telescope maps <CR> and then runs the caller's attach_mappings, returning its result so callers can still override keys
  • e7ad48d : fix(stack-view): keep highlights of unchanged lines on partial redraw
    • The replaced range is cleared before the lines are swapped, so entries and Tree-sitter preview colors that move up after a removal keep their highlights
    • The first render replaces the empty line of the new buffer instead of leaving it below the list
  • 868c232 : fix(diagnostics): keep the end column of multi-line diagnostics
    • Start and end columns are only ordered within one line and each is clamped to its own line, so a range ending early on a later or short line keeps its underline
    • Ranges crossing the top or bottom of the popup buffer are clipped to the visible lines, and ranges fully outside are not underlined

mhiro2 added 5 commits October 4, 2026 20:04
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.
@mhiro2 mhiro2 self-assigned this Oct 4, 2026
@mhiro2 mhiro2 added the enhancement New feature or request label Oct 4, 2026
@mhiro2
mhiro2 merged commit 5fa2710 into main Oct 4, 2026
3 checks passed
@mhiro2
mhiro2 deleted the fix/picker-cwd-and-rendering branch October 4, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant