influx: [bug] Newly typed text in long paragraphs sometimes is displayed below influx section for a few seconds for large notes (Uncaught range error?)

It happens with live text and and live text turned off in the Influx, Obsidian is in Live Preview mode.

When I have a note with large number of linked mentions (lets say 20, the are not visible without scrolling) I sometimes observe the following behaviour:

  • when I have the large paragraph to type (in bullet points), the text I type sometimes appear below the Influx section for a few seconds and then the cursor came back to the “proper” section of the note
  • the text is in its proper place, dont disseappers, but it is just displayed for a few seconds as it were below the Influx section
  • I didnt observed this in a notes with small amount of linked mentions
  • even if I collapse the references, after a few typed words, the linked mentions un-collapse and the type words appears again on the bottom of the pane, below the Influx linked mentions, and then the typed text slowly (sometimes letter by letter) appear again in the line when I typed it
  • when this is happening I saw this in the developer console, not sure if related
Uncaught RangeError: Position 396 is out of range for changeset of length 395
    at t.e.mapPos (app.js:1:270074)
    at e.map (app.js:1:302081)
    at e.update [as updateF] (plugin:influx:23527:15)
    at Object.update (app.js:1:283426)
    at e.computeSlot (app.js:1:294218)
    at Fn (app.js:1:287369)
    at new e (app.js:1:293244)
    at e.applyTransaction (app.js:1:294160)
    at e.get (app.js:1:289373)
    at e.update (app.js:1:434795)

I will try to make a gif to make it better to see what is happening. I also try to turn off other plugins, to see if this persist MacOS 13, Obisidian, 1.02, Influx 2.0.7

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 10
  • Comments: 20 (4 by maintainers)

Most upvoted comments

The workaround that hides influx while typing is in place with the latest version, as an optional but default setting, so this issue should be solved now - to the extent that it can be without access to obsidian internals.

@pawel-ilnicki Interesting work-around! No, I’ve not had the chance to develop this plugin further for a long time, unfortunately. (Life eats you up!) Hopefully I’ll get a chance to do so before summer.

It’s a bug related to how codemirror handles widget extensions. As such, I can’t fix this directly, but I have an idea for a work-around that I think will essentially solve the problem. I’ll probably get a chance to explore it sometime in the coming month.

I encourage people irritated by this bug to include an additional line at the end of all your most-used templates:

<% tp.file.cursor(1) %>

%% This line stops influx from misbehaving %%

What this achieves is prevents the bug from occurring by having another line below where you type. file.cursor() moves your cursor up after pasting the template, so you don’t have to do it manually.

it works, big thanks! I still have some performance issues with big files, but I can handle that for now.