mayurankv/Obsidian-Code-Styler

Bug:

Closed this issue · 2 comments

Describe the bug

Error: Ranges must be added sorted by `from` position and `startSide`
    at e.addInner (app.js:1:348610)
    at e.add (app.js:1:348384)
    at buildLineDecorations (plugin:code-styler:5967:15)
    at create (plugin:code-styler:5767:14)
    at e.create (app.js:1:326816)
    at Object.reconfigure (app.js:1:327141)
    at e.computeSlot (app.js:1:337683)
    at tr (app.js:1:330924)
    at new e (app.js:1:336799)
    at e.applyTransaction (app.js:1:337560)
    at e.get (app.js:1:332928)
    at e.update (app.js:1:486158)
    at e._dispatch (app.js:1:483944)
    at e.dispatch (app.js:1:485722)
    at eval (plugin:code-styler:5715:19)
    at e.update (app.js:1:487705)
    at e._dispatch (app.js:1:483944)
    at e.dispatch (app.js:1:485722)
    at t.set (app.js:1:1259651)
    at t.set (app.js:1:2076269)
    at t.setViewData (app.js:1:2089111)
    at t.setData (app.js:1:1821304)
    at t.<anonymous> (app.js:1:1821207)
    at app.js:1:237027
    at Object.next (app.js:1:237132)
    at a (app.js:1:235850)

Steps to reproduce

I have some simple bash code blocks

```bash
kubectl create secret generic grafana-credentials \
  --from-literal=OTLP_USER_ID="1234" \
  --from-literal=OTLP_TOKEN="234asddf"

# Add the required annotation to the secret
kubectl annotate secret grafana-credentials reflector.v1.k8s.emberstack.com/reflection-allowed=true

when I open the document with this content, the error above is happening and it won't let me open the doc the first time.
When I try to open it again, everything is opening fine without hassle.

Expected behaviour

open the document and highlight stuff

Current behaviour

error message and it won't open the first time.

Environment

  • Plugin Version 1.0.11
  • Obsidian Version: 1.4.14
  • Platform: desktop
  • OS: Manjaro
  • Theme:
  • CSS Snippets:

Hi, does this happen every time you restart Obsidian?

Does it make a difference whether it is in reading mode or editing mode?

Do you close your bash codeblock? (it isn't closed in the above example so just checking).

I see you're on the latest version so it won't be that most likely. Does doing this in a new temporary vault still have the same error?

Hiya, I'm going to close this for now as I don't have any information on how to reproduce it. If the issue still persists, just let me know and I'll happily reopen!

EDIT: (Note that the provided codeblock seems to work fine for me)