Fri, 06 Jan 2012 13:05:59 +0100
Fixed an issue searching backwards in the editor.
--- 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