Fixed an issue causing the 'Selection only' entry to remain selectable in the Find and Find&Replace widget for a rectangular selection.

Wed, 08 May 2013 18:34:20 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 08 May 2013 18:34:20 +0200
changeset 2650
1b495c651868
parent 2648
43a3bec63c09
child 2653
94ff2db166f5

Fixed an issue causing the 'Selection only' entry to remain selectable in the Find and Find&Replace widget for a rectangular selection.

QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
QScintilla/SearchReplaceWidget.py file | annotate | diff | comparison | revisions
--- a/QScintilla/QsciScintillaCompat.py	Mon May 06 19:58:43 2013 +0200
+++ b/QScintilla/QsciScintillaCompat.py	Wed May 08 18:34:20 2013 +0200
@@ -488,7 +488,10 @@
         
         @return flag indicating a rectangular selection.
         """
-        return self.SendScintilla(QsciScintilla.SCI_SELECTIONISRECTANGLE)
+        startLine, startIndex, endLine, endIndex = self.getSelection()
+        return startLine != -1 and \
+               startLine != endLine and \
+               self.SendScintilla(QsciScintilla.SCI_SELECTIONISRECTANGLE)
     
     def getRectangularSelection(self):
         """
--- a/QScintilla/SearchReplaceWidget.py	Mon May 06 19:58:43 2013 +0200
+++ b/QScintilla/SearchReplaceWidget.py	Wed May 08 18:34:20 2013 +0200
@@ -454,7 +454,7 @@
         @param editor reference to the editor (Editor)
         """
         if not self.__finding:
-            if editor.hasSelectedText():
+            if editor.hasSelectedText() and not editor.selectionIsRectangle():
                 line1, index1, line2, index2 = editor.getSelection()
                 if line1 != line2:
                     self.ui.selectionCheckBox.setEnabled(True)

eric ide

mercurial