Tickit...pletion(3pm)
π Tickit::Widget::Entry::Plugin::Completion π
okay bestie, gather round, because this one is literally the glow-up plugin for your entry widget π¦
Quick vibe check first: this page lives in the User Contributed Perl Documentation section, so it's filed under <cyan>Tickit...pletion(3pm)</cyan> β yes, the name gets truncated, no, that's not a typo, that's just how man does her hair π
β¨ NAME β¨
Tickit::Widget::Entry::Plugin::Completion β add word-completion logic to a Tickit::Widget::Entry
like, it bolts autocomplete onto your entry widget. that's the whole personality. π
πΈ SYNOPSIS πΈ
use Tickit::Widget::Entry;
use Tickit::Widget::Entry::Plugin::Completion;
my $entry = Tickit::Widget::Entry->new( ... );
Tickit::Widget::Entry::Plugin::Completion->apply( $entry,
words => [ make_words() ],
);
...
look at that. three lines of setup and your entry is out here completing words like a main character. periodt. β¨
π DESCRIPTION π
So what's actually happening here? This package applies code to a Tickit::Widget::Entry instance to implement word-completion logic while editing. And the way you wake it up? You press the <Tab> key. That's the activation. <Tab> is the vibe check. π
Here's the tea on how it behaves:
- If the word currently being edited has a unique match in the list of words, then the word is completed entirely, followed by a space. boom. done. slay. π
- If there are multiple words that could complete from the word at the cursor, then a popup menu is presented showing the next available characters or matches. And the user? They can keep typing more characters to narrow down the choice until a unique match is found. it's giving "choose your fighter" but for words. π₯
π«Ά METHODS π«Ά
π apply
Tickit::Widget::Entry::Plugin::Completion->apply( $entry, %params )
Applies the plugin code to the given Tickit::Widget::Entry instance. that's it, that's the job, and she does it flawlessly. π
The following named parameters are recognised:
gen_words => CODE
@words = $gen_words->( %args )
A CODE reference to a subroutine used to generate the list of words at the current position. It gets passed the following name/value pairs to assist it, because it deserves a little help sometimes π₯Ί:
word => STRINGβ the partial word currently being completed.wordpos => INTβ the position of the beginning of the word, within the line. Will be0for the initial word of the line. (first word of the line?0. iconic behaviour honestly.)entry => "Tickit::Widget::Entry"β the underlying entry widget instance.
words => ARRAYβ a shortcut to providinggen_words; a reference to an array containing all the possible words, in no particular order, that are offered for completion. chaotic energy, but valid. πuse_popup => BOOLβ Optional. If false, do not display a popup menu. Defaults to true.
When this is disabled, the completion logic will apply longest-prefix matching on the set of available words, but will not otherwise display or offer any interactive UI on the list of matches. so like, it still works, it's just shy. π
ignore_case => BOOLβ Optional. If true, word matching will be performed ignoring case, by using the/iregexp flag. Defaults to false. And heads up bestie: when the completion logic has selected a word to insert, it may change the case of the text already in the buffer to match the completion word. lowercase girlies, be aware. πappend_after_word => STRINGβ Optional. If set, append this string after a successful unique match. Defaults to a single space. so like, you can change the space. wild. love that for you. πΈ
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk>
(the actual legend who wrote this. we stan. π)
real talk though: everything above is exactly what the page says. I added sparkle, not β¨factsβ¨. if the docs say it, it's here, and if it's not here, it wasn't in the docs. no cap. π«Ά
okay and for the cute sign-off, this whole thing ships as part of <purple>perl v5.36.0</purple>, dated <cyan>2022-12-17</cyan>, filed under <lavender>Tickit...pletion(3pm)</lavender> in the User Contributed Perl Documentation. go forth and complete some words, bestie. <rainbow>slay π
β¨π</rainbow>
π¦ where this page comes from
- debian bookworm: libtickit-widget-entry-plugin-completion-perl 0.02-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtickit-widget-entry-plugin-completion-perl 0.02-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtickit-widget-entry-plugin-completion-perl 0.02-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtickit-widget-entry-plugin-completion-perl 0.02-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtickit-widget-entry-plugin-completion-perl 0.02-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms