Re: [code][textadept] 10 beta: default lexer of new buffer

From: Peter Rolf <indiego.att.gmx.net>
Date: Tue, 29 May 2018 15:58:29 +0200

Am 2018-05-29 um 15:38 schrieb Mitchell:
> Hi Peter,
>
> On Tue, 29 May 2018, Peter Rolf wrote:
>
>> Hi Mitchell,
>>
>> just noticed that the lexer is not set directly after a new buffer is
>> opened (ctrl + n). Calling 'ui.print(buffer._lexer)' in the command
>> entry gives 'nil'. It is set to 'text' after you temporary switch to
>> another buffer and come back. Is this intended behaviour?
>
> `buffer._lexer` is undocumented and used internally. You cannot depend
> on its contents at any time. Instead, use `buffer:get_lexer()`, which
> should always give the correct result.
>
> Cheers,
> Mitchell

Thanks for the quick reply, will do so :D

-- 
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 Tue 29 May 2018 - 09:58:29 EDT

This archive was generated by hypermail 2.2.0 : Wed 30 May 2018 - 06:32:11 EDT