Re: [code] [textadept] LexerLPeg's references to Scintilla?

From: Mitchell <>
Date: Fri, 6 Sep 2013 23:11:01 -0400 (EDT)

Hi Chris,

On Fri, 6 Sep 2013, Chris Emerson wrote:

> Hi,
> I have a repeatable crash in my modified textadept where I've implemented
> split views for curses (
> It's almost certainly something I'm doing wrong!
> The sequence to reproduce (on my modified textadept-curses) are:
> 1. textadept-curses init.lua -- any file which triggers a lexer, I think
> 2. view:split()
> 3. gui.goto_view(1) -- switch to the other view
> 4. view:unsplit() -- back to one view
> 5. view:split() -- bang!
> The immediate cause is that something's happening to a LexerLPeg object which
> has a reference to the Scintilla object deleted in step 4 above. The top of
> the callstack is as follows (after that are quite a lot of Lua frames):

I've seen this before[1]. When the Scintilla object held by LexerLPeg is
deleted, you have to update the reference to an existing one using the
`private_lexer_call(SETDIRECTPOINTER, buffer.direct_pointer)` Scintillua
API. You just have to add the same line in the referenced changeset to the
`VIEW_AFTER_SWITCH` event too in `core/gui.lua`.

As far as a Lua stack trace from gdb, I don't know how it's done.
Debugging Lua is really tough :( I had to use `print()` statements in the
event emission code to determine if the above fix was valid.

What you are doing is awesome!



You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Fri 06 Sep 2013 - 23:11:01 EDT

This archive was generated by hypermail 2.2.0 : Sat 07 Sep 2013 - 06:54:50 EDT