Bug 90681 - Word left/right does not respect C operators
Summary: Word left/right does not respect C operators
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 91038 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-03 03:34 UTC by Jon Smirl
Modified: 2004-10-10 22:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Smirl 2004-10-03 03:34:37 UTC
Version:           CVS (using KDE Devel)
Installed from:    Compiled sources

This is reported as 61598 for QT Editor. 
Kate has the same problem.

In other words (,),-> are word boundaries.

This is probably a kdevelop problem. When the language specific syntax highlighting modules are loaded they should set language specific word boundaries into the underlying Kate/QT edit.

This is highly annoying when editing large amounts of text.

Kate says this is two words:
	DRM_COPY(version->name, DRIVER_NAME);
I say it is four.
Comment 1 Jens Dagerbo 2004-10-03 06:13:12 UTC
The "language specific syntax highlighting modules" are part of Kate. 

Reassigning.
Comment 2 Anders Lund 2004-10-10 10:47:45 UTC
*** Bug 91038 has been marked as a duplicate of this bug. ***
Comment 3 Anders Lund 2004-10-10 21:53:54 UTC
CVS commit by alund: 

fix #90681
backport follows
CCMAIL: 90681-done@bugs.kde.org


  M +9 -4      katehighlight.cpp   1.183
  M +7 -2      katehighlight.h   1.82


--- kdelibs/kate/part/katehighlight.cpp  #1.182:1.183
@@ -1979,6 +1979,8 @@ int KateHighlighting::hlKeyForAttrib( in
 bool KateHighlighting::isInWord( QChar c, int attrib ) const
 {
+  kdDebug(13010)<<"KateHighlighting::isInWord("<<c<<", "<<attrib<<")"<<endl;
+  kdDebug(13010)<<"i have this numnber of strings: "<<m_additionalData[0].count()<<endl;
   static const QString& sq = KGlobal::staticQString(" \"'");
-  return getCommentString(3, attrib).find(c) < 0 && sq.find(c) < 0;
+  return getCommentString(4, attrib).find(c) < 0 && sq.find(c) < 0;
 }
 
@@ -1986,5 +1988,5 @@ bool KateHighlighting::canBreakAt( QChar
 {
   static const QString& sq = KGlobal::staticQString("\"'");
-  return (getCommentString(4, attrib).find(c) != -1) && (sq.find(c) == -1);
+  return (getCommentString(5, attrib).find(c) != -1) && (sq.find(c) == -1);
 }
 
@@ -2005,4 +2007,7 @@ bool KateHighlighting::canComment( int s
 QString KateHighlighting::getCommentString( int which, int attrib ) const
 {
+  if ( noHl )
+    return which == 4 ? stdDeliminator : "";
+
   int k = hlKeyForAttrib( attrib );
   const QStringList& lst = m_additionalData[k];

--- kdelibs/kate/part/katehighlight.h  #1.81:1.82
@@ -169,5 +169,5 @@ class KateHighlighting
      * Define comment marker type.
      */
-    enum commentData { Start, End, MultiLineRegion,SingleLine };
+    enum commentData { Start, End, MultiLineRegion, SingleLine };
 
     /**
@@ -195,4 +195,9 @@ class KateHighlighting
     QString getCommentSingleLineStart( int attrib=0 ) const;
 
+    /**
+    * @return the attribute for @p context.
+    */
+    int attribute( int context ) const;
+
     void clearAttributeArrays ();
 


Comment 4 Anders Lund 2004-10-10 22:03:40 UTC
CVS commit by alund: 

Backport fix for 90681
CCMAIL: 90681@bugs.kde.org


  M +3 -0      katehighlight.cpp   1.171.2.4


--- kdelibs/kate/part/katehighlight.cpp  #1.171.2.3:1.171.2.4
@@ -1990,4 +1990,7 @@ bool KateHighlighting::canComment( int s
 QString KateHighlighting::getCommentString( int which, int attrib ) const
 {
+  if ( noHl )
+    return which == 3 ? stdDeliminator : "";
+
   int k = hlKeyForAttrib( attrib );
   const QStringList& lst = m_additionalData[k];