[gtksourceview] latex: fix lstinline for square brackets, again (bug #563674)



commit 1b251e22ec3f7416eb4e478e1231545ab1b1119d
Author: Carnë Draug <carandraug+dev gmail com>
Date:   Fri Mar 29 17:14:12 2013 +0000

    latex: fix lstinline for square brackets, again (bug #563674)

 data/language-specs/latex.lang |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang
index 3dd56ce..d0b85d1 100644
--- a/data/language-specs/latex.lang
+++ b/data/language-specs/latex.lang
@@ -269,14 +269,13 @@
           \lstinline[key=val, key=val]{code in here}
           \lstinline[key=val, key=val]!code in here!
           \lstinline[]!code in here!
-          \lstinline[][code in here]
-          \lstinline[NOT code in here, must specify empty optional argument to use square brackets]
+          \lstinline[][code in here[
+          \lstinline[NOT code in here, must specify empty optional argument to use square brackets[
           \lstinline{code in here}
           \lstinline{code in {here} but NOT in here}  % brackets do not nest
           \lstinline!code in here!
           \lstinline=code in here=
           \lstinline{this needs to fail{
-          \lstinline[this also needs to fail[
 
           If using \verb instead of \lstinline, the brackets cannot be used
         -->
@@ -288,8 +287,10 @@
       </include>
     </context>
     <context id="lstinline-square-brackets" style-inside="true" style-ref="verbatim" 
class-disabled="no-spell-check">
+      <!-- square brackets don't match with the pair, and they require an
+           optional argument, even if empty -->
       <start>(\\lstinline)(\[.*?\])\[</start>
-      <end>\]</end>
+      <end>\[</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="command" class="no-spell-check"/>
       </include>


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