fix: navigate to symbol with Snacks in scratch buf #499
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.
An absolute delight in my day, was discovering
require("aerial").snacks_picker(). Previously I'd used<cmd>AerialToggle float<CR>and whilst it was convenient, it took too many keystrokes to navigate to where I wanted to get to.I started using Aerial and Snacks with CodeCompanion in order to navigate between H2 headers and I noticed that when selecting a symbol, I hit a position error and then when I reopened the CodeCompanion buffer (which circumvents the error it seems) and selected a symbol, the cursor moved to that symbol but in another window:
with error:
2025-12-09.23_14_54.-.Ghostty.mp4
This PR adds a
confirmaction to the Snacks picker which uses aerial's navigation module to determine where to move to:without error:
2025-12-09.23_13_47.-.Ghostty.mp4
I haven't investigated further but it seemed that because CodeCompanion buffers are of the scratch variety and
buftype=nofile, that interfered with something.