Writing wikitext code with open preview pane

With a tiddler open in edit mode, preview pane is a neat feature - I can see my wikitext code rendered live as I’m typing it, without having to explicitly save my changes to go back to view mode (the main inconvenience being that saving is slow for big single file encrypted wikis).

But as soon as a tiddler has a couple of function/widget definitions at the top, the actual wikitext code becomes much bigger than the rendered content. So when I’m writing my wikitext code that makes use of those functions below the function definitions, the right side which contains the rendered wikitext is empty - because the code I’m writing gets rendered above the visible preview pane area.

Ideally, I’d like an edit tiddler mode where rendered content could be aligned (line wise) with the wikitext that produces it (I’d still have to scroll back to function definitions to modify them), but is this even possible? Are there any other options for having a more comfortable wikitext writing experience other than defining functions/widgets in other tiddlers and using \import pragma (though this can only improve the situation rather than fixing it, since it doesn’t guarantee the desired alignment)?

I don’t believe it is… though you’re not the first to ask about it, e.g. Query: Is there an existing solution to Preview Alignment?

I always set my wikis to use the fixed-height editor, which will restrict both your code and preview windows to the specified height. The major advantage is that both sides scroll independently, so you can keep the rendered content in line manually, at least.

image

3 Likes

Thank you, this addresses my itch perfectly.

At the moment the TW parser only knows start / end character position related to the internal parse-tree. There have been some discussions for a “debug” mode, which would render some of that information into the (preview) DOM – But that still does not create a connection between the edited line number and the preview area.

So we would need quite some mental work to be done, to create that connection in a simple algorithmic way. It’s a matter of resources.