Re: [code] [textadept] Styling changes

From: Mitchell <m.att.foicica.com>
Date: Thu, 20 Nov 2014 15:29:32 -0500 (EST)

Hi Robert,

On Wed, 19 Nov 2014, Robert Gieseke wrote:

> Hi Mitchell,
>
> Am 19/11/14 um 16:43 schrieb Mitchell:
>> On Tue, 18 Nov 2014, Robert Gieseke wrote:
>>> I think one of the recent changes in Textadept with regards to default
>>> styling of text buffers partly broke the coloring in Textredux buffers
>>> (see the screenshot at [1]).
>>> Any ideas what exactly changed with regards to styling?
>>
>> What do you mean by "recent"? What was the version this was last working
>> in?
>
> sorry for having been vague, not so recent I realise … maybe this one in
> Scintillua: http://foicica.com/hg/scintillua/rev/399837606385
>
> The coloring of the last line stops in 7.7. In 7.6 it works.

Okay, thanks. I thought that revision might be what is causing it.

Some background: Scintilla keeps track of the last correctly styled
position via `buffer.end_styled`. When a character is added to a line,
Scintilla usually rolls back `buffer.end_styled` to the beginning of the
line typed on and then calls on the lexer to style from that point
forward.

Prior to the change you pointed to, Scintilla didn't perform any styling
at all if the current lexer had no grammar, thus keeping the value of
`buffer.end_styled` at 0 (and keeping any user-applied styles). However,
this kept telling the lexer to re-style everything starting from zero,
which seemed inefficient (hence the change). In order to set
`buffer.end_styled` and prevent the same text from being lexed again and
again, I simply style all of that text in the default style. The side
effect is what you're seeing: any existing styles are overwritten. The
question is: how and when are you applying your styles? Is it possible to
re-apply your styles at the right time? If not, perhaps it's worth
reverting the change.

Cheers,
Mitchell

-- 
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 Thu 20 Nov 2014 - 15:29:32 EST

This archive was generated by hypermail 2.2.0 : Fri 21 Nov 2014 - 06:35:57 EST