Skip to content

fix(editor): keep input method composition out of auto-pairing and undo - #3579

Merged
datlechin merged 2 commits into
mainfrom
fix/editor-dead-key-quote-pairing
Oct 19, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/editor-dead-key-quote-pairing

Conversation

@datlechin

Copy link
Copy Markdown
Member

Why

With a dead-key layout (U.S. International, Brazilian), ' then Space typed ''' in the SQL editor, and " typed """. Every composition keystroke ran through the typing filters: the commit replaced the marked ' with ', and the pair filter read a quote replacing a range as "wrap the selection". Each composition stage also went into the undo history.

Change

  • Dead key then Space types one quote, and the next key pairs it as on a US layout.
  • One undo removes a committed accent or input method word, with no stages in between.
  • Double, triple or Shift-click during a composition keeps the composed text, as NSTextView does.
  • Cancelling a dead key typed before a closing quote keeps that quote.

Verified

CompositionTypingTests and CompositionUndoTests fail on main and pass here. The undo, click and unmark behavior matches NSTextView, measured with a probe.

Not in this PR

  • A composition typed over a selection takes two undos to restore it; NSTextView takes one.
  • Touching selections still merge into one caret after a composition commit, as on main.

Fixes #3458

@datlechin datlechin added the backport release/0.82 Merged into main; pick onto release/0.82 label Oct 19, 2026
@datlechin
datlechin merged commit 9ae2aaf into main Oct 19, 2026
17 checks passed
@datlechin
datlechin deleted the fix/editor-dead-key-quote-pairing branch October 19, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/0.82 Merged into main; pick onto release/0.82

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query editor issue with single quotes

1 participant