Skip to content

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

@Ratainen

Description

@Ratainen
  • 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.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions