Bug 386897

Summary: make word/char count a global sticky preference not a temporary menu option
Product: [Applications] kate Reporter: cat22 <erbenton>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: kishore96, nate, whynot
Priority: NOR    
Version: 17.04.2   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 18.08.0

Description cat22 2017-11-14 08:36:08 UTC
Menu View->'Show word count' puts an informational line at the bottom of kate showing word and character counts.
Issues:
  It only applies to the current tab
  It goes away if kate is restarted
  All bottom dialogs like find or search & replace cover up the word/char count info <= especially annoying 

Solution:
   Move the menu item to the preferences dialog so it will be global
   Preferences are preserved between kate restarts
   Adjust the bottom panel area to allow the find,search&replace etc dialogs to not cover up the word/char info
Comment 1 Albert Astals Cid 2018-05-21 08:49:33 UTC
Git commit 594c51bbf61dcf7014a44727519afb4a6b58c074 by Albert Astals Cid, on behalf of Wojciech Stachurski.
Committed on 21/05/2018 at 08:49.
Pushed by aacid into branch 'master'.

Make the word/char count a global preference

Summary:
This is an attempt to make the word/char count in the status bar
a global preference covering the whole editor instead of a temporary
menu option activated on demand for individual documents.

Test Plan:
1. Open Kate.
2. Open two new documents.
3. Go to Settings -> Configure Kate -> Appearance.
4. Check the "Show Word Count" option and apply changes.
5. Word counter in the status bar is shown across all documents.
6. Open another new document and observe the word counter.
7. Close Kate and open it once again.
8. The word counter is still there.

Reviewers: #ktexteditor, #kate, mwolff, cullmann

Reviewed By: #ktexteditor, #kate, mwolff, cullmann

Subscribers: mwolff, dhaumann, cullmann, ngraham, #frameworks

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D11822

M  +3    -0    src/dialogs/katedialogs.cpp
M  +10   -0    src/dialogs/textareaappearanceconfigwidget.ui
M  +8    -2    src/utils/kateconfig.cpp
M  +1    -0    src/utils/kateconfig.h
M  +0    -6    src/view/kateview.cpp

https://commits.kde.org/ktexteditor/594c51bbf61dcf7014a44727519afb4a6b58c074
Comment 2 cat22 2018-05-21 14:28:53 UTC
Thank you for working on this
Eric

On 05/21/2018 01:49 AM, Albert Astals Cid wrote:
> https://bugs.kde.org/show_bug.cgi?id=386897
>
> Albert Astals Cid <aacid@kde.org> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|UNCONFIRMED                 |RESOLVED
>        Latest Commit|                            |https://commits.kde.org/kte
>                     |                            |xteditor/594c51bbf61dcf7014
>                     |                            |a44727519afb4a6b58c074
>           Resolution|---                         |FIXED
>
> --- Comment #1 from Albert Astals Cid <aacid@kde.org> ---
> Git commit 594c51bbf61dcf7014a44727519afb4a6b58c074 by Albert Astals Cid, on
> behalf of Wojciech Stachurski.
> Committed on 21/05/2018 at 08:49.
> Pushed by aacid into branch 'master'.
>
> Make the word/char count a global preference
>
> Summary:
> This is an attempt to make the word/char count in the status bar
> a global preference covering the whole editor instead of a temporary
> menu option activated on demand for individual documents.
>
> Test Plan:
> 1. Open Kate.
> 2. Open two new documents.
> 3. Go to Settings -> Configure Kate -> Appearance.
> 4. Check the "Show Word Count" option and apply changes.
> 5. Word counter in the status bar is shown across all documents.
> 6. Open another new document and observe the word counter.
> 7. Close Kate and open it once again.
> 8. The word counter is still there.
>
> Reviewers: #ktexteditor, #kate, mwolff, cullmann
>
> Reviewed By: #ktexteditor, #kate, mwolff, cullmann
>
> Subscribers: mwolff, dhaumann, cullmann, ngraham, #frameworks
>
> Tags: #kate, #frameworks
>
> Differential Revision: https://phabricator.kde.org/D11822
>
> M  +3    -0    src/dialogs/katedialogs.cpp
> M  +10   -0    src/dialogs/textareaappearanceconfigwidget.ui
> M  +8    -2    src/utils/kateconfig.cpp
> M  +1    -0    src/utils/kateconfig.h
> M  +0    -6    src/view/kateview.cpp
>
> https://commits.kde.org/ktexteditor/594c51bbf61dcf7014a44727519afb4a6b58c074
>
Comment 3 cat22 2018-10-01 17:16:53 UTC
I have Kate 18.08.0 on Leap 15, Tumbleweed KDE 5.49.0 Qt 5.11.1
With large files, there is an issue. For example I have a log file with 38,811 lines and wc -c shows 3093244  while kate shows 3044999. In kate if I then do a 'Select All' sometimes it shows the wrong number of characters as compared to its own report so it will be something like Chars 201324/309324. At times it shows Chars 0/0. when the file is large enough. My guess is it may be an integer size issue (e.g using int instead of uint64_t or something like that)
When i open a very large text (log file) file (~15mb) no reporting of Chars shows at all even tho the option is enabled and Lines is 'Line 215,929 of 215,929. Also, chars never has commas inserted when it does show up on smaller files. I can gzip the file (the 15mb mother) and attach it if requested.
Comment 4 Nate Graham 2018-10-01 19:22:57 UTC
Please file new bugs for new issues.