mProjectsCode / mProjectsCode/obsidian-shiki-plugin

Modifying text around an inline code block in vim mode breaks highlighting

Open
#70 10 comments 1 reaction 2 assignees View on GitHub

@mProjectsCode is already working on this.

Since Feb 25, 2026.

bug
Dominant language
TypeScript
Stars
238
Forks
25
PR merge metrics
No merged PRs in 30d

Description

  • The Plugin is up to date
  • Obsidian is up to date

Describe the bug
When modifying text around an inline code block in vim mode, the highlighting will sometimes break until you restart. You will also get this error in the dev console:

app.js:1 RangeError: Position 25 is out of range for changeset of length 23
at e.mapPos (app.js:1:274503)
at e.map (app.js:1:304757)
at e.map (app.js:1:306904)
at ii.ViewPlugin.fromClass.decorations.update (plugin:shiki-highlighter:279:1355)
at e.update (app.js:1:363559)
at e.updatePlugins (app.js:1:472715)
at e.update (app.js:1:470762)
at e.dispatchTransactions (app.js:1:467223)
at e.dispatch (app.js:1:469370)
at mB (app.js:1:1652494)

To Reproduce

  1. Enable vim mode

  2. Paste this into a note:
    aaa
    {rust} let abc = 123;

  3. Delete the "aaa" line with dd

  4. Make a new line with o

  5. See the highlighting disappear and an error in the console

Expected behavior
There shouldn't be any errors and the highlighting would stay.

Screenshots
Image

Occurs on

  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Plugin version
0.7.0

Additional context
I disabled all other plugins to test this, the only other non vanilla thing here is the theme.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.