[gtksourceview] latex.lang: add support of minted package



commit 3b8f7847db2a58be5557bd18f458904e0f9d593c
Author: Marc Schreiber <info schrieveslaach de>
Date:   Sun Mar 11 10:19:53 2018 +0100

    latex.lang: add support of minted package

 data/language-specs/latex.lang | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang
index 593e4d6a..6e622533 100644
--- a/data/language-specs/latex.lang
+++ b/data/language-specs/latex.lang
@@ -86,8 +86,8 @@
     </context>
 
     <context id="lstlisting-env" style-inside="true" style-ref="verbatim" class="no-spell-check">
-      <start>(\\begin)\{lstlisting\}</start>
-      <end>(\\end)\{lstlisting\}</end>
+      <start>(\\begin)\{(lstlisting|minted)\}</start>
+      <end>(\\end)\{\%{2@start}\}</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="common-commands"/>
         <context sub-pattern="1" where="end" style-ref="common-commands"/>
@@ -193,6 +193,22 @@
       </include>
     </context>
 
+    <context id="mintinline-curly-brackets" style-inside="true" style-ref="verbatim" class="no-spell-check">
+      <start>(\\mintinline)(\[.*?\])?\{.+?\}{</start>
+      <end>}</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="command"/>
+      </include>
+    </context>
+
+    <context id="mintinline" style-inside="true" style-ref="verbatim" class="no-spell-check">
+      <start>(\\mintinline)(\[.*?\])?\{.+?\}((?!\[)\S)</start>  <!-- ignore when starting with [ -->
+      <end>\%{3@start}</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="command"/>
+      </include>
+    </context>
+
     <!-- If using \verb instead of \lstinline, the brackets cannot be used -->
     <context id="verbatim-inline" style-inside="true" style-ref="verbatim" class-disabled="no-spell-check">
       <start>(\\verb)\*?(\S)</start>
@@ -210,6 +226,8 @@
         <context ref="lstinline-curly-brackets"/>
         <context ref="lstinline-square-brackets"/>
         <context ref="lstinline"/>
+        <context ref="mintinline-curly-brackets" />
+        <context ref="mintinline"/>
       </include>
     </context>
 


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