[patch] Selection stats in statusbar
Daniel
xracoonx at gmx.de
Thu Aug 18 09:31:36 UTC 2022
On 18/08/2022 09:55, Jürgen Spitzmüller wrote:
> Am Mittwoch, dem 17.08.2022 um 19:40 +0200 schrieb Daniel:
>> 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.
>
> showMessage() is triggered on any cursor action. That's way too often.
> E.g., it would fire down statistics unnecessarily if you move with the
> arrow keys through your document.
This shouldn't be an issue. The idea is that statistics are only
generated after some time has passed without interruption. They are not
shown immediately. Hence, continuous arrow key movement would not
trigger statistics at all. (Same for continuous typing which is an
advantage to the current implementation which continuously triggers
statistics.)
> And I am not completely sure each relevant action triggers a message.
>
> You need a more suitable signal that only emits when text is edited or
> loaded.
>
>> I don't know what the "internal processes" are though.
>
> You can use lfuns e.g. via the LyXServer mechanism or pipes. This can
> also be used to insert text or citations.
This seems to trigger showMessage() as well. Unless, we find a case
where showMessage() wouldn't be triggered, it still seems to me worth a
try before digging deeper.
Daniel
More information about the lyx-devel
mailing list