Skip to content

feat: Shift+Tab escape from auto-pairs and indented blocks#360

Merged
xiaolai merged 3 commits intomainfrom
feat/shift-tab-left-escape
Mar 9, 2026
Merged

feat: Shift+Tab escape from auto-pairs and indented blocks#360
xiaolai merged 3 commits intomainfrom
feat/shift-tab-left-escape

Conversation

@xiaolai
Copy link
Owner

@xiaolai xiaolai commented Mar 9, 2026

Summary

  • Shift+Tab jumps cursor past closing auto-pair characters (brackets, quotes, backticks)
  • Shift+Tab escapes left from indented blocks in tabIndent plugin
  • Refactors autoPair handlers into focused modules (keyHandler.ts, backtickToggle.ts)
  • Fixes audit-fix CI workflow (direct_promptprompt for claude-code-action)

Closes #357, closes #358

Test plan

  • New tests for Shift+Tab jump in autoPair (shiftTabJump.test.ts)
  • New tests for Shift+Tab escape in tabIndent (shiftTabEscape.test.ts)
  • Existing autoPair and tabIndent tests still pass
  • pnpm check:all passes (lint + coverage + build)
  • Manual: type (, verify Shift+Tab jumps past ) in WYSIWYG
  • Manual: indent a line with Tab, verify Shift+Tab removes indent

xiaolai added 3 commits March 9, 2026 06:46
- Extract shared buildPostSaveState() to fix DRY and TOCTOU race in
  markSaved/markAutoSaved — isDirty stays true if content diverged
  during async save
- Add reentry guard (isSavingRef) to prevent overlapping save cycles
- Wrap per-tab saveToPath in try/catch so one failure doesn't abort loop
- Re-read doc state per tab instead of using stale snapshot
- Fix initDocument to set lastDiskContent from savedContent
- Fix loadContent to preserve filePath when arg is undefined
- Clamp autoSaveInterval to safe minimum, use completion-time debounce
- Add 13 new tests covering TOCTOU, rejection, missing/divergent state

Closes #357
Closes #358
Add Shift+Tab behavior to jump cursor past closing auto-pair characters
(brackets, quotes, backticks) and to escape left from indented blocks.
Refactor autoPair handlers into focused modules (keyHandler, backtickToggle).

Also fix claude-code-action audit-fix workflow (direct_prompt → prompt).

Closes #357, closes #358
@xiaolai
Copy link
Owner Author

xiaolai commented Mar 9, 2026

Merged locally to main.

@xiaolai xiaolai merged commit 0342599 into main Mar 9, 2026
1 check passed
@xiaolai xiaolai deleted the feat/shift-tab-left-escape branch March 9, 2026 00:38
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.

[audit] data-integrity: markAutoSaved TOCTOU race can lose edits [audit] data-integrity: auto-save setInterval can overlap with itself

1 participant