Bug 319412 - highlighting changes when saving or opening a file
Summary: highlighting changes when saving or opening a file
Status: RESOLVED DUPLICATE of bug 332605
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: 3.10.2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 13:53 UTC by hannesd
Modified: 2014-09-23 18:41 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hannesd 2013-05-06 13:53:41 UTC
Highlighting changes to "prolog" when saving or opening a .pro-file (IDL). 
When I open a *.pro-file the highlight is always set on "prolog" not on  "RSI IDL" as it has been
in earlier releases. 
When you change it manually, it will change again after a restart of kate. 

Reproducible: Always

Steps to Reproduce:
1. Save a file as "test.pro" 
2.
3.
Actual Results:  
Highlighting  is set on "prolog".

Expected Results:  
Highlighting  is set on "RSI IDL".
Comment 1 Dominik Haumann 2013-08-13 15:51:12 UTC
It's about priorities in the Modes & Filetypes tab. Changing the priority should fix this. Another solution you can try is add a modeline, like:
# kate: hl RSI IDL;

Is this solution good enough?
Comment 2 André 2013-08-14 12:27:33 UTC
Thanks hannesd for pointing this out and Dominik for your answer. I had the same problem and Dominik's suggestion did work for me. 

However, I think this is still a bug, in that there is no consistency check for the file types. Even for an experienced kate user it is hard to figure this out. I think when defining highlighting schemes no duplicates in the file type should be allowed - or as another solution, when such a case is hit the user should be able to decide which highlighting mode to load.

Best, André
Comment 3 Dominik Haumann 2013-08-14 12:33:14 UTC
> no duplicates in the file type should be allowed
Impossible. There are several highlighting styles that clash, and it so far was not an issue that you had to configure the priority. That's after all why we have it this way.

I tend to disagree to ask the user, it basically would mean that the user is much more often confronted with minor questions, that in most of the cases are even chosen correctly out of the box. 

In this case: Is Prolog more often used that RSI IDL? If so, I'd say it's all fine. Otherwise, I'd be fine with switching the priorities.
Comment 4 André 2013-08-14 12:38:51 UTC
Either way one can decide to confuse either the prolog users or the IDL users. I had this issue for month's and was quite bothered with it. Now that I know how to change it it is alright, but what about the next poor IDL/prolog user who thinks that there is a bug in kate? It is quite hard to find where and how to make the right settings.

However I agree with your point that the user shouldn't be confronted to much with minor questions.
Comment 5 jonas.bismarck 2013-08-14 12:48:25 UTC
I had the same problem for a while, too. 

IDL and Fortran files were either opening without syntax highliting or the wrong one. In my Kate version (3.8.5), however, IDL collides with Qmake (both have priority '0' as default) and PROLOG doesn't include the *.pro files. 

Thanks to your anwers I now know how to get rid of the problem.  But how is Kate supposed to respond when two or more languages have the same file endings specified and the same prioritys? By not highliting at all?
Comment 6 Christoph Cullmann 2014-09-23 18:41:59 UTC
The "wrong hl on open" is unfixable, thats just a clash.
That it is reset on save is the bug 332605.
Therefore marking as dupe, but really, on open, we won't ask.

*** This bug has been marked as a duplicate of bug 332605 ***