Bug 454715 - Syntax highlighting sometimes gets reset when the file is reloaded
Summary: Syntax highlighting sometimes gets reset when the file is reloaded
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 22.04.1
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 458775 461942 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-06-01 20:30 UTC by felipelorenzzon
Modified: 2022-11-19 17:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description felipelorenzzon 2022-06-01 20:30:08 UTC
STEPS TO REPRODUCE
1. Open a code file (I mainly edit React .js files, but this seems to happen with other formats too)
2. Modify the file externally (by changing git branches, by formatting it with 'prettier', etc) or simply press F5

OBSERVED RESULT
Sometimes, the syntax highlighting will be reset and the text appears totally white. The syntax mode show at the bottom right corner is correct, but is not applied. I need to click that menu and select the language again. I haven't found correlations between this bug and other factors, it seems random.

EXPECTED RESULT
The file should reload and keep the original syntax highlighting.


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

ADDITIONAL INFORMATION
Comment 1 Lothar 2022-09-29 08:29:01 UTC
*** Bug 458775 has been marked as a duplicate of this bug. ***
Comment 2 Bug Janitor Service 2022-09-30 20:56:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/424
Comment 3 Christoph Cullmann 2022-10-01 17:52:26 UTC
Git commit 6314c0b9e62b17174ba8425a968a63d590e83d61 by Christoph Cullmann, on behalf of loh tar.
Committed on 01/10/2022 at 17:01.
Pushed by cullmann into branch 'master'.

Ensure to set highlight on reload when file type was set by user

This change do essentially nothing else than before, we only call
updateFileType(..) direct and not by setMode() which allows bypassing
the blocking in updateFileType(..)

M  +3    -1    src/document/katedocument.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/6314c0b9e62b17174ba8425a968a63d590e83d61
Comment 4 Christoph Cullmann 2022-11-19 17:49:27 UTC
*** Bug 461942 has been marked as a duplicate of this bug. ***