Repository navigation
Add code editing features to the scripting terminal - #79
Closed
rubensworks wants to merge 23 commits into
Closed
rubensworks wants to merge 23 commits into
rubensworks wants to merge 23 commits into
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. Add ctrl+f to find text (enter jumps to the next match) and ctrl+g to go to a line number, for example one from an error message. 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. Scroll the editor while dragging beyond its edges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Coverage Report for CI Build 39131775591Coverage decreased (-2.3%) to 44.119%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions579 previously-covered lines in 6 files lost coverage. Coverage Stats
💛 - Coveralls |
This was referenced Oct 17, 2026
…-features Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
…-features Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Resizing removes all widgets, so an open find field kept receiving key presses without being visible. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
This was referenced Oct 17, 2026
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
…-features Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
…-features Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The find field appeared floating over the top right of the code, covering it, without a label, without showing how many matches there are, and without any feedback when nothing matched. Show a search bar below the editor instead, which takes the space of the bottom row. It shows a label, the current match and number of matches, buttons for the previous and next match (also shift+enter and enter), highlights all matches, and turns red when nothing is found or the line number is invalid. Escape closes it before closing the screen. 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, whose tooltips also show their shortcut, and a button whose tooltip lists all shortcuts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Translations of the terminal title, such as "Terminal de Scripting", are wider than the space left of the new toolbar. Shorten the title with an ellipsis when it doesn't fit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Each toolbar button already shows its shortcut in its tooltip, so a separate button that only lists all shortcuts mostly repeats them. 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
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
This is narrower than three dots, so more of the title fits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The editor only scrolled one line per mouse movement beyond its top or bottom, so holding the mouse still stopped the scrolling, and the speed depended on how fast the mouse moved. It now scrolls every tick while the selection is held outside the editor, 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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Member
Author
|
Replaced by #86: same changes, rebased with every commit as one standalone change. Generated by Claude Code |
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.
Phase 3 of the scripting terminal UX improvements, stacked on #78 (which is stacked on #77). One commit per feature.
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.//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.Find:orLine:label, the current match and total (2/29), and previous/next buttons (also Shift+Enter / Enter). All matches are highlighted, and the input turns red when nothing matches (0/0) 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 with the bar open, the editor regaining its full height when closed, and the bar closing on resize.keybindingappendix per rebindable shortcut and a paragraph for the fixed keys (Tab, Page Up/Down, search bar keys).…, which is narrower.I left out duplicate-line, which was in the original plan: copy/paste already covers it.
Known issues
keybindingappendix shows letter keys askey.keyboard.zand leaves out the modifier. This is fixed in Show the bound key in key binding appendices CyclopsCore#255; I checked this section against that branch, and it showsCTRL + Z,ALT + Up Arrowand so on. Bumpingcyclopscore_versionafter that is released makes it show correctly here./). 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 38 unit tests, covering both indent sizes and the search helpers.Testing
./gradlew buildpasses, including the new unit tests../gradlew runGameTestServer: all 22 tests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9