[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: yup,   kate's HL code is bork
From:       Mirko Stocker <me () misto ! ch>
Date:       2007-07-02 18:38:11
Message-ID: 200707022038.17186.me () misto ! ch
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


On Wednesday 27 June 2007 00:29:34 Matthew Woehlke wrote:
> Nope... that does seem to fix the non-highlighter, but the problem still
> occurs with highlighters (try Scripts/Bash, for example). Therefore I'm
> not convinced that this is the problem; sorry :-).

I think I've got it now :) The attached patch fixes the highlighting of the 
normal text and also solves the problem with the wrong highlightings being 
used.

Regards

Mirko

PS: If I would apply for an SVN account, would it still be ok to send patches 
to this list so someone can review them?

["highlighting_fixes.patch" (text/x-diff)]

Index: syntax/katehighlight.cpp
===================================================================
--- syntax/katehighlight.cpp	(revision 682455)
+++ syntax/katehighlight.cpp	(working copy)
@@ -252,8 +252,10 @@
   textLine->clearAttributes ();
 
   // no hl set, nothing to do more than the above cleaning ;)
-  if (noHl)
+  if (noHl) {
+    textLine->addAttribute (0, textLine->length(), KateExtendedAttribute::dsNormal);
     return;
+  }
 
   // duplicate the ctx stack, only once !
   QVector<short> ctx (prevLine->ctxArray());
@@ -485,6 +487,10 @@
     }
     textLine->setNoIndentBasedFolding(noindent);
   }
+  
+  //set the dsNormal attribute if we haven't found anything else
+  if(textLine->attributesList().empty())
+	  textLine->addAttribute (0, textLine->length(), KateExtendedAttribute::dsNormal);
 }
 
 void KateHighlighting::getKateExtendedAttributeList (const QString &schema, \
QList<KateExtendedAttribute::Ptr> &list) @@ -1786,12 +1792,12 @@
     for (uint z = 0; z < nAttribs; z++)
     {
       KateExtendedAttribute::Ptr itemData = itemDataList.at(z);
-      KTextEditor::Attribute::Ptr n = \
                defaultStyleList.at(itemData->defaultStyleIndex());
-
+      KTextEditor::Attribute::Ptr newAttribute( new \
KTextEditor::Attribute(*defaultStyleList.at(itemData->defaultStyleIndex())) ); +      \
  if (itemData && itemData->hasAnyProperty())
-        *n += *itemData;
+        *newAttribute += *itemData;
 
-      array.append(n);
+      array.append(newAttribute);
     }
   }
 }
@@ -1812,16 +1818,15 @@
   getKateExtendedAttributeList(schema, itemDataList);
 
   uint nAttribs = itemDataList.count();
-
   for (uint z = 0; z < nAttribs; z++)
   {
     KateExtendedAttribute::Ptr itemData = itemDataList.at(z);
-    KTextEditor::Attribute::Ptr n = \
                defaultStyleList.at(itemData->defaultStyleIndex());
-
+    KTextEditor::Attribute::Ptr newAttribute( new \
KTextEditor::Attribute(*defaultStyleList.at(itemData->defaultStyleIndex())) ); +    
     if (itemData && itemData->hasAnyProperty())
-      *n += *itemData;
-
-    array.append(n);
+      *newAttribute += *itemData;
+    
+    array.append(newAttribute);
   }
 
   m_attributeArrays.insert(schema, array);
Index: TODO
===================================================================
--- TODO	(revision 682455)
+++ TODO	(working copy)
@@ -9,13 +9,10 @@
 
 * highlighting issues
   * external context references don't pick up default attribute (bug 145052)
-  * highlighting uses attributes from the current highlighter, but not the right \
ones  
 * color issues
   * use color roles when they become available to initialize attributes
     -> this will probably fix bug 143606
-  * dsNormal using very wrong color ('border background'?!) as foreground most of \
                the time
-    -> by 4.0 please, this wreaks havoc on u7y/a11!!
 
 * text painted twice after clearing a selection (see \
http://permalink.gmane.org/gmane.comp.kde.devel.kwrite/12546)  


["signature.asc" (application/pgp-signature)]

_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic