[gtksourceview] style-ref comments in some lang files



commit 53aecbb96f1d0e48a589bb9e761ab6fe904ca305
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Feb 21 10:31:45 2015 +0100

    style-ref comments in some lang files
    
    It is a good practice to define a local "comment" style
    and use style-ref. This allows to override the style
    of comments for that specific language.
    This commit only covers a few lang files I regularly use.

 data/language-specs/c.lang        |    6 +++---
 data/language-specs/java.lang     |    7 ++++---
 data/language-specs/protobuf.lang |    3 ++-
 3 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/data/language-specs/c.lang b/data/language-specs/c.lang
index a67327f..03892fd 100644
--- a/data/language-specs/c.lang
+++ b/data/language-specs/c.lang
@@ -303,9 +303,9 @@
     <context id="c" class="no-spell-check">
       <include>
         <context ref="gtk-doc:inline-docs-section"/>
-        <context ref="def:c-like-comment"/>
-        <context ref="def:c-like-comment-multiline"/>
-        <context ref="def:c-like-close-comment-outside-comment"/>
+        <context ref="def:c-like-comment" style-ref="comment"/>
+        <context ref="def:c-like-comment-multiline" style-ref="comment"/>
+        <context ref="def:c-like-close-comment-outside-comment" style-ref="comment"/>
         <context ref="if0-comment"/>
         <context ref="include"/>
         <context ref="preprocessor"/>
diff --git a/data/language-specs/java.lang b/data/language-specs/java.lang
index 260a371..4ad5a20 100644
--- a/data/language-specs/java.lang
+++ b/data/language-specs/java.lang
@@ -32,6 +32,7 @@
   </metadata>
 
   <styles>
+    <style id="comment"           _name="Comment"                   map-to="def:comment"/>
     <style id="escaped-character" _name="Escaped Character"         map-to="def:special-char"/>
     <style id="string"            _name="String"                    map-to="def:string"/>
     <style id="char"              _name="Character"                 map-to="def:character"/>
@@ -167,11 +168,11 @@
 
     <context id="java" class="no-spell-check">
       <include>
+        <context ref="def:c-like-comment" style-ref="comment"/>
+        <context ref="def:c-like-comment-multiline" style-ref="comment"/>
+        <context ref="def:c-like-close-comment-outside-comment"/>
         <context ref="string"/>
         <context ref="char"/>
-        <context ref="def:c-like-comment"/>
-        <context ref="def:c-like-comment-multiline"/>
-        <context ref="def:c-like-close-comment-outside-comment"/>
         <context ref="externals"/>
         <context ref="declarations"/>
         <context ref="primitive-types"/>
diff --git a/data/language-specs/protobuf.lang b/data/language-specs/protobuf.lang
index c714916..f0a3e71 100644
--- a/data/language-specs/protobuf.lang
+++ b/data/language-specs/protobuf.lang
@@ -26,6 +26,7 @@
   </metadata>
 
   <styles>
+    <style id="comment"  _name="Comment"       map-to="def:comment"/>
     <style id="variable" _name="Variable"      map-to="def:type"/>
     <style id="type"     _name="Data Type"     map-to="def:type"/>
     <style id="keyword"  _name="Keyword"       map-to="def:keyword"/>
@@ -89,7 +90,7 @@
 
     <context id="proto" class="no-spell-check">
       <include>
-        <context ref="def:c-like-comment"/>
+        <context ref="def:c-like-comment" style-ref="comment"/>
         <context ref="variable"/>
         <context ref="string"/>
         <context ref="keywords"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]