Fixed a few unicode related issues.

Sun, 01 Aug 2010 13:05:08 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 01 Aug 2010 13:05:08 +0200
changeset 448
a1f1b226ff4b
parent 447
d5a0302040e9
child 452
0bc58cbb64b2

Fixed a few unicode related issues.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Sat Jul 31 18:58:43 2010 +0200
+++ b/APIs/Python3/eric5.api	Sun Aug 01 13:05:08 2010 +0200
@@ -4932,6 +4932,7 @@
 eric5.QScintilla.QsciScintillaCompat.QSCINTILLA_VERSION?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.ArrowFoldStyle?7
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.ArrowTreeFoldStyle?7
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.UserSeparator?7
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.byteAt?4(pos)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.charAt?4(pos)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.clearAllIndicators?4(indicator)
@@ -5001,6 +5002,7 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setLexer?4(lex = None)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setStyleBits?4(bits)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setStyling?4(length, style)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.showUserList?4(id, lst)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.startStyling?4(pos, mask)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.styleAt?4(pos)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.zoomIn?4(zoom = 1)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sat Jul 31 18:58:43 2010 +0200
+++ b/Documentation/Help/source.qhp	Sun Aug 01 13:05:08 2010 +0200
@@ -5508,6 +5508,7 @@
       <keyword name="QsciScintillaCompat.setLexer" id="QsciScintillaCompat.setLexer" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setLexer" />
       <keyword name="QsciScintillaCompat.setStyleBits" id="QsciScintillaCompat.setStyleBits" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setStyleBits" />
       <keyword name="QsciScintillaCompat.setStyling" id="QsciScintillaCompat.setStyling" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setStyling" />
+      <keyword name="QsciScintillaCompat.showUserList" id="QsciScintillaCompat.showUserList" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.showUserList" />
       <keyword name="QsciScintillaCompat.startStyling" id="QsciScintillaCompat.startStyling" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.startStyling" />
       <keyword name="QsciScintillaCompat.styleAt" id="QsciScintillaCompat.styleAt" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.styleAt" />
       <keyword name="QsciScintillaCompat.zoomIn" id="QsciScintillaCompat.zoomIn" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.zoomIn" />
--- a/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sat Jul 31 18:58:43 2010 +0200
+++ b/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sun Aug 01 13:05:08 2010 +0200
@@ -56,7 +56,7 @@
 QsciScintilla
 <h3>Class Attributes</h3>
 <table>
-<tr><td>ArrowFoldStyle</td></tr><tr><td>ArrowTreeFoldStyle</td></tr>
+<tr><td>ArrowFoldStyle</td></tr><tr><td>ArrowTreeFoldStyle</td></tr><tr><td>UserSeparator</td></tr>
 </table>
 <h3>Methods</h3>
 <table>
@@ -277,6 +277,9 @@
 <td><a href="#QsciScintillaCompat.setStyling">setStyling</a></td>
 <td>Public method to style some text.</td>
 </tr><tr>
+<td><a href="#QsciScintillaCompat.showUserList">showUserList</a></td>
+<td>Public method to show a user supplied list.</td>
+</tr><tr>
 <td><a href="#QsciScintillaCompat.startStyling">startStyling</a></td>
 <td>Public method to prepare styling.</td>
 </tr><tr>
@@ -1128,6 +1131,19 @@
 <dd>
 style to set for text (integer)
 </dd>
+</dl><a NAME="QsciScintillaCompat.showUserList" ID="QsciScintillaCompat.showUserList"></a>
+<h4>QsciScintillaCompat.showUserList</h4>
+<b>showUserList</b>(<i>id, lst</i>)
+<p>
+        Public method to show a user supplied list.
+</p><dl>
+<dt><i>id</i></dt>
+<dd>
+id of the list (integer)
+</dd><dt><i>lst</i></dt>
+<dd>
+list to be show (list of strings)
+</dd>
 </dl><a NAME="QsciScintillaCompat.startStyling" ID="QsciScintillaCompat.startStyling"></a>
 <h4>QsciScintillaCompat.startStyling</h4>
 <b>startStyling</b>(<i>pos, mask</i>)
--- a/QScintilla/Editor.py	Sat Jul 31 18:58:43 2010 +0200
+++ b/QScintilla/Editor.py	Sun Aug 01 13:05:08 2010 +0200
@@ -2551,7 +2551,8 @@
         if wc is None or not useWordChars:
             regExp = QRegExp('[^\w_]', cs)
         else:
-            regExp = QRegExp('[^{0}]'.format(re.escape(wc)), cs)
+            wc = re.sub('\w', "", wc)
+            regExp = QRegExp('[^\w{0}]'.format(re.escape(wc)), cs)
         start = regExp.lastIndexIn(text, index) + 1
         end = regExp.indexIn(text, index)
         if start == end + 1 and index > 0:
--- a/QScintilla/MiniEditor.py	Sat Jul 31 18:58:43 2010 +0200
+++ b/QScintilla/MiniEditor.py	Sun Aug 01 13:05:08 2010 +0200
@@ -2187,7 +2187,8 @@
         if wc is None:
             regExp = QRegExp('[^\w_]', cs)
         else:
-            regExp = QRegExp('[^{0}]'.format(re.escape(wc)), cs)
+            wc = re.sub('\w', "", wc)
+            regExp = QRegExp('[^\w{0}]'.format(re.escape(wc)), cs)
         start = regExp.lastIndexIn(text, index) + 1
         end = regExp.indexIn(text, index)
         if start == end + 1 and index > 0:
--- a/QScintilla/QsciScintillaCompat.py	Sat Jul 31 18:58:43 2010 +0200
+++ b/QScintilla/QsciScintillaCompat.py	Sun Aug 01 13:05:08 2010 +0200
@@ -42,6 +42,8 @@
     ArrowFoldStyle      = QsciScintilla.BoxedTreeFoldStyle + 1
     ArrowTreeFoldStyle  = ArrowFoldStyle + 1
     
+    UserSeparator = '\x04'
+    
     def __init__(self, parent = None):
         """
         Constructor
@@ -1020,6 +1022,28 @@
             except AttributeError:
                 return ""
     
+    #####################################################################################
+    # replacements for buggy methods
+    #####################################################################################
+    
+    def showUserList(self, id, lst):
+        """
+        Public method to show a user supplied list.
+        
+        @param id id of the list (integer)
+        @param lst list to be show (list of strings)
+        """
+        if id <= 0:
+            return
+        
+        self.SendScintilla(QsciScintilla.SCI_AUTOCSETSEPARATOR, 
+                           ord(self.UserSeparator))
+        if self.isUtf8():
+            lst = self.UserSeparator.join(lst).encode("utf-8")
+        else:
+            lst = self.UserSeparator.join(lst).encode("latin-1")
+        self.SendScintilla(QsciScintilla.SCI_USERLISTSHOW, id, lst)
+    
 ##    #####################################################################################
 ##    # methods below have been added to QScintilla starting with version after 2.x
 ##    #####################################################################################

eric ide

mercurial