Re: [code] [textadept] Little problem with ui.dialogs.filteredlist

From: Giovanni Salmeri <g.salmeri.att.mondodomani.org>
Date: Sat, 27 May 2017 16:13:00 +0200

On Fri, 26 May 2017 18:36:48 -0400 (EDT) Mitchell <m.att.foicica.com> wrote:
> > Unfortunately, you've found a limitation :( The "--" prefix indeed
> > is interpreted as another command line option. The only workaround
> > is to avoid that switch and do some post-processing (e.g. use
> > "%--third" and then check for leading "%" after the dialog
> > returns). I'll add this issue to my list. Sorry about that.
>
> I've looked into this and it's not trivial to handle invalid "--"
> switches as plain text in the context of another active switch, so
> you'll have to stick to the workaround.

I've written this little function for handling this situation:

local function safe_items(items)
        local temp = {}
        for i,v in pairs(items) do
                temp[i] = '\u{200C}'..v -- zero-width non-joiner
        end
        return temp
end

and then

ui.dialogs.filteredlist{
...
                string_output = false,
                items = safe_items(table),
... }

For me it's OK. Thank you very much!

-- 
Giovanni Salmeri
http://mondodomani.org/pers/salmeri/
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 27 May 2017 - 10:13:00 EDT

This archive was generated by hypermail 2.2.0 : Sun 28 May 2017 - 06:33:37 EDT