Mat,

My showcode demo is a still a few hours away for putting online, otherwise 
I would confuse people.

Anyway, I obviously don't know anything about this.


Not true, its just what I am looking for is a subset of this larger 
question.  
The cursor position on a plain text un-rendered view, which should be 
easier and there is a one for one match between positions.

To summarise my smart showcode utility makes a good guess if the content of 
the tiddler is code rather than something to render, such as ones macro 
definitions, using a number of qualities, if it is a "code tiddler" it 
displays that code as plain text. For example open a system tiddler that 
has not being edited and you get a plain text display you can select and 
copy from without "editing the tiddler" just to see the content, To avoid 
unnecessary edits to shadow tiddlers, you need to explicitly use the edit 
button to edit it. 

If however you open an overwritten shadow tiddler, or a code tiddler of 
your own making, you see the plain text (show code view) and have a click 
to edit feature. It is this click to edit I would like to allow to 
determine where in the plain text view you click, and restore the cursor to 
that position in the edit view.

Advanced search and Control panel as examples, are system/code tiddlers you 
want rendered, so I provide a way to override the showcode not to display 
on these.

So say I am looking through core code to find the actions message or widget 
used to do something, I search system tiddlers and get three hits, so I 
open these three, and they are all readable at first glance because they 
are code tiddlers. I find the action widget I was after and select and copy 
the code, now I return to my own code tiddler, the one I am developing, 
scan through to find where I want to insert the code and click exactly 
where I want, to insert the new action, and click, the tiddler goes into 
edit mode and the cursor is where I clicked, ctrl-V to insert and I am 
done. 

Perhaps one day one could even insert in that position without going into 
edit mode. This would allow drag and drop coding nice and easy.

To make this even easier, I would add the search highlight plugin to help 
in the code search.

I hope this explains the use case?

Regards
TW Tones


On Sunday, July 12, 2020 at 11:42:36 PM UTC+10, Mat wrote:
>
> Well, putting the caret at correct position in the editor is what I was 
> talking about too. But i figure the position in the editor needs to map the 
> position you're clicking at in view mode - so you need a way to decide 
> where that is. Anyway, I obviously don't know anything about this.
>
> using a custom view template on tiddlers that contain macros etc but 
>> viewed as we view in edit mode, unrendered.
>>
>
> A viewtemplate that show the wikitext code... OK so for it to be useful, 
> how do you go from normal edit view into this view? And is that 
> simpler/faster than to just find the location the manual old fashioned way? 
> Because that is the goal, right?, to quickly access a specific position in 
> the editor.
>
> <:-)
>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/b8581946-97c3-45fc-a80a-54574564c941o%40googlegroups.com.

Reply via email to