Skip to content

Code editor: auto-pair brackets and quotes - #295

Open
enriquevelmai wants to merge 1 commit into
nxt-dev:devfrom
enriquevelmai:feature/code-editor-autopair
Open

enriquevelmai wants to merge 1 commit into
nxt-dev:devfrom
enriquevelmai:feature/code-editor-autopair

Conversation

@enriquevelmai

Copy link
Copy Markdown

Small editing quality-of-life change in NxtCodeEditor:

  • Typing (, [, {, " or ' inserts the closing char and places the cursor between them.
  • With a selection, the pair wraps the selected text.
  • Typing a closer that is already right after the cursor steps over it instead of duplicating it.
  • Quotes are not paired next to a word character, so apostrophes and string prefixes keep working.

Only active while the editor is editable; read-only mode is untouched.

Typing (, [, { or a quote inserts the matching closer and leaves the
cursor between them; with a selection the pair wraps it. Typing a closer
that is already under the cursor steps over it. Quotes are not paired
next to a word character so apostrophes keep working.
@michaelharmonart

Copy link
Copy Markdown
* With a selection, the pair wraps the selected text.

this seems to work for brackets, parenthesis, etc, but not for strings with "

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants