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

Try to move the caret within the viewport on entering Caret or Find mode. Closes issue #170.

This commit is contained in:
Kris Maglione
2011-10-03 21:11:26 -04:00
parent b19375d109
commit 654cf64c02
7 changed files with 93 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ defineModule("finder", {
require: ["prefs"]
}, this);
this.lazyRequire("buffer", ["Buffer"]);
this.lazyRequire("overlay", ["overlay"]);
function equals(a, b) XPCNativeWrapper(a) == XPCNativeWrapper(b);
@@ -56,6 +57,8 @@ var RangeFinder = Module("rangefinder", {
this.commandline;
this.CommandMode(mode, this.content).open();
Buffer(this.content).resetCaret();
if (this.rangeFind && equals(this.rangeFind.window.get(), this.window))
this.rangeFind.reset();
this.find("", mode == this.modes.FIND_BACKWARD);