Re: [textadept] I'd like to alter AutoPair's behaviour for some files

From: mitchell <c....at.caladbolg.net>
Date: Tue, 7 Dec 2010 15:29:16 -0500 (Eastern Standard Time)

Robert,

> events.connect('buffer_after_switch',
> function()
> if buffer._lexer == 'lua' then
> _m.textadept.editing.AUTOPAIR = false
> else
> _m.textadept.editing.AUTOPAIR = true
> end
> end
> )
>
> Mitchell,
> I tried this with buffer:get_lexer(). This caused Textadept to hang
> when I opened a new file. Is there something that needs to be checked
> additionally in this "private_lexer_call", whatever that means?

This is a bug and will be fixed in hg later today. It has to do with the
"buffer_after_switch" event being emitted before "buffer_new". The
mime-types module uses "buffer_new" to add the get_lexer function. Since
"buffer_after_switch" references it before it exists when a new buffer is
opened, an infinite recursion of errors happens.

mitchell
Received on Tue 07 Dec 2010 - 15:29:16 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:55:17 EST