1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-21 00:05:47 +01:00

Deal with echoed messages being cleared by scroll event. Closes issue #374.

This commit is contained in:
Kris Maglione
2011-03-05 06:54:44 -05:00
parent 96c5044ac4
commit cf681d5cbb
4 changed files with 24 additions and 17 deletions

View File

@@ -93,10 +93,8 @@ var RangeFinder = Module("rangefinder", {
find: function (pattern, backwards) {
let str = this.bootstrap(pattern, backwards);
if (!this.rangeFind.find(str))
this.timeout(function () {
this.dactyl.echoerr("E486: Pattern not found: " + pattern,
this.commandline.FORCE_SINGLELINE);
});
this.dactyl.echoerr("E486: Pattern not found: " + pattern,
this.commandline.FORCE_SINGLELINE);
return this.rangeFind.found;
},
@@ -107,15 +105,12 @@ var RangeFinder = Module("rangefinder", {
else if (!this.rangeFind.find(null, reverse))
this.dactyl.echoerr("E486: Pattern not found: " + this.lastFindPattern,
this.commandline.FORCE_SINGLELINE);
else if (this.rangeFind.wrapped)
// hack needed, because wrapping causes a "scroll" event which
// clears our command line
this.timeout(function () {
let msg = this.rangeFind.backward ? "find hit TOP, continuing at BOTTOM"
: "find hit BOTTOM, continuing at TOP";
this.commandline.echo(msg, "WarningMsg", this.commandline.APPEND_TO_MESSAGES
| this.commandline.FORCE_SINGLELINE);
}, 0);
else if (this.rangeFind.wrapped) {
let msg = this.rangeFind.backward ? "find hit TOP, continuing at BOTTOM"
: "find hit BOTTOM, continuing at TOP";
this.commandline.echo(msg, "WarningMsg", this.commandline.APPEND_TO_MESSAGES
| this.commandline.FORCE_SINGLELINE);
}
else
this.commandline.echo((this.rangeFind.backward ? "?" : "/") + this.lastFindPattern,
"Normal", this.commandline.FORCE_SINGLELINE);