Currently, most of the typing assistance that Obsidian provides do no make sense or actively gets in the way when writing within a codeblock. For example, auto-pairing of markdown symbols (like bold), link suggestion [[, tag suggestion #. Also unlinked mention should not be picked up (here).
Proposed solution
All these typing assistance tools should be deactivated while typing within a codeblock.
Notes
This FR is a simplified version of this other FR that asks for type-dependent behavior.
I would also appreciate this. Bash code blocks keeps trying to change my text in double square brackets such as ‘if [[ $var = “some text” ]]; …. Etc. it’s quite annoying.
Not sure if “me too” posts are welcome here or not, but I would also like to see this happen - either “always”, or have a preference which disables all forms of typing “assistance” within code blocks.
I am simply baffled that this has not gotten more attention. Most likely because people with hit separate problems and will not connect them to this feature request. I was actually considering making a bug report as obsidian’s code block is clearly not a code block. Discord, Bear you name it has a code block but obsidian does not as long as markdown typing assistance is messing with it.
Just to show how frustrating this is here is an example how obsidian behaves:
Oh my god, I’m super pissed off. This issue basically makes Obsidian unreliable. It distorts the inserted content to its own liking and does so in an egregious way.
I make a sublist:
1. List item
2. List item
1. Sublist item
2. Sublist item
Obsidian turns 1 and 2 in the sublist into 3 and 4 distorting my intention.
And even if I write it in code, the conversion still happens. Even if it’s a JavaScript code!!! This is beyond all things imaginable.
And it’s not even in the reading mode, it gets its way into the source and gets saved into the file in this way! Why this distinction between two modes then?
In code blocks, I often need to type a # and hit enter. I do that to produce a # and then a newline. Instead, I get a # and some random word of Obsidian’s choosing. This frequently trips me up.
Proposed solution
There could be a setting: “disable tag autocomplete”. This is the common solution in other text editors that autocomplete, because popping anything up while one types is disruptive — there must be an option to opt out, or distraction-free writing is impossible.
Current workaround (optional)
I could probably use a custom CSS snippet to forcibly hide the popup. There is no workaround for non-technical users.