While editing a document in Obsidian, the line numbers begin to glitch out along long-form paragraphs with varied indentation across bullet lists, headings, and numbered lists in what appears to be varied combinations. Text will align properly with the line numbers while scrolling to the top of the page, and as I scroll down will quickly shift out of line. Any text which goes beyond where the line numbers display is unable to be properly interacted with, jumping the curser either to the end of the paragraph or the final line that sits still within the margin numbers.
Steps to reproduce
Open a new document in a fresh vault
type and place any text of choice between the tag
Take paragraphs of 200+ words each and paste them into the document. Should each be spaced by 1 line in between.
The document should be 2000+ words.
Scroll to the bottom at any pace.
Expected result
A plain page, with the page numbers aligning with where the text has been placed upon a new line.
Actual result
At some point towards the middle of the text (or in longer documents, anywhere past line 15 to 25ish) the margin numbers to the left suddenly shift to become unaligned with the text. Additionally, any text which no longer fits the bounds of where the line numbers sit can no longer be properly interacted with.
Environment
Operating system: Google Chrome OS, Version 101.0.4918.0 (Official Build) dev (32-bit)
I have been dealing with this issue for a few weeks now and attempted to recreate it on my Windows PC to no avail. I would like to note that uninstalling Obsidian, deleting the .Obsidian files for this vault, and even power washing my Chromebook have done nothing to fix the issue.
Stumbled upon this after a Google search for this exact problem, and thought I’d share my solution in-case it’s useful to anyone…
My misaligned line numbers were due to custom CSS I had written and enabled. Navigating to Settings > Appearance > CSS Snippets should expose any custom CSS you have. Mine wasn’t all that necessary so I just disabled it.
It’s also possible a plugin you’ve installed is causing the behavior. To identify the plugin in question, you would have to disable all of them and then add them back one-by-one until the behavior occurs again.