Do not update statistics when not requested.

If the user decides not to display statistics in the status bar, why
do the computation at all?
This commit is contained in:
Jean-Marc Lasgouttes 2024-10-17 10:50:34 +02:00
parent 5d91fb81f9
commit c50debaffc

View File

@ -1482,7 +1482,8 @@ void GuiView::showStats()
// Don't attempt to calculate stats if
// the buffer is busy as this might crash (#12935)
Statistics & statistics = buf->statistics();
if (!busy() && !bv->busy())
if (!busy() && !bv->busy()
&& (word_count_enabled_ || char_count_enabled_ || char_nb_count_enabled_))
statistics.update(cur);
QStringList stats;