On Fri, Mar 2, 2012 at 11:47 AM, Uli Schlachter <[email protected]> wrote:
> On 21.02.2012 16:47, Anurag Priyam wrote:
[...]
>> Lua's C stack based API is not very intuitive (or maybe I haven't got
>> a hang of it yet).  Hope I have got it right.  The patch does seem to
>> work here.
>
> This patch broke awful.prompt. The keygrabber never gets stopped. I guess 
> that's
> because the "return false" in that code gets ignored, but it should already 
> have
> called keygrabber.stop() before that. Let's see if this can be figured out...

Right, keygrabber doesn't stop if you press 'Escape' to close the
prompt.  awful.prompt is quite messy that way: a giant (>200 lines) of
callback to `keygrabber.run` with too many return true and false.
That's why I have been postponing a patch to replace all `return
false` with `keygrabber.stop`.  I wonder if a better approach would be
to do something like:

    capi.keygrabber.run(function ()
        if not grabber() then capi.keygrabber.stop()
    end

Where `grabber` is the old callback.  But if I have to define
`grabber` before `run`, the diff will probably be very ugly: a giant
code block moved from here to there :-|.

What do you think?

-- 
Anurag Priyam

--
To unsubscribe, send mail to [email protected].

Reply via email to