davsclaus opened a new pull request, #27296:
URL: https://github.com/apache/camel/pull/27296

   _Claude Code on behalf of davsclaus_
   
   [CAMEL-24395](https://issues.apache.org/jira/browse/CAMEL-24395)
   
   Switching between viewing and editing a file in the Source tab moved the 
code on the screen:
   
   - **F4** scrolled the cursor line to two thirds down the editor, so the code 
jumped (top line 28 in the view became 34 in the editor).
   - **Esc** went back to the line the view had selected before editing, not 
the line the cursor was on.
   - **F5** (save and close) reloads the file, which put the selection back at 
the top of the file.
   
   Now the editor opens on the same screen as the view, with the cursor on the 
selected line. Leaving it with Esc or F5 selects the cursor line in the view 
and keeps the same top line. The two-thirds positioning is still used when 
there is no view to match, such as the AI edit replay jumping to a row.
   
   ### Scope
   
   The ticket proposed rendering the view through the editor's `TextArea` as 
well, so there is one rendering path. That is not done here:
   
   - the route dump in YAML/Java/XML formats and the rendered Markdown are not 
editable text, so view mode keeps its own path for those anyway;
   - edit mode carries code assist, the AI edit replay, diff and problem 
overlays.
   
   This PR fixes the parts users notice, the jump and the lost position, and 
leaves the renderers as they are. The column where code starts was already the 
same in both modes.
   
   ### Tests
   
   - `SourceViewerEditPositionTest` renders the view and the editor and checks 
the top line and the screen row of the `>>` line across F4, Esc and F5. Its 
three behaviour tests fail on `main` and pass with this change.
   - Checked live in the terminal UI with a 104-line YAML file: view top 28 / 
line 42 → editor top 28 / row 42; cursor moved to 48, Esc → view top 28 / line 
48.
   - `camel-jbang-plugin-tui`: 1608 tests pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to