Hi Mat, > But I'm curious: even for pre-made popup tools, the system will still have > to know if <$widget foo> is closed or not. So how is the fragment end > detected? In the EditorMagic/_Popup it is defined to be the "whole string" > after the trigger until a trigger-end... but it seems your code defines the > fragment as after trigger until caret. Is that correct? ...in which case I > should remove the trigger-end check... but then, "until caret" can mean the > *rest > of the whole tiddler text*...? >
You have lost me here. When you refer to my code, do you mean the wiki text changes? Or the insert-completion parameter to the message? The wiki text after my modifications was largely as you had it. The insert-completion code does indeed only replace a string before the caret, which makes sense because why would you be typing and want it to replace something ahead of what you are typing? I don't quite understand the problem you are forseeing. If you look at https://saqimtiaz.github.io/sq-tw/editormagic-popup.html#EditorMagic%2F_Popup your first list filter has a *[!search::regexp<triggendexp>] *that ensures we only look at incompleted widgets. All the wikitext changes I made are related to *replacing the incomplete string* with the completed one, *not* to do with detecting it. OK well, I did make sure we don't get results for incompleted links but that should not be relevant. *I don't see why you need to change anything from how it is now*. The detection code is from trigger start to trigger end, the replace code doesn't care about trigger end, its a generic "replace this string just before caret with that string" kind of operation. Have you run into any issues? > BTW, is there something more that can be done to align EditorMagic with > your floating editor toolbar? > They both make tweaks to some core widgets, so we need to make sure they can at the very least co-exist. However once again, I think the time to do that is once EditorMagic is more stable as things most likely can and will change. I have also identified some areas of the core that need patching for greater flexibility. Beyond that, I am not sure how much I will do with the floating toolbar. Maybe a Streams addon at the most. I am extremely reluctant to release more plugins. As previously stated, my availability for the TW community will always be erratic and sporadic. I have my fingers in too many pies already and releasing plugins comes with a maintenance commitment. The intention behind the demos I share is to hopefully inspire/provide ideas and techniques for others to follow. > One problem is for EditorMagi/WidgetDocs - wich uses a selectwidget - and > for EditorMagic/TransINclude - which shows an editor - the popup *loses > focus* as soon as the selectwidget or editor is touched. Any ideas for > this? > Recall that the popup is a standard core RevealWidget, so it closes when you click on it unless, you also give it the class tc-popup-keep. Adding that class will fix that issue, but it will mean the popup doesn't close when you choose an autocompleted title. I recommend you add the class and leave the non-closing popup as a future issue. I have another set of changes in mind that we need to make, and that will be a good time to tackle this. Note that the ??tr present at the beginning of the tiddler adds a transclusion portion to every other popup created. This seems to not be an issue with an incomplete link or widget, but with ??tr so perhaps its limited to those with no end-trigger? Also, one of the issues I fixed in your wikitext code was the tiny grey box that shows when there is no active popup, e.g. type: "[Edit ". This seems to be back. Looks like you missed some bits when integrating my code from https://saqimtiaz.github.io/sq-tw/editormagic-popup.html#EditorMagic%2F_Popup <$list filter="""[<text>search<trigger>removeprefix<before>] +[!prefix[ ]splitregexp<triggexp>] +[!search::regexp<triggendexp>] +[last[]]"""> <$set name=fragment filter="""[<currentTiddler>]""" select="0"> <$list filter="[<fragment>minlength[1]]"> <$list filter="[all[tiddlers]prefix<fragment>count[]!match[0]]" variable="_NULL"> <div style="background:white; border:1px solid silver; padding:0 5px;"> There are some changes I think we need to make next, to the order of the wikitext code that controls triggering the popup. However, I will wait for you to work out the issues discussed in this post and properly integrate my previous changes before I get into that. Cheers, Saq -- 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/995d3056-389b-4714-946a-8eef5ed4b84eo%40googlegroups.com.
