Bug 407763 - Syntax highlighting reverts default "guess" when editing remote files when saving
Summary: Syntax highlighting reverts default "guess" when editing remote files when sa...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: 19.04.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-20 13:44 UTC by Cade Robinson
Modified: 2019-05-24 16:31 UTC (History)
3 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 Cade Robinson 2019-05-20 13:44:07 UTC
SUMMARY
When editing a remote file via sftp:// or fish://, syntax highlighting reverts to default "guess" when saving.
EG:
Opening an Apache .conf file will highlight as "INI Files".
Changing to Apache Configuration and then saving reverts to "INI Files"


STEPS TO REPRODUCE
1. open a remote file via sftp:// or fish://
2. Change highlighting to something other than what was guessed
3. save the file

OBSERVED RESULT
Syntax highlighting reverts to the default guess

EXPECTED RESULT
Stay on the type of highlighting I selected.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch
KDE Plasma Version: 5.15.90
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Comment 1 Christoph Cullmann 2019-05-20 13:47:26 UTC
Hmm, perhaps related to the change in https://phabricator.kde.org/D20959
Comment 2 Nibaldo G. 2019-05-22 09:10:58 UTC
Proposed fix: https://phabricator.kde.org/D21331
Comment 3 Nibaldo G. 2019-05-22 11:25:39 UTC
Git commit b2064042daa143ae60d5728d46777511aee74a02 by Nibaldo González.
Committed on 22/05/2019 at 11:25.
Pushed by ngonzalez into branch 'master'.

Fix: don't reset Highlight when saving some files

Summary:

Fix the regression of patch D20959.

In sftp:// or fish:// files, the current syntax highlighting isn't stored in `$HOME/.config/katemetainfos`.
Therefore, when saving a file, the highlighting is reset.
This only happens when changing the hl from the "Highlighting" menu, not from the "Mode" menu.

Basically, this returns to the state before the patch D20959, but now the highlight will always change if `user` is true.

Reviewers: #ktexteditor, cullmann

Reviewed By: #ktexteditor, cullmann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

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

M  +4    -2    src/document/katedocument.cpp

https://commits.kde.org/ktexteditor/b2064042daa143ae60d5728d46777511aee74a02
Comment 4 Cade Robinson 2019-05-24 16:31:56 UTC
Seeing the comment on the "Mode" menu vs "Highlighting" menu as a workaround instead of choosing "Highlighting" I use "Mode" and this works fine.

What is the difference between the two?
If they do the same thing essentially maybe remove one or the other?