Fixed an issue searching backwards in the editor.

Fri, 06 Jan 2012 13:05:59 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 06 Jan 2012 13:05:59 +0100
changeset 1530
e008f34c245b
parent 1529
0705902d6c0f
child 1532
df0c2a045c72

Fixed an issue searching backwards in the editor.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric5.QScintilla.SearchReplaceWidget.html file | annotate | diff | comparison | revisions
QScintilla/SearchReplaceWidget.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric5.QScintilla.SearchReplaceWidget.html	Fri Jan 06 12:31:59 2012 +0100
+++ b/Documentation/Source/eric5.QScintilla.SearchReplaceWidget.html	Fri Jan 06 13:05:59 2012 +0100
@@ -153,7 +153,7 @@
 </p><dl>
 <dt><i>searchNext</i></dt>
 <dd>
-flag indicating to search for the next occurrence.
+flag indicating to search for the next occurrence (boolean).
 </dd>
 </dl><a NAME="SearchReplaceWidget.__findByReturnPressed" ID="SearchReplaceWidget.__findByReturnPressed"></a>
 <h4>SearchReplaceWidget.__findByReturnPressed</h4>
--- a/QScintilla/SearchReplaceWidget.py	Fri Jan 06 12:31:59 2012 +0100
+++ b/QScintilla/SearchReplaceWidget.py	Fri Jan 06 13:05:59 2012 +0100
@@ -301,8 +301,13 @@
                 line = self.__selection[2]
                 index = self.__selection[3]
             else:
-                line = lineFrom
-                index = indexFrom - 1
+                if (lineFrom, indexFrom) == (-1, -1):
+                    # no selection present
+                    line = cline
+                    index = cindex
+                else:
+                    line = lineFrom
+                    index = indexFrom - 1
             if self.ui.selectionCheckBox.isChecked() and \
                line == self.__selection[0] and \
                index >= 0 and \
@@ -474,7 +479,7 @@
         """
         Private method to replace one occurrence of text.
         
-        @param searchNext flag indicating to search for the next occurrence.
+        @param searchNext flag indicating to search for the next occurrence (boolean).
         """
         self.__finding = True
         

eric ide

mercurial