[patch] Selection stats in statusbar

Daniel xracoonx at gmx.de
Wed Aug 17 17:40:48 UTC 2022


On 2022-08-17 18:41, Jürgen Spitzmüller wrote:
> Am Mittwoch, dem 10.08.2022 um 08:01 +0200 schrieb Daniel:
>> 1. The delay timer seems not to be working as expected. Normally,
>> i.e.
>> in other word processors, the idea is this:
>>
>> While typing, no updating takes place, only once the typing stops,
>> the
>> update timer starts. Once typing is continued, the update timer is
>> stopped. I guess this is to make sure that calculation of the
>> statistics
>> is very unlikely to interfere with the typing.
>>
>> However, as it is now, the word count gets updated sometimes while
>> continuously typing. I thought that I had figured this out in my
>> patch
>> but maybe not. (Or that is a part where you where wondering why it
>> was
>> as it was.)
> 
> I agree this would be much better. Also, async calculation (via
> QFuture) would probably help with managing the calculation processes
> and mitigate delays.
> 
> What is not so easy, I think, is to trigger correctly when the
> statistics should be updated. This is not only on typing, but also on
> pasting, cutting, undo/redo, buffer loading and buffer switching. Maybe
> even on internal processes (think LyXServer). I onl y had a quick look,
> but I think the signals would have to be emitted from many different
> places.

What I did in

https://www.lyx.org/trac/attachment/ticket/12422/0001-Show-word-count-in-status-bar.patch

was just to hook it on GuiView::showMessage() because this would be 
updated in all cases where text stuff changes. It seemed to work. I 
don't know what the "internal processes" are though.

Daniel




More information about the lyx-devel mailing list