Re: [code] [textadept] Textadept 7.3

From: Mitchell <m.att.foicica.com>
Date: Mon, 2 Jun 2014 15:33:59 -0400 (Eastern Daylight Time)

Ryan,

On Mon, 2 Jun 2014, Ryan Pusztai wrote:

> Hi Mitchell,
>
> On Mon, Jun 2, 2014 at 2:53 PM, Mitchell <m.att.foicica.com> wrote:
>
>> Hi Ryan,
>>
>>
>> On Mon, 2 Jun 2014, Ryan Pusztai wrote:
>>
>> Hi Mitchell,
>>>
>>> On Sat, May 31, 2014 at 11:20 PM, Mitchell <m.att.foicica.com> wrote:
>>>
>>> Hi,
>>>>
>>>> Textadept 7.3 is released from http://foicica.com/textadept
>>>>
>>>> Bugfixes:
>>>>
>>>> * Export Lua symbols correctly on Windows.
>>>> * Fixed occasional bug when double-clicking in the message buffer.
>>>> * Fixed an edge-case in word highlighting.
>>>>
>>>> Changes:
>>>>
>>>> * Added reST and YAML lexers and official language modules for each.
>>>> * Use `spawn()` for launching help.
>>>> * Renamed `io.set_buffer_encoding()` to `buffer:set_encoding()`.
>>>> * Removed Adeptsense in favor of autocompleter functions, but kept
>>>> existing api file format.
>>>> * Renamed `textadept.editing.autocomplete_word()` to
>>>> `textadept.editing.autocomplete``('word')`.
>>>>
>>>>
>>> I am trying to fix my key-bindings and not quite understanding what I need
>>> to pass to "textadept.editing.autocomplete('word')". I want it to
>>> autocomplete no matter what language is used. How would I do that from my
>>> 'keys.lua' file?
>>>
>>> This is what I used to have:
>>> -- Make Ctrl+Space the autocomplete key sequence.
>>> keys['c '] = { m_editing.autocomplete_word }
>>> What should it be?
>>>
>>
>> keys['c '] = {m_editing.autocomplete, 'word'}
>>
>> If a key is bound to a table, the first value is the function, and any
>> subsequent values are passed as arguments. You can also use this:
>>
>> keys['c '] = function() m_editing.autocomplete('word') end
>>
>> Both methods are equivalent.
>
>
> Oh boy it is the actual word "word", I feel dumb. You might want to mention
> that in the docs. It only says that you should pass the name of an
> autocompleter function in that parameter and I bet one is named 'word' :).

For future reference, it is always helpful to take a look at Textadept's
default *modules/textadept/keys.lua* file to see how a change was made.
When writing the CHANGELOG for 7.3, I figured someone who needed to update
their `autocomplete_word` binding would look and see how Textadept updated
it...sorry for not being explicit about it though.

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 02 Jun 2014 - 15:33:59 EDT

This archive was generated by hypermail 2.2.0 : Tue 03 Jun 2014 - 06:52:12 EDT