Hiya Mat, Checking to see if you saw the demo I posted for you?
You may or may not like the implementation approach, but I think it addresses most of your concerns and potentially has ideas that might be beneficial in whichever implementation you decide to pursue. You get full access to variables like currentTiddler; there are improvements that let you know exactly where the text caret is, so you can ignore text before or after, and I tweaked your popup code so that it doesn't give multiple results if there are multiple unclosed link brackets .... amongst other things. Still lots more room for improvement, like only showing a popup if the triggers are found, rather than showing an empty popup (not visible) if there are no trigger matches. Cheers, Saq On Sunday, July 5, 2020 at 6:12:10 PM UTC+2, Mat wrote: > > Attention Jed, but really anyone who agrees EditorMagic > <http://editormagic.tiddlyspot.com/> is a worthwhile concept (i.e to > access *anything* directly as you're typing): > > EditorMagic will not work unless someone helps out with to either tweak > Jeds "poupup at caret position plugin" or create an alternative > implementation, i.e: A plugin that floats a tiddler at caret position in > the editor. Below I describe some of the problems with the plugin and what > is required for a real use case like EditorMagic. > > I set up Popupissue <http://popupissue.tiddlyspot.com/> for this issue > and for testing, which is a much scaled down version of EditorMagic, > limited to "title picking". Beyond Jeds plugin, Popupissue is basically > limited to a single code tiddler (the popup content) and should not be > difficult to understand. Briefly; it ensures the edited tiddlers text > contains the trigger string [[ and identifies the "fragment", i.e [[*this* , > and lists all tiddler titles with that prefix. Each listed title is really > a button and clicking it inserts the [[title]] in the text. > > So, as seen in Popupissue <http://popupissue.tiddlyspot.com/> the current > plugin is insufficient in these regards: > > - There is no currentTiddler variable accessible in the popup. Thus > I'm forced to use "[list[$:/StoryList]prefix[Draft]]" (which is > ambiguous). > - I would assume this is also why having two tiddlers in edit mode and > typing [[t in the top one and [[E in the second one still only shows > the popup content for [[t in both. > - Within a tiddler, it is desirable if the popup differentiates > between the fields, i.e currently if the popup shows from typing e.g > [[t then if clicking in the title field, the same open popup will move > up to there still showing the results for [[t > - The plugin seems incompatible with TWs Editor Toolbar, i.e the > Editor Toolbar must be switched off in the Ctrlpanel settings. > > > A note: If I understand @Jeds plugin it calculates the caret position > relative to the viewports upper left corner. Maybe it would be possible to > calculate it relative to the tiddlers corner? ...and maybe this would > resolve most of the bulleted issues auotmatically as they are all relative > to the tiddler both in terms of position and in terms of currentTiddler > reference. > > - @Jed, anyone? > > Thank you all! > > > <:-) > > > > ----------------------------------------------------------------------------------------- > > Reference > > - @Jeds solution is found here: > https://ooktech-tw.gitlab.io/plugins/caretposition/ > - Also @Snowgoon's Text'nEdit > <https://github.com/snowgoon88/TW5-extendedit> (basically a "title > picker") calculates the caret position: > > > https://github.com/snowgoon88/TW5-extendedit/blob/master/plugin/files/cursor-position.js > - Both of those are based on: > https://github.com/component/textarea-caret-position > > > -- 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/d29b9ace-8990-4b59-b8a6-d2343bd258ffo%40googlegroups.com.
