[latexila] Structure: don't take into account commented markups



commit 0b7a52ca2c33b118f982125eb2658ec6854e1f17
Author: Sébastien Wilmet <sebastien wilmet gmail com>
Date:   Tue Jun 7 23:23:31 2011 +0200

    Structure: don't take into account commented markups
    
    At first I wanted to display commented stuff in italic for example, so
    we can easily uncomment the item.
    
    But uncommenting the item can be difficult. If an entire section is
    commented, we have to uncomment the entire section. But if it's just the
    \section command which is commented, we must not uncomment the entire
    section.
    
    So the best is to use Edit -> Uncomment.

 TODO                        |    2 --
 src/document_structure.vala |    7 ++++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/TODO b/TODO
index 68aabac..1605d86 100644
--- a/TODO
+++ b/TODO
@@ -7,8 +7,6 @@ LaTeXila 2.2
 ============
 
 - Structure (list of chapters, sections, etc. to easily navigate in a document):
-	- Different style (e.g. italic) for commented items.
-
 	- Add a show/hide button for sections.
 	  For example, to search the remaining TODOs and FIXMEs, it's boring to have all the sections.
 	
diff --git a/src/document_structure.vala b/src/document_structure.vala
index 10d7aab..f8f06ad 100644
--- a/src/document_structure.vala
+++ b/src/document_structure.vala
@@ -146,13 +146,18 @@ public class DocumentStructure : GLib.Object
                 {
                     string char_matched = match_info.fetch (0);
 
-                    // search commands (begin with a backslash)
+                    // search markup (begin with a backslash)
                     if (char_matched == "\\")
                         search_markup (line, index);
 
                     // search comments (begin with '%')
                     else if (! _in_verbatim_env)
+                    {
                         search_comment (line, index);
+
+                        // commented items are not displayed in the structure
+                        break;
+                    }
                 }
 
                 try



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