Re: question and remarks

From: anton <averbit....at.yandex.ru>
Date: Sat, 11 Jun 2011 08:38:37 -0700 (PDT)

Thanks!

so only_word_chars is a bool value not a regex string :)
lua makes everything possible!

I propose the following trivial solution

  first_unused_wParam = 0

  function get_first_unused_wParam()
    first_unused_wParam = first_unused_wParam + 1
    return first_unused_wParam
  end

then one can write

  local RECENT_FILES = somemodule:get_first_unused_wParam()

In user_list_selection in no a big problem but
modules/textadept/editing.lua
INDIC_HIGHLIGHT = 8
modules/textadept/snippets.lua
INDIC_SNIPPET = 9

You can set
  first_unused_indic = 10
to separate ta/scintilla namespace from user namespace

anton

On 11 Jun., 14:18, mitchell <c....at.caladbolg.net> wrote:
> 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.
>
Received on Sat 11 Jun 2011 - 11:38:37 EDT

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