Re: [code] Small addition to snippets

From: Pedro Andres Aranda Gutierrez <paaguti.att.gmail.com>
Date: Mon, 12 Nov 2018 18:06:47 +0100

You see... I’m very lazy, so I trigger thede things... ;-)
I’ve just tried and yep, seems to be enough

/PA

Enviado desde mi iPhone

> El 12 nov 2018, a las 17:21, Mitchell <m.att.foicica.com> escribió:
>
> Hi Pedro,
>
>> On Mon, 12 Nov 2018, Pedro Andres Aranda Gutierrez wrote:
>>
>> Hi,
>>
>> maybe because I'm caótico, I sometimes quit a snippet prematurely. This
>> blocks the editor with a message of the likes that ph is nil and can't be
>> indexed in the message buffer.
>>
>> Here's a quick&dirty fix for it:
>> +++ snippets.lua 2018-11-12 11:47:57.000000000 +0100
>> --- snippets.lua.orig 2018-11-12 11:52:51.000000000 +0100
>> @@ -551,14 +551,9 @@
>> end
>> local id = buffer:indicator_value_at(M.INDIC_PLACEHOLDER, s)
>> local ph = snapshot.placeholders[id]
>> + if not ph then
>> + -- ui.print(string.format("snapshot.placeholders doesn't have %s as
>> index", id))
>> + return nil, nil
>> + else
>> + if (not index or ph.index == index) and (not type or ph[type]) then
>> + return s, ph
>> + end
>> + end
>> - if (not index or ph.index == index) and (not type or ph[type]) then
>> - return s, ph
>> - end
>> s = buffer:indicator_end(M.INDIC_PLACEHOLDER, i)
>> end
>> end
>
> Is it sufficient to make the `if` conditional `if ph and (not index or ph.index ...`? I wasn't able the trigger the problem on my own.
>
> Cheers,
> Mitchell

-- 
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 Mon 12 Nov 2018 - 12:06:47 EST

This archive was generated by hypermail 2.2.0 : Tue 13 Nov 2018 - 06:50:41 EST