Bug 417507

Summary: Kate ignores new mode/filetypes
Product: [Applications] kate Reporter: Alex Ball <a.j.ball>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: artur, bugseforuns, justin.zobel, kde, nate, stolz, torokati44
Priority: NOR    
Version: 19.12.2   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:

Description Alex Ball 2020-02-12 18:11:42 UTC
SUMMARY

Adding new, custom modes/filetypes to Kate no longer seems to work

STEPS TO REPRODUCE via GUI
1. Go to Settings, Configure Kate, Open/Save, Modes & Filetypes
2. Click 'New'. (Nothing happens.)
3. Click 'New' again. Now 'New Filetype' is shown.
4. Fill out the form with some details. I tried it for .tsv tab separated values.
5. Click Apply.

OBSERVED RESULT

'New Filetype' remains as the value of the 'Filetype' dropdown. The new entry cannot be found in any of the menus. It is not respected when a file of that type is opened.

The entry does get added to ~/.config/katemoderc. But if Kate is closed and reopened, and a second new entry is added in the same way, the first new entry is erased.


EXPECTED RESULT

The new entry name should appear in the 'Filetype' dropdown, be available for selection from the menus, and be respected when a file is opened. The entry for it in ~/.config/katemoderc should persist until the user deletes it.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: kernel 5.3.0-28-generic
KDE Plasma Version: 5.18.0
KDE Frameworks Version: 5.67.0
Qt Version: 5.13.2
Comment 1 torokati44 2020-06-26 22:05:33 UTC
Kate 20.04.1 is still affected.
Comment 2 Justin Zobel 2020-10-30 03:23:41 UTC
Confirmed on kate from git master.
Comment 3 Jeffrey Bouter 2021-03-04 10:39:22 UTC
kate 20.12.2 is still affected.
Comment 4 Stolz 2021-03-28 12:27:11 UTC
Kate version 20.12.3 still affected
Comment 5 Bug Janitor Service 2021-05-27 15:18:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/156
Comment 6 Christoph Cullmann 2021-06-12 18:07:36 UTC
Git commit e0236db391a7d217b7cb157c09985e691405209b by Christoph Cullmann, on behalf of Jan Paul Batrina.
Committed on 12/06/2021 at 18:07.
Pushed by cullmann into branch 'master'.

Automatically show config page of newly created filetype

M  +3    -0    src/mode/katemodeconfigpage.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/e0236db391a7d217b7cb157c09985e691405209b
Comment 7 Christoph Cullmann 2021-06-12 18:07:44 UTC
Git commit e79f2445ada4b8261053da8c7cde75c272fdc4eb by Christoph Cullmann, on behalf of Jan Paul Batrina.
Committed on 12/06/2021 at 18:07.
Pushed by cullmann into branch 'master'.

Fix custom filetype validation

commit cee9d96427356b0d861ff9af050e88af23a842a5 added validation to
filter out filetypes with invalid/missing highliting definitions,
but only the default filetypes (one per highlighting definition) was
added to the list.

M  +22   -6    src/mode/katemodemanager.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/e79f2445ada4b8261053da8c7cde75c272fdc4eb