[code] [textadept] API changes

From: Robert Gieseke <rob.g.att.web.de>
Date: Sun, 24 Nov 2013 15:15:01 +0100

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.

* 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?
Something along the lines of

events.connect(events.BUFFER_NEW, function()
   local buffer_goto_line = buffer.goto_line
   buffer.goto_line = function(buffer, line)
     buffer_goto_line(buffer, line - 1)
   end
   setmetatable(buffer.line_indentation, {__index = function(t, k)
       return t[k - 1]
   end})
end)

for all line-number related functions.

For properties like 'first_visible_line' I don't know how to do it, but
it should somehow be possible as these are separate get/set-functions I
think.

* 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.

* 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).

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

As always I'm happy to provide more detailed patches if you find a
proposal worth looking into …

Thanks,
Robert

[1] https://groups.google.com/forum/#!topic/scintilla-interest/6y-9luHdULc
[2] http://foicica.com/hg/python/rev/ec31ba527326

-- 
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 Sun 24 Nov 2013 - 09:15:01 EST

This archive was generated by hypermail 2.2.0 : Mon 25 Nov 2013 - 06:37:11 EST