This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0aa0c0296c3172b5912bbccf55e55c3d246a4b80 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Aug 14 16:15:00 2026 +0200 camel-tui: Fix F9 jump to error for lines added during editing goToLine() checked against lines.size() which holds the view-mode content from when the file was loaded from disk. Lines added during editing were beyond that bound so F9 could not jump to errors on new lines. Use editState.lineCount() in edit mode instead. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../org/apache/camel/dsl/jbang/core/commands/tui/SourceViewer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceViewer.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceViewer.java index 8cdafd29f84d..d8ed9a6eca63 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceViewer.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceViewer.java @@ -385,7 +385,8 @@ class SourceViewer { } void goToLine(int lineIndex) { - if (lineIndex >= 0 && lineIndex < lines.size()) { + int maxLine = editMode ? editState.lineCount() : lines.size(); + if (lineIndex >= 0 && lineIndex < maxLine) { selectedLine = lineIndex; pendingScroll = true; if (editMode) {
