Implement bracket pairing and handling for user input#63
Open
ShingZhanho wants to merge 4 commits into
Open
Conversation
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.
This pull request implements auto-completion features for LaTeX input in the game.
All auto-completions apply to the
#user-inputtextarea in the game.Below is a summary of the implemented features, with examples of the auto-completion behavior.
Bracket pair auto-close
(()[[]{{}(,[, or{wraps the selection in the pair.),], or}when that character is already immediately after the cursor moves the cursor past it instead of inserting a duplicate.\left/\rightdelimiter pairs\left(\left(\right)\left[\left[\right]\left{\left{\right}\left\{\left\{\right\}\left|\left|\right|\left\|\left\|\right\|\left<\left<\right>Escaped bracket pairs
\{\{\}\|\|\|Named delimiter pairs
\langle\langle\rangle\left\langle\left\langle\right\rangle\lfloor\lfloor\rfloor\left\lfloor\left\lfloor\right\rfloor\lceil\lceil\rceil\left\lceil\left\lceil\right\rceil\lvert\lvert\rvert\left\lvert\left\lvert\right\rvert\lVert\lVert\rVert\left\lVert\left\lVert\right\rVertEnvironment auto-close
\begin{align}\begin{align}\end{align}{after\beginis not auto-closed — the user types the environment name freely and closes with}.}to close\begin{envnametriggers the completion: inserts}\end{envname}and places the cursor between the\beginand\endblocks.Navigation
}in the text. If the cursor is immediately before\end{...}, jumps past the entire\end{envname}tag instead.