Re: [code] [textadept] API changes

From: Mitchell <>
Date: Tue, 26 Nov 2013 00:15:11 -0500 (EST)


On Sun, 24 Nov 2013, Robert Gieseke wrote:

> Hi,
> there are a few proposals that I wanted to discuss before Textadept likely
> becomes a bit more "stable" after the 7 beta phase and upcoming book release.

To clear up any confusion, 7.x is the "stable" series; it's already solid.
The beta series served to cement the 7.x API for the book.

> * Line number start index
> Line numbers currently start at 0. There are good arguments for both 0- and
> 1-based indexing in programming languages but in the case of line numbers I'd
> prefer 1-based. It's apparently not easily possible in Scintilla[1] but maybe
> this could be done at the Lua side of Textadept?
> [snip]

I've explored this in the past. It would pretty much require a rewrite of
Textadept. The editor relies heavily on 0-based buffer structures. It's
not only lines that would have to change, but buffer positions, margin
numbers, marker numbers, indicator numbers, and style numbers too. No
small task. I am also slightly concerned about metatable performance with
`buffer` being such a heavily-used object. Also, buffers already have
metatables attached to them. I'm not sure if you can have a metatable for
a metatable for a table...

The book documents the 0-based vs. 1-based disparity.

> * More unified keys between platforms
> It's of course possible to change the keys but I think it would be nice if
> there were less differences between platforms (where possible). Possibly
> starting from the curses version would be best.

I am reluctant to overhaul key bindings. The last one was for 4.0 over 2
years ago. I feel the keys are quite consistent between platforms as is,
but I welcome any suggestions you have. Starting from the terminal
platform is limiting because it cannot recognize Ctrl+Alt combinations and
other combinations that vary based on the underlying system platform.

> * An annotation function
> Many language modules have an annotation function to show syntax errors. A
> centralised function would avoid writing this again in every module and could
> more easily be customized in behaviour. I find these annotations very helpful
> but I would prefer to never have my caret position changed, like already
> implemented in the Python module[2] (but not in the Lua module for example).

I think this is a good idea, without jumping the caret.

> * Rename lexers
> This might just be me, but I'd like to propose the following name changes:
> 'hypertext' -> 'html'
> 'Io' -> 'iolanguage' or 'io_lang'

This can probably be done. Hypertext is a relic from Scintilla but I think
we can move on from it.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Tue 26 Nov 2013 - 00:15:11 EST

This archive was generated by hypermail 2.2.0 : Tue 26 Nov 2013 - 06:25:26 EST