Skip to content

Fixed deleting text crash bug.#118

Merged
krperry merged 1 commit into
mainfrom
backspace_index_error
May 19, 2026
Merged

Fixed deleting text crash bug.#118
krperry merged 1 commit into
mainfrom
backspace_index_error

Conversation

@krperry
Copy link
Copy Markdown
Collaborator

@krperry krperry commented May 19, 2026

In some cases for example after a
merge/backspace operation that changes the document structure indexes[totalLength - 1] + 1produced a value (692) that exceeded the actual length of the print text node string (690), causingsubstring(start, end)` to throw the exception.

This problem existed in two places:

  1. The pastFirstNewPage code building invisible text for off-page content
  2. The normal visible-text rendering code

Both seem to be fixed.

In some cases for example after a
merge/backspace operation that changes the document structure
indexes[totalLength - 1] + 1` produced a value (692) that exceeded
the actual length of the print text node string (690), causing
`substring(start, end)` to throw the exception.

This problem existed in two places:

1. The pastFirstNewPage code building invisible text for off-page content
2. The normal visible-text rendering code

Both seem to be fixed.
@krperry krperry merged commit 9247ff8 into main May 19, 2026
1 check 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.

1 participant