Re: [code] Odd behaviour in v9.1 split views

From: Michael Richter <>
Date: Sat, 4 Feb 2017 00:26:24 +0800

Mitchell, this was at most about three hours' work once you pointed me in a
possible direction. Given how much work Textadept has *saved* me over the
years, I count myself lucky! Thanks, again, for the huge amount of work
you've put into what has become my default editor of choice on any GUI
platform. (I'm afraid I still use Vim for purely textual environments.
Force of habit.:D)

For the lexer, perhaps having a logging subsystem that code could write
into on errors? Then there could be a View->Log that opens a buffer with
the log entries in it. So when something goes wrong, looking at the log
buffer could be the first step in debugging it.

(Of course this would imply code starting to log errors instead of/in
addition to whatever error handling is already in place, but that's
something that can be done incrementally.)

On 3 February 2017 at 22:59, Mitchell <> wrote:

> Hi Michael,
> On Fri, 3 Feb 2017, Michael Richter wrote:
> OK, solved my particular issue, but it brings up the old problem of error
>> reporting in lexers.
>> Basically if the lexer is invalid for any reason, Textadept just throws up
>> its hands and gives up. In this specific case, though, it throws up its
>> hands and gives up in a hissy fit that screws with the formatting of all
>> subsequent view splits, etc. in perpetuity. And the reason I didn't
>> notice
>> this is because Textadept doesn't deign to inform me when a lexer is bad.
>> My gas lexer was an old one (pre-8.0, IIRC) that I hadn't updated to take
>> into account some of the changes to the lexer support. To wit, I had a
>> module (lexer_tools) that I used to provide me with some decently-named
>> functions in place of the complicated and vaguely incoherent LPEG naming
>> conventions. (E.g. local maybe = function(p) return p^-1 end). As of 8.0
>> these stopped working ... when in separate modules. So this code sequence
>> always failed:
>> local lt = require 'lexer_tools'
>> local maybe = lt.maybe
>> ...
>> --[[do something with]] maybe(P':') -- and so on
>> But if I take the maybe function from lexer_tools and put it into the
>> lexer's source file it all works as expected.
>> Now I hadn't touched gas code in a while, so I didn't update the gas lexer
>> -- and I forgot about that issue. The malfunction was triggered by
>> invoking the (broken) gas lexer. The solution was to manually bring in
>> those lexer_tools functions.
>> Would it be possible to get some kind of error reporting from the lexer
>> instead of the current silent failure? It would make debugging these
>> kinds
>> of problems much simpler.
> Yes, that is a good idea. Sorry for all the trouble :( I do very much
> appreciate the time you've taken to identify the issue. I will look into a
> better way to report lexer errors and prevent downstream issues.
> Cheers,
> Mitchell
> --
> You are subscribed to
> To change subscription settings, send an e-mail to
> To unsubscribe, send an e-mail to

"Perhaps people don't believe this, but throughout all of the discussions
of entering China our focus has really been what's best for the Chinese
people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Fri 03 Feb 2017 - 11:26:24 EST

This archive was generated by hypermail 2.2.0 : Sat 04 Feb 2017 - 06:51:08 EST