Repository navigation
Add code editing features to the scripting terminal - #86
Merged
rubensworks merged 10 commits intoOct 18, 2026
Merged
Conversation
Tab did nothing in the editor, so indenting code meant typing spaces one by one. Make tab insert an indent, or indent all selected lines, and shift+tab remove one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
A new line always started at the first column, so the indentation had to be retyped on every line. Keep the indentation of the current line, and indent one more level after an opening bracket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
In the small editor it was hard to see which bracket closes which block. Highlight the bracket next to the cursor and its matching bracket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Finding something in a script meant scrolling through it in the small editor. Ctrl+F opens a search bar below the editor to find text, and Ctrl+G opens it to go to a line number, for example one from an error message. The bar shows the current match and the number of matches, has previous and next buttons (also Shift+Enter and Enter), highlights all matches, and turns red when nothing matches. Escape closes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Commenting out or reordering multiple lines meant editing every line by hand. Add ctrl+/ to toggle line comments and alt+up/down to move the current or selected lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Dragging a selection beyond the top or bottom of the editor stopped at the visible lines, so a selection could not be larger than the viewport. The editor now keeps scrolling while a selection is held above or below it, faster the further away the mouse is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Tab inserted a fixed 4 spaces, which is wide in the small editor, and doesn't match every code style. Add a client option for the number of spaces, defaulting to 2, which is common for JavaScript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The editor actions were only available through keyboard shortcuts, which players can't discover in-game. Add small buttons for undo, redo, find, go to line and toggle comment next to the terminal title, whose tooltips also show their shortcut. Long translations of the title are shortened so they don't run under the buttons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The shortcuts for undo, redo, find, go to line, toggle comment and moving lines were hardcoded. They are now key mappings that can be changed in the Controls settings, and the toolbar tooltips show the current key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
This was referenced Oct 18, 2026
Coverage Report for CI Build 39152697881Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage decreased (-2.3%) to 45.27%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions586 previously-covered lines in 5 files lost coverage. Coverage Stats
💛 - Coveralls |
Base automatically changed from
terminal-ux-clean/2-undo-and-sync
to
master-1.21-lts
October 18, 2026 17:46
rubensworks
commented
Oct 18, 2026
The shortcuts were only discoverable through the toolbar tooltips. A new info book section lists them with the keybinding appendix, so it shows the keys as currently bound, plus the keys that can not be changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
rubensworks
force-pushed
the
terminal-ux-clean/3-editing-features
branch
from
October 18, 2026 18:07
fa706d0 to
bf7170f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces #79, with the same changes and a clean commit history: every commit is one standalone change. Phase 3 of the scripting terminal UX improvements, stacked on #85.
I checked each problem on the previous phase's build in a dev client driven by clientdevbridge, then checked the feature with this branch.
{,(or[, and{}is split so the closing bracket gets its own line.2/29), has previous/next buttons (also Shift+Enter / Enter), highlights all matches, and turns red when nothing matches or the line number is invalid. Escape closes the bar before it closes the screen. Checked in-game: wrap-around in both directions with the view following, the count updating while editing, the editor regaining its full height when closed, and the bar closing on resize.//on the current or selected lines; Alt+Up/Down moves them. Both are undoable.terminalScriptingIndentSize(1–16), default 2, the common JavaScript style. Checked in-game: Tab and Enter-after-{use 2 spaces; after changing the config file to 4, Tab added 4 without restarting the game.…before the toolbar.keybindingappendix per rebindable shortcut, and a paragraph for the fixed keys (Tab, Page Up/Down, word and line navigation including the macOS variants, search bar keys).I left out duplicate-line, which was in the original plan: copy/paste already covers it.
Known issues
keybindingappendix only shows readable keys (CTRL + Zinstead ofkey.keyboard.z) once Integrated Scripting depends on a CyclopsCore release with Show the bound key in key binding appendices CyclopsCore#255, which is merged./). There is no actual clash at runtime, since our keys are only checked inside the terminal.All text logic is in a new
TextEditingclass with unit tests, covering both indent sizes and the search helpers.Testing
./gradlew buildpasses, including the new unit tests../gradlew runGameTestServer: all 23 tests pass.Generated by Claude Code