Skip to content

Comments

Fix RET file navigation in tool output blocks#135

Merged
dnouri merged 1 commit intomasterfrom
fix/ret-tool-navigation
Feb 21, 2026
Merged

Fix RET file navigation in tool output blocks#135
dnouri merged 1 commit intomasterfrom
fix/ret-tool-navigation

Conversation

@dnouri
Copy link
Owner

@dnouri dnouri commented Feb 21, 2026

What changed for users

This PR fixes incorrect RET file navigation from tool output in the chat buffer.

✅ Fixed behaviors

  • read output now navigates to the correct file line in both collapsed and expanded views, including output that contains blank lines.
  • RET on non-content collapsed lines (closing fence and ... (N more lines)) now reports a clear error instead of jumping to line 1.
  • edit diff navigation now supports added (+), removed (-), and context ( ) rows.
  • Generic/custom tool output with :path now maps RET navigation correctly in expanded and collapsed views.
  • Generic/custom tool output with :path now uses extension-based syntax fences (same behavior as built-in file tools).
  • :offset is applied only to read (as intended) and ignored for write.

Docs and tests

  • Updated README wording for RET behavior in tool blocks.
  • Consolidated duplicated visit-file test scaffolding into shared helpers.
  • Added coverage for C-u RET inversion (same-window open path).

Verification

  • Full project checks pass via pre-commit and make check:
    • byte-compile ✅
    • checkdoc ✅
    • package-lint ✅
    • unit tests: 627/627 passing

- use diff context line numbers for edit navigation
- map read/custom tool lines correctly in collapsed vs expanded views
- stop falling back to line 1 on non-content lines
- support path-based syntax fences for generic tools with :path
- refactor and extend visit-file tests (including C-u RET) and update README
@dnouri dnouri force-pushed the fix/ret-tool-navigation branch from e484251 to ab2689f Compare February 21, 2026 12:28
@dnouri dnouri merged commit 15a4d8d into master Feb 21, 2026
7 checks passed
@dnouri dnouri deleted the fix/ret-tool-navigation branch February 21, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant