Indentation that’s is mixed between what appears to be a combo of 2 & 4 spaces, although not entirely clear what’s happening.
Environment
Additional information
SYSTEM INFO:
Obsidian version: v1.5.3
Installer version: v1.4.13
Operating system: Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:45 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6020 23.1.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
I also tried with smart indent lists off/on but it’s still not working right.
I notice the fold lines are showing for ~4 space divisions. There should be fold/nesting lines for every level (i.e. every 2 spaces).
This bug was introduced in a recent update (approx December 2023), previously this worked correctly.
When testing this just now I noticed that the indentation behaviour was different (more inconsistent) when typing the list vs pasting all items in one go. So there may be some smart code misfiring when typing line by line.
I suspect there’s an assumed indent level of 4 somewhere in the code that needs to be updated to use the values from preferences.
As I mentioned in another thread (now - a duplicate of this one) I believe I read in the Markdown specification, that one should use either tab or 4 spaces for indentation of lists.
I can try to find where I read it exactly.
So why 2? or 3? I think it’s not very useful to use these values at all. I’d just remove the corresponding configuration.
P.S. Of course I understand that you can have lots of notes with say 2 spaces. I myself have thousands of them
Unfortunately, when you use spaces the situation is much more complicated than that. The number of spaces that need to be used depends on the length of the identifier. Two spaces are enough to indent a bullet list but not enough to indent a number list. There is also a maximum number of spaces after which it should be interpreted as codeblock.
1 tab or 4 spaces is a safe setting within the spec but the spec itself is more flexible than that.
The original spec says you have to indent 4 spaces to maintain multiple paragraphs within a single list item but does not specify indentation for sublists. CommonMark does not specify indent width but defines it relative to the marker. I use 2 spaces because 1. that’s how I write my JavaScript because 2. that’s prettier’s default indent width.
This affects both lists and normal indented text, but in different ways.
I tested a bunch of different configurations. Here are some screenshots and findings
Turning off indentation guides does seem to fix many of the issues
The Tab Indent Size seems to have no effect on lists when Indent Using Tabs is on, even though it states Number of spaces a tab character will render as. Lists with tabs always render 4 spaces.
Specifying a tab size of 2 and 3 produce different types/levels of jankiness
Specifying a tab size of 4 displays correctly
Specifying a tab size of more than 4 seems to have the same effect as 4
the setting of “smart tabs” seems to affect things as well
Being able to decrease the visual indent (either by using actual spaces of 2 or 3, or by using a tab that takes up less space) is one of the more important features of a text editor or note app for me. I often organize notes, ideas, reference information, etc, using multiple levels of indentation (typically no more than 4), but having 4 spaces for each level means that there is very little horizontal space left for the content at deeper levels.
Enabling indentation guides breaks everything for me now, even with Tab indent size of 4, and Indent using tabs disabled.
Without guides:
With guides:
The cursor jumps between the points marked with red by one press of the left or right arrow key (like if the first non-space character of the line got a huge padding to the left of it).
Basically, the guides are unusable at this point with any setting.
This bug has been driving me crazy for months, because it can be fairly intermittent, and sometimes I’ll make it look perfect in Obsidian only for it to be wrong on disk.
Indenting unordered lists by 2 spaces is extremely common since it’s what looks aligned in ASCII, and it’s in GitHub’s version of the spec.
Disabling Indentation Guides does seem to help, but it’s definitely a bug