Auto Complete plugin 1.0.15 - Complete tiddlers, fields and your dreams

A question and a suggestion

To use the Auto Complete with macros, one has to write complex filter to find the macros, the complexity comes from

  1. a tiddler tagged with $:/tags/Macro may have several macros
  2. not all macro headings are on a single line
  3. there are several forms of defining attributes
    4, …

Suggestion
What do you think if one can have a utility tiddler or a data tiddler define all macros to be used with Autocomplete in some predefined format, then the Auto Complete scan this tiddler for macros autocompletion.

This solution also can be extended to templates autocompletion (Auto Complete will trigger automatically after inserting || and all templates can be defined in a data tiddler)

Last suggestion

It worth to make Auto Complete compatible with themes! So, the highlight, link and background should follow theme colors.

It should be doing so already, it takes the colors from the current palette:

If you’re having another issue with styling can you give me a bit more context? Perhaps the theme you’re using is not pulling the colors from the theme in which case I am not sure if there is anything I can do about it.

You can already use a data tiddler as a source for suggestions as the with the emoji: and color: triggers. I don’t understand how it would be different from doing so.

Unless your suggestion is to have some kind of smarter auto completion, where it would intelligently allow completion of macro arguments and their values? In which case that’d be beyond the scope of this plugin at least for any foreseeable future, that’d be a lot of work to accomplish.

I’ve got it figured out! It is caused by me incorrectly configuring before/after requirements for a startup script. You have Twitter plugin installed which causes startup module to be executed late (because Twitter wants to execute before it) and my script depends on this module being already run, which I didn’t express correctly in the plugin’s requirements. Long story short, one line change I need to make and it will work fine – expect a new version later today :).

1 Like

Grand… I’m glad you got it sorted without too much difficulty. I’ll give it another go in due course.

I seem to have been breaking a number of things recently :grinning_face_with_smiling_eyes:!

Many thanks and take care.

1.0.12 is out:

  • Using mouse for Auto Complete now works in tiddlers opened in a separate window
  • No longer crashes when using together with a Twitter plugin or any other plugin which delays the execution of the startup module
  • This plugin now takes preference over codemirror-autocomplete and will prevent the code mirror Auto Complete from opening at the same time as this
  • Various small fixes and tweaks to problems introduced from 1.0.9 to 1.0.11.

This is fixed now!

Gruvbox dark [Not good]

Cupertino dark [Not good]

Desert sand [Good]

Twilight [Almost goog]

Vanilla [Good]

It seems the issue with themes themselves not with Auto Complete! But as you see in some cases the contrast is not enough for highlighted item!

I have seen these examples before. I give a try! I see 1.0.12 has macro example

But yes, scanning the macro tiddlers is a bit complex as there are flexibilities in defining macros.
So as I explained above I thought to use data tiddler.

Your color: example is a good point to start. We can use the same strategy for example typing << or macro: triggers macro autocompletion and selecting list-links inserts <<list-links tiddler:"" field:"" emptyMessage:"" type:"ul" subtype:"li" class:"" itemTemplate:"">>

Thank you

Thank you, sir. I can confirm mouse operation is as expected and advertised. I have made the decision to start using your plugin day-to-day instead of edit-comptext. The biggest selling point for me is the ease of configuring additional triggers. Very well done. Looking forward to seeing more of your work!

Thank you from another former edit-comptext user! I doubt it was one of your intended use cases, but I’m also seeing a lot of potential for building a custom autocorrect. I use a handful of proper nouns with non-keyboard characters, and I’m really looking forward to never needing an alt-code again.

Indeed, a lot of the palettes have terrible contrast in certain circumstances – I talked a little about it in this Issue I raised. I can’t really do anything about it, my best suggestion is to tweak the colors of the palette…

… Or I guess I could also add an option to toggler between using background color for selection and maybe outline CSS property. Hmm.

Thank you! I also have another plugin that’s as polished as this one called Task List which I am particularly proud and fond of, but its usability is not as general as this.

I didn’t but that’s why I made it so generic – so that it can be used for wild purposes! A word of warning: typing might slow down a little if you have hundreds of triggers, particularly if you use Code Mirror, and the options UI isn’t really suited for that many triggers. I hope you plan to either have only a handful of them or have a generic one that uses a dictionary as a data source and is triggered by something like fancyword: or something :slight_smile:

1 Like

Thank you @Maurycy
I started using Auto Complete on my daily notes and some research project wikis.
I will return to you with feedback.

@Zheng_Bangyou
I remember you adopted autocomplete from TW5-extendedit for Refnotes.
What do you think to switch from TW5-extendedit to Auto Complete which is much easier to configure for intermediate users?

1 Like

7 posts were merged into an existing topic: Community Curated AutoComplete Triggers

Wonderful! Thank you @Zheng_Bangyou
Works like a charm on TW5.2.3+Refnotes 1.8.3 + Auto Complete 1.0.12

1 Like

@Maurycy Is it possible to configure the popup so that it automatically closes (without making a selection) when I type ]]? I’ve been doing a moderate amount of linking to tiddlers that don’t exist yet, and it’d be very handy if the popup could just get out of my way once I’ve closed a link.

I can’t hardcode it to react to ]] as the cancel statement because that wouldn’t be very flexible but I’ve been pondering this issue for a while. I’ve been thinking about these possible solution:

  • Distance from last valid suggestion: basically you define a number, and if you type that number of characters since getting “No results” then it automatically closes.
  • Cancel Triggers Filter: A filter that returns a list of triggers that, if detected, will cancel Auto Completion. This way one could define something like: [[ ]] [<rb>addsuffix<rb>] to automatically close suggestion if a space or ]] is typed (I’d expose <lb> and <rb> as variables that contain [ and ] respectively)

Perhaps both of them should be implemented.

A small hack you can use for now is if there are no results typing enter will (should!) just stop auto completion without anything being changed or inserted.

1.0.14 is out:

  • Fixed a bug where navigating through auto completion would still trigger TW’s keyboard widgets eg. navigating auto completion in sidebar search would also change selected search result
  • The list of suggestion can now be scrolled down using the keyboard.
  • Added caption to triggers to improve how they are displayed in the settings

Both were suggestions from @Mohammad posted on Github here and here.

4 Likes

Oh man, this is great! Encapsulate all snippets as Auto Complete :wink: This saves users from many scrolls up and down and or opening the editor menus and search.!

I am thinking we can also have a trigger for inserting images instead of clicking the image button on the editor toolbar…

The demo does not work, I assume you need to attach one oe two tiddler tagged with $:/snippet. If you don’t mind, please revise the original post!

Example in the original post is updated.

1 Like