On 18/08/2022 14:25, Jürgen Spitzmüller wrote:
Am Donnerstag, dem 18.08.2022 um 14:08 +0200 schrieb Daniel:
No function exits early on that approach. The function does not get
called in the first place. I think it is really better.

Currently: statistics update continuously and, hence, can interfere
with continuous typing.

Which is not a problem if we use threading.

I am wondering whether this is taking a sledgehammer to crack a nut. But since I don't know much about multithreading, I cannot really comment on it. Apparently, it can come with certain risks of indeterminate behaviour and crashes. But again, I don't know whether it applies to this case.

As far as I understand it, you will still have to cancel the calculation (as I did stop the timer) if something changes because otherwise, you would come up with a wrong word-count update in case the document has changed in between.

My method: statistics update only when idle for a long enough time
and only once, hence, cannot interfere with continuous typing and are
very unlikely to interfere at all.

And it updated after that timing whether it is needed or not. This is
the point I want to bring across. And the delay is not needed if
everything is done properly. It is just a result of bad design.

There is a difference here between the general usage of a timer and the usage of it in showMessage(). It might be that due to the latter (but not the former) it is updated when not needed. However, it does so only once and when idle. If the timer is started instead only for actual changes, there is no such unnecessary update. Though I am still unsure whether it is an issue really due to the idle condition.

Having said that, I am happy leaving this for you to try it out. I only wanted to give some comments that came to my mind.

Daniel

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to