Allow to change the Mode, after changing the Highlighting
ClosedPublic

Authored by nibags on May 2 2019, 11:19 AM.

Details

Summary

Currently, when selecting a language in the "Highlighting" menu, the "Mode" menu stops working.
This happens because, the Modes don't apply if m_hlSetByUser is true (if the user has chosen a Highlight in the menu).
This is swelling and I think it's better to change it.
Now when selecting a Mode, the "Highlighting" menu is also updated (but, when choosing an item in the Highlighting menu, the "Mode" menus don't change).

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nibags created this revision.May 2 2019, 11:19 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMay 2 2019, 11:19 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.May 2 2019, 11:19 AM
cullmann accepted this revision.May 2 2019, 10:18 PM
cullmann added a subscriber: cullmann.

Sounds reasonable.

This revision is now accepted and ready to land.May 2 2019, 10:18 PM
This revision was automatically updated to reflect the committed changes.
cullmann reopened this revision.May 20 2019, 1:46 PM

Hi,
could this lead to the following regression:

https://bugs.kde.org/show_bug.cgi?id=407763

This revision is now accepted and ready to land.May 20 2019, 1:46 PM

The function setDontChangeHlOnSave() uses the m_hlSetByUser variable to avoid resetting the syntax highlighting, which I removed in updateFileType().
I could use another binary for this.

src/document/katedocument.cpp
1893

Apparently, the problem is here. "m_hlSetByUser" is used to avoid resetting the hl. I should create another binary varible for this.

errata: the setDontChangeHlOnSave() function has nothing to do here.
more time I upload a patch.

cullmann closed this revision.May 22 2019, 2:34 PM

Ok, regression taken care of in D21331