Re: Questions and suggestions

From: anton <averbit....at.yandex.ru>
Date: Sat, 9 Jul 2011 06:50:05 -0700 (PDT)

ok, thanks.

then I have ask following

if I want to add a module that uses localization
how can I do this without providing patches for
_USERHOME..'/locale.conf'
(obviously, I dare not touch core)
and not getting No Localization Menu items.
What is the canonical way to do this?

> The statusbar is updated on every keypress, mouse click, etc. so looping
> through a table, calling a function, and concatting a string to itself
> would be a slow and CPU intensive process.
>
> It's probably easier, and faster, to hook your own events.UPDATE_UI event
> that updates the docstatusbar after the original.
Performance is of course a good point. So if I want to add something
to the
docstatusbar I simply need to copy-paste the code from core/gui.lua,
modify it, add my stuff, and hook it again. But then if somebody else
wants
to add something, he will need to do the same thing with my code.
Looks too ad hoc to me.
There should be a better solution which balances flexibility and
performance
but I'm not smart enough to suggest one. Anyway.

anton

.

On 8 Jul., 15:26, mitchell <c....at.caladbolg.net> wrote:
> Hi Anton,
>
> On Fri, 8 Jul 2011, anton wrote:
> > Hi all,
>
> > first 3 questions.
> > 1. Why does TA delete spaces in empty lines if you save the file?
>
> Because I like stripping trailing whitespace on save.
>
> > 2. Why is the default behaviour
> > in core/locale.lua
> >  function localize(id) return localizations[id] or 'No Localization'
> > end
> > and not
> >  function localize(id) return localizations[id] or id end
>
> As Steve said, it aides in debugging. If I have an ID in english, it's
> nearly impossible to know if I don't have a localization for it.
>
> > 3. I never see the complete docstatusbar
> > In an empty buffer I can see only till LF...
> > If a choose some lexer, I also see up to  LF Spaces: ...
> > Regardless how broad my window is.
> > I have this issue only on my 86_64 Laptop (Arch, LXDE under Compiz)
> > (I don't have this on my 86_32 PC)
> > Does anybody else have this issue or is this specific to my system?
>
> It probably has to do with your font settings. You can change the width to
> something other than 400 on textadept.c:294 and recompile ta.
>
> > And one suggestion
>
> > I suggest to rewrite the docstatusbar update code from core/gui.lua
> > to make it more flexible.
> > One can simply create an array of functions docstatusbar_item
> > where docstatusbar_item[counter]() should return the corresponding
> > strings
> > then one simply loops through this array like
> > str = ''
> > for _=1,#docstatusbar_item do
> >  str = str .. docstatusbar_item[_]()
> > end
> > gui.docstatusbar_text=str
>
> The statusbar is updated on every keypress, mouse click, etc. so looping
> through a table, calling a function, and concatting a string to itself
> would be a slow and CPU intensive process.
>
> It's probably easier, and faster, to hook your own events.UPDATE_UI event
> that updates the docstatusbar after the original.
>
Received on Sat 09 Jul 2011 - 09:50:05 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:13:14 EST