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

From: Mitchell <m.att.foicica.com>
Date: Tue, 29 May 2018 09:38:54 -0400 (EDT)

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

-- 
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:38:54 EDT

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