Bug 346464 - Incorrect syntax highlighting for css containing "@"
Summary: Incorrect syntax highlighting for css containing "@"
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (other bugs)
Version First Reported In: 3.14.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-22 10:25 UTC by Rafael Linux User
Modified: 2016-07-19 19:51 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Linux User 2015-04-22 10:25:53 UTC
Kate is not showing correctly CSS syntax after find "@" symbol.

Example:

.Table-row-item:before {
  content: attr(data-header);
  width: 30%;
  font-weight: 700;
}
@media (min-width: 500px) {
  .Table-row-item {
    border: 1px solid #fff;
    padding: 0.5em;
  }
  .Table-row-item:before {
    content: none;
  }
}



Reproducible: Always

Steps to Reproduce:
1.Insert @media (min-width:500px) {
2.See what happens


Actual Results:  
Incorrect syntax highlighting

Expected Results:  
Correct highlighting
Comment 1 Mike Robinson 2015-04-28 19:30:06 UTC
Note, this bug also exists for PHP/HTML files with CSS in them. I'm using:

Kate Version 3.13.3
Using KDE Development Platform 4.13.3
Comment 2 Miquel Sabaté 2015-06-06 13:33:33 UTC
AFAIK, this was fixed in KDE Frameworks 5. Related commits:

e95b69dfa57c38921929ddef16392a8675e130e9
ee46a9d09134a06c4c567feb1e458a00e3698c1d

I cannot reproduce your issue (using KF5). Therefore, feel free to reopen it if you can reproduce this in KDE Frameworks.
Comment 3 Mike Robinson 2015-06-08 16:59:28 UTC
Miquel, would it be possible to provide the relevant syntax files here as an attachment for people to manually copy them over to KDE 4?
Comment 4 Rafael Linux User 2015-06-08 17:10:46 UTC
Yes, it is solved in Kate 4.14.9

Thank you very much!!
Comment 5 Rafael Linux User 2015-06-08 17:12:30 UTC
Sorry, I mean "KDE 4.14.9", "Kate 3.14.9"

;)
Comment 6 Miquel Sabaté 2015-06-08 17:21:41 UTC
Hello Mike,

The current version of the file can be found in KTextEditor master: http://quickgit.kde.org/?p=ktexteditor.git&a=blob&h=fb2ac320f8265b37a6fcb4e0f2548e8c5cdf8a43&hb=bf8f4ceab947b0643885cf283ccf347c55a177a2&f=src%2Fsyntax%2Fdata%2Fcss.xml
Comment 7 Mike Robinson 2016-07-19 19:51:13 UTC
Delayed reply, I know. Miquel's solution didn't work for me. I downloaded that file and saved it in /usr/share/kde4/apps/katepart/syntax, but I got an error message when trying to open a CSS file.

If anyone else is still using an old version of Kate, go to Settings > Configure Kate > Open/Save > Modes & File Types and click on "Download Highlighting Files". I just updated everything that was auto-selected and it appears to be working correctly now.