Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .changeset/fix-a11y-change-duplication.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/fix-g-z-prefix-command-lookup.md

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/fix-ime-composition-corruption.md

This file was deleted.

12 changes: 12 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @vemjs/core

## 0.8.1

### Patch Changes

- 25a89df: Fix a major bug where every g/z/Z/bracket two-key prefix command except `gg` silently failed: `gu`, `gU`, `gq`, `gJ`, `ga`, `g8`, `gf`, `gv`, `gi`, `g;`, `g,`, `zz`, `zt`, `zb`, `ZZ`, `ZQ`, `[[`, `]]`, `[]`, `][` all resolved to `isValid: false` and did nothing when pressed.

Root cause: the parser's lookup tables for these commands (`gPrefixCommands`, `zPrefixCommands`, `ZPrefixCommands`) are keyed by the second character only (e.g. `gPrefixCommands.u === 'gu'`), but the lookups indexed them by the full two-character sequence (`gPrefixCommands['gu']`) — a key that never exists in any of these tables, so the lookup was always `undefined`. `gg` appeared to work only because it has a separately hardcoded motion check that never depended on the broken lookup at all, which is exactly why this went unnoticed for so long.

Also fixes `bracketPrefixCommands`, which additionally had wrong _values_ (`]]` resolved to command `[]`, `][` resolved to `[[`) independent of the lookup-key bug.

Added a dedicated regression test suite (`g/z/Z/bracket two-key prefix commands`) covering every command in NORMAL, VISUAL, and after-operator contexts, verified to fail against the pre-fix parser and pass against the fix.

## 0.7.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vemjs/core",
"version": "0.8.0",
"version": "0.8.1",
"description": "Pure state machine for the Vem modal text editor",
"type": "module",
"main": "./dist/index.js",
Expand Down
24 changes: 24 additions & 0 deletions packages/renderer-vecto/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# @vemjs/renderer-vecto

## 0.4.24

### Patch Changes

- 611a44c: Fix text duplication on i/a after ESC: the a11y change handler was
processing single-key values from the shadow textarea as INSERT mode
input, duplicating the first character of every new INSERT session
(e.g. pressing i entered INSERT mode but also inserted "i" as text,
and after an edit, pressing i/ESC/i replayed the entire previous edit
via the change/value cycle).
- c391639: Fix severe text corruption bug: typing in INSERT mode (including pressing `i`/`a` to enter it, or pressing Enter for newlines) could duplicate or scramble large portions of the buffer under real network/rendering latency.

Root cause: the previous IME-composition detection trusted a `composition` field forwarded by `@vectojs/core`'s accessibility layer on every `change`/`input` event from the shadow textarea. That field is `null` both for a just-committed IME composition AND for an ordinary direct keystroke — the two cases are indistinguishable from the event payload alone. Under load (slow page load, a11y sync racing with keydown), a queued `change` event carrying stale/full buffer text was misidentified as a composition commit and re-inserted verbatim, producing the reported "typing anything returns a long garbled string" and "same file opens with duplicated content" symptoms.

Fix: attach dedicated `compositionstart`/`compositionend` listeners directly on the shadow textarea and track composition state ourselves. Only the one `change` event that fires synchronously inside `compositionend`'s own listener chain (the real IME commit) is ever inserted as text; every other `change` event — regardless of its `value` or `composition` field — is ignored, since direct key input is already fully handled by the `keydown` handler. Verified with a stress test that previously reproduced heavy corruption (10-line typed loop, numeric input, ESC/re-enter INSERT) — all pass cleanly now.

Also includes two smaller fixes bundled in this release:

- `zz`/`zb` no longer collapse to a 1-line scroll fallback when `visibleLines` hasn't synced yet (falls back to `halfPageLines`).
- The text-render clip region now reserves the bottom 30px for the status/command bar, so scrolled buffer text can no longer paint underneath the ruler or overlap the command-mode input line.

- Updated dependencies [25a89df]
- @vemjs/core@0.8.1

## 0.4.16

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer-vecto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vemjs/renderer-vecto",
"version": "0.4.23",
"version": "0.4.24",
"description": "VectoUI integration renderer for the Vem text editor",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -14,7 +14,7 @@
"dependencies": {
"@vectojs/core": "^1.11.1",
"@vectojs/ui": "^1.11.0",
"@vemjs/core": "^0.8.0"
"@vemjs/core": "^0.8.1"
},
"publishConfig": {
"access": "public"
Expand Down