Q. Don’t you think Tiddlywiki deserves a more powerful light native editor?
A. Absolutely yes!
I have always use CodeMirror as default TW editor, it has many features like: line number, highlight current line, syntax highlighter, autoclose brackets, customizable kemap, …
BUT, it is heavy! my customization shows it adds 500kB (when installed with subplugins).
CodeMirror is a professional editor and I belive this plugin and its subplugins shall be maintained and be avialable officialy for super users, developers and all other intrested users.
So, why not improve TW own editor to be used instead of CodeMirror in more simple usecases. When I use TW for note taking (not scripting) it is enough for me.
There are some tips and tricks and tools out there to be used
We have 3 areas that really should work in lock step, but don’t: Tiddler Body, Tiddler editor, and Preview. I use my own tool for setting the tiddler body font-size. The tool that we’re given in the configuration is cumbersome, and requires you to set the line height separately.
Then I store the font size in a tiddler, and use that to adjust the editor and the preview:
My wishlist is for a mechanism that will either automatically scroll the preview to the bottom or scroll it to the top so that you don’t have to keep lining up the editor and the preview.
I would like to see the native support to edit tiddler in a new window (e.g. http://sideeditor.tiddlyspot.com/), which is suitable for multiple monitor setup.
I have a installable that allows this, I just need to upgrade it since a recent tiddlywiki release broke it. I see however its value in remaining a plugin/package rather than core.
This also includes @Mohammad’s idea of an improved default editor, there is a strong argument if these changes introduce and additional overheads including bytes that they remain in a “core plugin” but a plugin never the less.
However I would also suggest when introducing such improvements allow the user to install and switch to the modified editor and toggle each of its features rather than a monolithic pre-configured solution.
The editor is one of the primary workspaces in TiddlyWiki and this should in my view be eminently customisable to support preferences for day to day work in a tiddlywiki.
I think auto-closing brackets should be already possible with the current editor. On my keyboard the opening bracket [ is created with ALT-GR + 8 .. So it should be possible to create a new keyboard shortcut that inserts the closing bracket. … May be the keyboard-widget may be used with a custom edit-text area. So no new buttons are needed. … Just a guess.
Creating a new syntax highlighter is the same thing as inventing the wheel again, because we do have CM already.
TW wikitext is a mixture of HTML, CSS and JS. … So to highlight wikitext “only” all of them will be needed anyway. .. So there won’t be a win, except a lot of new bugs.
Preview pane should scroll and match position with the editor pane.
This becomes an issue especially when you do transclusion. So your editor might only have a couple of lines, but preview pane might have hundreds of lines.
Or preview pane takes up more height due to CSS styling.
Sticky editor toolbar (there is already CSS for it in this forum)
Possible to move editor toolbar to the bottom (useful on mobile)
I don’t recall having provided a solution that display a different layout if the screen is in portrait mode, but I did share solution for flex editor/preview ! I can’t find it either so I redid it, with the screen orientation requirement :
I was not aware that there was an inconsistency here. Could you please explain how the behaviour is different and how it can be reproduced at https://tiddlywiki.com/prerelease/ ?