Skip to content

#1997 Tab spell list: insert at the remembered caret, not the end of the row - #2000

Merged
TimothyLuke merged 1 commit into
TimothyLuke:masterfrom
LarryThiessen:fix-1997-tab-insert-at-caret
Aug 22, 2026
Merged

#1997 Tab spell list: insert at the remembered caret, not the end of the row#2000
TimothyLuke merged 1 commit into
TimothyLuke:masterfrom
LarryThiessen:fix-1997-tab-insert-at-caret

Conversation

@LarryThiessen

Copy link
Copy Markdown
Contributor

Fixes #1997

Stacked on PR #1995 (same function — once #1995 merges this collapses to the single commit b33ab195).

Problem

Between pressing Tab and clicking the entry, the editor's debounced live repaint (or a focus-loss commit repaint) can SetText the box, parking the caret at the end — so a plain Insert sometimes landed at the end of the last row.

Fix (GSE_QoL/QoL.lua, OnEditorMacroBlockTab)

Remember the caret at Tab-press, cancel any pending live repaint via the gseRecolourToken the recolour already honours, and on pick do SetFocus + SetCursorPosition(saved) + Insert. No colouring changes.

Verified in-game. luac -p clean.

🤖 Generated with Claude Code

…the end of the row

Between pressing Tab and clicking the entry, the editor's debounced live
repaint (or a focus-loss commit repaint) can SetText the box, parking the
caret at the end -- so a plain Insert sometimes landed at the end of the
last row. Remember the caret at Tab-press, cancel any pending live repaint
via the gseRecolourToken the recolour already honours, and on pick do
SetFocus + SetCursorPosition(saved) + Insert.

Fixes TimothyLuke#1997

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@TimothyLuke
TimothyLuke merged commit d747812 into TimothyLuke:master Aug 22, 2026
1 check passed
@LarryThiessen
LarryThiessen deleted the fix-1997-tab-insert-at-caret branch August 22, 2026 23:23
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.

[BUG] Tab spell list sometimes inserts the spell at the end of the last row instead of at the caret

2 participants