Re: [code] [code}[textadept] vertical scrolling bug?

From: Mitchell <m.att.foicica.com>
Date: Sun, 10 Dec 2017 10:36:30 -0500 (EST)

Hi Peter,

On Fri, 8 Dec 2017, Peter Rolf wrote:

> Hi,
>
> I had problems with wrong 'lexer' values in my Elastic Tabstops width
> cache. The lexer cache for 'text' was even flooded with entries, when I
> only had 'lua' files opened (no "Message Buffer" open at that time). I
> could limit the wrong entries by filtering out "Message Buffer" related
> modifications ('events.MODIFIED'). When I tried to do the same with
> 'events.UPDATE_UI' (vertically scrolling) the inner function wasn't
> called anymore.
>
> This means, that the message buffer is kind of 'active' while vertically
> scrolling. Any inner code that relies on the correct 'buffer' value
> while scrolling will fail.
>
> Here is the code to reproduce the problem. Just put it into an existing
> module or make a new one for testing.
>
> -----
> local UPDATE_V_SCROLL = buffer.UPDATE_V_SCROLL -- UPDATE_UI (4)
>
> local function buffer_problem(updated)
> if updated and (updated & UPDATE_V_SCROLL > 0) and (not buffer._type
> == _L["[Message Buffer]"]) then
> error("Never called...")
> end
> end
>
> events.connect(events.UPDATE_UI, buffer_problem)
> ----
>
>
> Activate the code and use the vertical scrollbar in any buffer, that is
> not the "Message Buffer". Nothing will happen, no 'error' raised.
> Tested only with the nightly builds (sorry, already deleted
> 'properties.lua') on WIN32.

I've been bit by this before.

     not buffer._type == _L[...]

should be

     buffer._type ~= _L[...]

or

     not (buffer._type == _L[...])

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 Sun 10 Dec 2017 - 10:36:30 EST

This archive was generated by hypermail 2.2.0 : Mon 11 Dec 2017 - 06:26:49 EST