Skip to content

fix: stabilize markdown table search and selection#137

Merged
2391384896 merged 6 commits into
mainfrom
fix/table-search-highlight
Jul 13, 2026
Merged

fix: stabilize markdown table search and selection#137
2391384896 merged 6 commits into
mainfrom
fix/table-search-highlight

Conversation

@2391384896

@2391384896 2391384896 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Mirror CodeMirror search matches into rendered table cells with CSS Custom Highlight ranges backed by exact Markdown-source mappings.
  • Keep table cell DOM/focus stable while typing, including long-table IME composition and partial native text selection.
  • Preserve pending cell edits across immediate blur, row/column reorder, setDocument(), and editor teardown without stale-range writes or data loss.
  • Isolate table editing locks and search highlight registries per editor instance.
  • Handle tables without leading pipes, escaped \| delimiters, rich inline Markdown, repeated link labels/URLs, multi-backtick inline code, and full-document regexp context.

Behavior note

  • setDocument() and destroy() now flush a pending table-cell edit before replacement/teardown. A non-silent pending edit is emitted through onChange before the lifecycle operation completes.

Verification

  • pnpm test → pass (537 tests)
  • pnpm typecheck → pass
  • pnpm build → pass
  • pnpm build:electron-demo → pass
  • pnpm exec vitest run packages/core/test/editor.test.ts packages/core/test/live-preview.test.ts packages/plugin-search/test/plugin-search.test.ts → pass (159 tests)
  • git diff --check → pass
  • Previous AoE Electron runtime checks remain covered: long-table typing retained DOM/focus; partial selection stayed partial; Cmd+F selected the rendered table match; IME intermediate text stayed out of Markdown until commit.

Compliance

  • AI assistance disclosure: Codex assisted with reproducing edge cases and drafting the follow-up fixes and regression tests. Human maintainer review is requested and required before merge.
  • No new dependencies, build artifacts, secrets, or personal document data are included.

@CLAassistant

CLAassistant commented Jul 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@2391384896 2391384896 requested a review from redreamality July 10, 2026 10:06
@2391384896 2391384896 force-pushed the fix/table-search-highlight branch from c556cfe to c0236da Compare July 13, 2026 03:20
@2391384896 2391384896 merged commit dfd466d into main Jul 13, 2026
3 checks passed
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