Re: [textadept] question and remarks

From: mitchell <c....at.caladbolg.net>
Date: Sat, 11 Jun 2011 08:18:17 -0400 (EDT)

Anton,

On Sat, 11 Jun 2011, anton wrote:

> Hi all,
>
> I would be very grateful if somebody could help me with the following
> issues
>
> 1. non ASCII in status bar
>
> Are there some good ways to write non ASCII (below 255) characters to
> the status bar
> with their codes?
>
> If I try
> gui.statusbar_text = '�'
> it ok. But
> gui.statusbar_text =string.char(195)
> gives some weird character.
> Well, this
> '�' == string.char(string.byte('�'))
> is also false

The Lua manual for string.byte and string.char states:

"Note that numerical codes are not necessarily portable across platforms."

This is probably caused by locales, but I'm not precisely sure.

> 2. buffer.word_start_position (and buffer.word_end_position)
>
> If you have something like (two space between c and d)
> "abc def"
> in the second line (first line is empty) then
> buffer:word_start_position(buffer.current_pos)
> buffer:word_end_position(buffer.current_pos)
> give
> caret before a : 0 4
> caret between a and b: 1 4
> caret between b and c : 1 4
> caret after c : 1 6
>
> I would expect that all four should give 1 4
> This can be indeed achieved by setting only_word_chars to "%a".
>
> Is this strange behaviour a bug or a feature?

http://www.scintilla.org/ScintillaDoc.html#SCI_WORDENDPOSITION

> 3. user_list_selection (wParam, text)
>
> IM{VERY!}HO the already used values of wParam could be stored more
> transparent .
>
> cf. textadept/keys.lua
>
> local RECENT_FILES = 1
> events.connect('user_list_selection',
> function(type, text) if type == RECENT_FILES then io.open_file(text)
> end end)

Just use a very big number in-case you are unsure :) I agree they should
be more transparent though. However, it appears only the number '1' is
used. A good rule of thumb is to use 10 and up. I would reserve the right
to use anything less than 10 for stock ta.

mitchell
Received on Sat 11 Jun 2011 - 08:18:17 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:10:31 EST