Configuring CodeMirror (specifically, setting smartIndent to false)

The smart indenting in codemirror is annoying. In joplin it defaults to inserting a tab and not spaces (even more annoying.

<!-- the TAB before the </div> was automatically generated -->
<div>
<div>
	</div>
</div

CodeMirror has a "smartIndent" true/false switch.
https://codemirror.net/5/doc/manual.html

Is there some access to CodeMirrors settings in the .config/joplin-desktop or .config/Joplin? If there is, I did not find it. And if not, ... RFE. Can we turn this off somehow?

Thanks. -t

I'm not familiar with other ways that may exist to configure CodeMirror, but I have a plugin - Space Indenter - that exposes relevant CodeMirror settings to the user. At the moment it allows one to switch to indentation with spaces and to define the default indentation size. I can add smartIndent support in the next version as it seems associated with the plugin's main objective.

Oh! Nice! Yes ... spaces > tabs. So, that is welcome. But, indeed, I would love to just be able to turn the darn indenting off. If you could add that, that would be welcome.

Thanks!
-todd

done

3 Likes

I shed a little tear.

Thank you.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.