Use Unicode emspace in the Editor

I just found this unicode emspace character that can be directly copy pasted into TW and show as a 4 spaces wide space. If you go to that link and simply click the empty black space on the left, you’ll copy the (invisible) character which you can then paste between two visible characters in TW to see how it appears. (It does not render correctly here in talk, only 1 space wide here.)

Actually, that’s a question; does it look like this also in your browser? I’m on win+brave/chrome.

Also, do you think there’ll be any problem to create a shortcut to make ctrl+TAB paste this character?

I am using FF 131,0b6 with Ubuntu 24.04 LTS and it looks like 4 spaces. So it is visible.

Technically you can input any character or text using the editor toolbar buttons. It only depends, how you configure them.

The main problem is, to use emspace for formatting tiddler text is the wrong way to go. Because if you copy paste that text into any other word-processing software, you will have those emspaces there too. It is very likely, that they mess up the layout there.

IMO the right way to implement body text indentation is to use CSS. – I did create a PR (which was rejected) a long time ago. – I’ll have a look if I can find it.

For me the em space looks like about 3.75 spaces (also Brave on Windows):
image

I think we should differentiate between two possible uses of “indentation”.

Formatting of rendered text
Here I see em space and en space as a quick and dirty way to introduce spacing somewhere without the need to tinker with CSS. I use it quite often when prototyping a template (and ideally use CSS finally), or if it is just some rare unusual situation where I want the spacing to just be there.
For this purpose, the em space is useful, but I always type it as  , so that it is clear what is happening. The literal em space character used in the editor can be quite confusing.

Indenting code
I’m not sure if this use was even intended, but since this was originally posted in the tab button thread, perhaps.
I don’t think this is useful for this purpose. Apart from the points mentioned by Mario, its appearance will depend on the font used, and what is even more important, it will look exactly the same as a single space if a monospace font is used. I think if anyone is working with code so often that they want indentation, they will almost certainly also want to use monospace font.

In any case, it is always good to be aware what tricks with certain unicode characters are available.
For example, if you excuse a tiny off-top, I keep an editor toolbar button with assigned shortcut Shift + Enter, which inserts <br>. Its the same shortcut that inserts line break in most applications on Windows.

Right. Interestingly, when I paste it into notepad++ I get another character (the generic “unknown character”) but if I copy-paste that back into TW it re-renders as the unicode emspace.

IMO the right way to implement body text indentation is to use CSS.

But how would that work/appear in the editor? A key use case is code indentation, but there must not be visible characters there, so the CSS would need to be applied onto the code itself. I’d love for the native TW editor to feature this.

And it is critical that the character is easily inserted. I’m currently using your setup (made into a plugin here) which requires a button click which is about how far I’m willing to go. The authoring process must not be interrupted by having to do magic stuff.

Right!

Also I just noted that the unicode emspace does not work in the beginning of a row which kinda kills the whole point… :-/

I think we should differentiate between two possible uses of “indentation”.
rendered text … [vs] … indenting code

Yes! Good point!

This is a good point.
Something else I would mention is maintaining accessibility.
I was using the tab key in the beginning for inserting &tab; characters (another alternative to inserting one of the whitespace characters), but since Tab is used for navigation both in and out of a browser window, I started using Ctrl+Space to avoid switching windows as Alt + Tab would.

:100:      

:100:
(wow, two in one thread)