QScintilla/SearchReplaceWidget.py

changeset 1530
e008f34c245b
parent 1527
b60af978f526
child 2302
f29e9405c851
--- 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