Bug 408291 - Automatic Spellchecking fails after file is modified and reloaded
Summary: Automatic Spellchecking fails after file is modified and reloaded
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 19.04.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 362810 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-06-04 13:15 UTC by Greg Lepore
Modified: 2019-07-20 14:40 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.60.0


Attachments
Misspelled words highlighted (146.55 KB, image/png)
2019-06-04 13:15 UTC, Greg Lepore
Details
Misspelled words are not highlighted (134.31 KB, image/png)
2019-06-04 13:16 UTC, Greg Lepore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Lepore 2019-06-04 13:15:32 UTC
Created attachment 120564 [details]
Misspelled words highlighted

SUMMARY


STEPS TO REPRODUCE
1. Enable Automatic Spellchecking on file with misspelled words
2. Perform a search and replace on that file from the command line (i. e. using sed) which modifies the file
3. Kate indicates the file has changed and allows you to reload the file
4. Misspelled words are no longer highlighted, although Automatic Spellchecking is still enabled

OBSERVED RESULT
Not all misspelled words are highlighted after reloading. With some test files none of the misspelled words are highlighted, with other test files some misspelled words are highlighted and some are not

EXPECTED RESULT
All misspelled words should be highlighted after file is modified by an external program and reloaded in Kate

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Attached image bug1 shows Kate with a file containing misspelled words, immediately after the misspelled word "tho" was replace with "the" via the command line.

Attached image bug2 shows the same file immediately after the Reload button was pressed and the file was reloaded. Note that Automatic Spellchecking was checked in options for both files.
Comment 1 Greg Lepore 2019-06-04 13:16:07 UTC
Created attachment 120565 [details]
Misspelled words are not highlighted
Comment 2 Greg Lepore 2019-06-04 13:16:56 UTC
Operating System: KDE neon 5.15
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.0
Kernel Version: 4.15.0-50-generic
OS Type: 64-bit
Processors: 8 × AMD FX(tm)-8350 Eight-Core Processor
Memory: 7.8 GiB of RAM
Comment 3 Eric Adams 2019-06-05 14:43:42 UTC
I can confirm this behavior.

STEPS TO REPRODUCE
1. Created and saved a file with spelling errors in kate.
2. The spelling errors are highlighted as expected.
3. Edit the file with nano and add more content, leaving the spelling errors in place.
4. Kate prompts to reload.
5. The misspelled words are no longer highlighted.

If you toggle auto spell check off and back on the words are then again highlighted.

Operating System: Kubuntu 19.10
KDE Plasma Version: 5.15.90
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.2
Kernel Version: 5.0.0-15-generic
OS Type: 64-bit
Processors: 12 × Intel® Core™ i7-8750H CPU @ 2.20GHz
Memory: 15.3 GiB of RAM
Comment 4 Ahmad Samir 2019-06-22 13:24:13 UTC
https://phabricator.kde.org/D21940
Comment 5 Christoph Cullmann 2019-06-24 18:59:01 UTC
Git commit 42c64e1e081c6fc685fc5a0603bedaf2a4547779 by Christoph Cullmann, on behalf of Ahmad Samir.
Committed on 24/06/2019 at 18:58.
Pushed by cullmann into branch 'master'.

Make automatic spellcheck work after reloading a document

Summary:
When a document gets reloaded for whatever reason, automatic spellcheck
should be refreshed so as to re-process the document contents.
FIXED-IN: 5.61.0

Test Plan:
- Open a document - with a couple of misspelled words - in kate
- Enable "automatic spell checking"
- Reload the document
- The misspelled words in the document should be higlighted after reloading

Reviewers: #ktexteditor, cullmann, dhaumann

Reviewed By: #ktexteditor, dhaumann

Subscribers: sars, kde-frameworks-devel, kwrite-devel

Tags: #kate, #frameworks

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

M  +5    -0    src/spellcheck/ontheflycheck.cpp

https://commits.kde.org/ktexteditor/42c64e1e081c6fc685fc5a0603bedaf2a4547779
Comment 6 Ahmad Samir 2019-07-20 14:40:53 UTC
*** Bug 362810 has been marked as a duplicate of this bug. ***