add word count statistics in statusbar
This option is disabled by default, because it adds some nontrivial CPU and memory overhead, though the implementation tries to keep it as minimal as possible. Whenewer the change in document is triggered, the timer is fired to wait for 500ms of inactivity. The trigger is reseted every time the change happens so as long as she keeps changing the document every 500ms or so, the counting wont stall the editor and her experience. Longer reculculations are done in batches of size 100 with the help of 500ms trigger. Which means 10000 lines long document will take 20s to compute. Subsequent counting of changes will be much faster because of the internal computation cache. Interface changes includes adding signal KTextEditor::DocumentPrivate::loaded to monitor document reload. GUI: menu: View -> Show Word Count REVIEW: 122571 BUG: 65740 FIXED-IN: 5.8.0
Showing
- src/CMakeLists.txt 2 additions, 1 deletionsrc/CMakeLists.txt
- src/data/katepartui.rc 2 additions, 1 deletionsrc/data/katepartui.rc
- src/document/katedocument.cpp 9 additions, 8 deletionssrc/document/katedocument.cpp
- src/document/katedocument.h 6 additions, 3 deletionssrc/document/katedocument.h
- src/utils/kateconfig.cpp 22 additions, 0 deletionssrc/utils/kateconfig.cpp
- src/utils/kateconfig.h 4 additions, 0 deletionssrc/utils/kateconfig.h
- src/view/katestatusbar.cpp 44 additions, 0 deletionssrc/view/katestatusbar.cpp
- src/view/katestatusbar.h 14 additions, 2 deletionssrc/view/katestatusbar.h
- src/view/kateview.cpp 11 additions, 0 deletionssrc/view/kateview.cpp
- src/view/kateview.h 2 additions, 0 deletionssrc/view/kateview.h
- src/view/wordcounter.cpp 189 additions, 0 deletionssrc/view/wordcounter.cpp
- src/view/wordcounter.h 63 additions, 0 deletionssrc/view/wordcounter.h
Loading
Please register or sign in to comment