@@ -87,6 +87,7 @@ var Finder = Module("finder", {
87
87
pattern = pattern . replace ( / \\ ( \\ [ c C l L ] ) / g, "$1" ) ;
88
88
89
89
findbar . _findField . value = pattern ;
90
+ this . _lastSearchPattern = pattern ;
90
91
} ,
91
92
92
93
/**
@@ -160,13 +161,15 @@ var Finder = Module("finder", {
160
161
*
161
162
* @param {boolean } reverse Whether to search forwards or backwards.
162
163
* @default false
163
- * @see Bug537013 https://bugzilla.mozilla.org/show_bug.cgi?id=537013
164
164
*/
165
165
findAgain : function ( reverse ) {
166
166
// Nothing to find?
167
- if ( ! this . findbarInitialized || ! this . findbar . _findField . value )
167
+ if ( ! this . _lastSearchPattern )
168
168
return ;
169
169
170
+ if ( this . _lastSearchPattern != this . findbar . _findField . value )
171
+ this . _processUserPattern ( this . _searchPattern ) ;
172
+
170
173
this . findbar . onFindAgainCommand ( reverse ) ;
171
174
} ,
172
175
@@ -220,23 +223,19 @@ var Finder = Module("finder", {
220
223
this . find ( pattern ) ;
221
224
}
222
225
223
- this . _lastSearchPattern = pattern ;
224
-
225
226
// TODO: move to find() when reverse incremental searching is kludged in
226
227
// need to find again for reverse searching
227
228
if ( this . _backwards )
228
229
this . findAgain ( true ) ;
229
230
230
231
if ( options [ "hlsearch" ] )
231
- this . highlight ( findbar . _findField . value ) ;
232
+ this . highlight ( ) ;
232
233
} ,
233
234
234
235
/**
235
236
* Highlights all occurances of <b>str</b> in the buffer.
236
- *
237
- * @param {string } str The string to highlight.
238
237
*/
239
- highlight : function ( str ) {
238
+ highlight : function ( ) {
240
239
let findbar = this . findbar ;
241
240
242
241
let btn = findbar . getElement ( "highlight" ) ;
0 commit comments