1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 04:54:10 +01:00

Closes issue #449.

This commit is contained in:
Kris Maglione
2011-10-07 03:17:52 -04:00
parent 7028b8b84e
commit 40a23fc7cd
3 changed files with 34 additions and 26 deletions

View File

@@ -95,7 +95,7 @@ var RangeFinder = Module("rangefinder", {
this.options["findflags"].forEach(function (f) replacer(f, f));
str = str.replace(/\\(.|$)/g, replacer);
let pattern = str.replace(/\\(.|$)/g, replacer);
// It's possible, with :tabdetach for instance, for the rangeFind to
// actually move from one window to another, which breaks things.
@@ -114,7 +114,9 @@ var RangeFinder = Module("rangefinder", {
this.rangeFind.highlighted = highlighted;
this.rangeFind.selections = selections;
}
return this.lastFindPattern = str;
if (str)
this.lastFindPattern = str;
return pattern;
},
find: function (pattern, backwards) {
@@ -168,6 +170,12 @@ var RangeFinder = Module("rangefinder", {
},
onSubmit: function (command) {
if (!command && this.lastFindPattern) {
this.find(this.lastFindPattern, this.backward);
this.findAgain();
return;
}
if (!this.options["incfind"] || !this.rangeFind || !this.rangeFind.found) {
this.clear();
this.find(command || this.lastFindPattern, this.backward);