mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 23:57:59 +01:00
commands in the -- more -- prompt are now passed to vimperator if they don't make sense in the MOW
This commit is contained in:
@@ -222,6 +222,8 @@ function Buffer() //{{{
|
|||||||
|
|
||||||
[number, title] = items[i][0].split(/:\s+/, 2);
|
[number, title] = items[i][0].split(/:\s+/, 2);
|
||||||
url = items[i][1];
|
url = items[i][1];
|
||||||
|
url = url.replace(/>/, ">").replace(/</, "<");
|
||||||
|
title = title.replace(/>/, ">").replace(/</, "<");
|
||||||
|
|
||||||
list += "<tr><td align=\"right\"> " + number + "</td><td>" + indicator + "</td><td>" + title + "</td><td><span style=\"color: green\">" + url + "</span></td></tr>";
|
list += "<tr><td align=\"right\"> " + number + "</td><td>" + indicator + "</td><td>" + title + "</td><td><span style=\"color: green\">" + url + "</span></td></tr>";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,9 @@ function Search() //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var leader = lastsearch_backwards ? "?" : "/";
|
var leader = lastsearch_backwards ? "?" : "/";
|
||||||
vimperator.commandline.echo(leader + lastsearch);
|
setTimeout(function() {
|
||||||
|
vimperator.commandline.echo(leader + lastsearch);
|
||||||
|
}, 10);
|
||||||
|
|
||||||
var up = reverse ? !lastsearch_backwards : lastsearch_backwards;
|
var up = reverse ? !lastsearch_backwards : lastsearch_backwards;
|
||||||
var result = getBrowser().fastFind.findAgain(up, false);
|
var result = getBrowser().fastFind.findAgain(up, false);
|
||||||
|
|||||||
@@ -133,9 +133,9 @@ vimperator.modes = (function()
|
|||||||
MENU: 1 << 18, // a popupmenu is active
|
MENU: 1 << 18, // a popupmenu is active
|
||||||
LINE: 1 << 19, // linewise visual mode
|
LINE: 1 << 19, // linewise visual mode
|
||||||
|
|
||||||
reset: function()
|
reset: function(silent)
|
||||||
{
|
{
|
||||||
this.set(vimperator.modes.NORMAL, vimperator.modes.NONE);
|
this.set(vimperator.modes.NORMAL, vimperator.modes.NONE, silent);
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function()
|
show: function()
|
||||||
|
|||||||
@@ -342,8 +342,7 @@ function CommandLine() //{{{
|
|||||||
{
|
{
|
||||||
var mode = cur_extended_mode; // save it here, as setMode() resets it
|
var mode = cur_extended_mode; // save it here, as setMode() resets it
|
||||||
addToHistory(command);
|
addToHistory(command);
|
||||||
vimperator.modes.reset(); //FIXME: use mode stack
|
vimperator.modes.reset(true); //FIXME: use mode stack
|
||||||
//vimperator.modes.set(old_mode, old_extended_mode, true);
|
|
||||||
//vimperator.focusContent();
|
//vimperator.focusContent();
|
||||||
completionlist.hide();
|
completionlist.hide();
|
||||||
vimperator.statusline.updateProgress(""); // we may have a "match x of y" visible
|
vimperator.statusline.updateProgress(""); // we may have a "match x of y" visible
|
||||||
@@ -602,11 +601,13 @@ function CommandLine() //{{{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide()
|
function pass(event)
|
||||||
{
|
{
|
||||||
multiline_output_widget.collapsed = true;
|
multiline_output_widget.collapsed = true;
|
||||||
// FIXME: use mode stack
|
// FIXME: use mode stack
|
||||||
vimperator.modes.reset();
|
vimperator.modes.reset();
|
||||||
|
|
||||||
|
vimperator.events.onKeyPress(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
var key = vimperator.events.toString(event);
|
var key = vimperator.events.toString(event);
|
||||||
@@ -622,7 +623,7 @@ function CommandLine() //{{{
|
|||||||
if (canScroll() == 2)
|
if (canScroll() == 2)
|
||||||
multiline_output_widget.contentWindow.scrollByLines(1);
|
multiline_output_widget.contentWindow.scrollByLines(1);
|
||||||
else
|
else
|
||||||
hide();
|
pass(event);
|
||||||
break;
|
break;
|
||||||
case "k":
|
case "k":
|
||||||
case "<Up>":
|
case "<Up>":
|
||||||
@@ -630,19 +631,19 @@ function CommandLine() //{{{
|
|||||||
if (canScroll() >= 1)
|
if (canScroll() >= 1)
|
||||||
multiline_output_widget.contentWindow.scrollByLines(-1);
|
multiline_output_widget.contentWindow.scrollByLines(-1);
|
||||||
else
|
else
|
||||||
hide();
|
pass(event);
|
||||||
break;
|
break;
|
||||||
case "f":
|
case "f":
|
||||||
if (canScroll() == 2)
|
if (canScroll() == 2)
|
||||||
multiline_output_widget.contentWindow.scrollByPages(1);
|
multiline_output_widget.contentWindow.scrollByPages(1);
|
||||||
else
|
else
|
||||||
hide();
|
pass(event);
|
||||||
break;
|
break;
|
||||||
case "b":
|
case "b":
|
||||||
if (canScroll() >= 1)
|
if (canScroll() >= 1)
|
||||||
multiline_output_widget.contentWindow.scrollByPages(-1);
|
multiline_output_widget.contentWindow.scrollByPages(-1);
|
||||||
else
|
else
|
||||||
hide();
|
pass(event);
|
||||||
break;
|
break;
|
||||||
case "g":
|
case "g":
|
||||||
multiline_output_widget.contentWindow.scrollTo(0, 0);
|
multiline_output_widget.contentWindow.scrollTo(0, 0);
|
||||||
@@ -653,9 +654,9 @@ function CommandLine() //{{{
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (canScroll() == 0 || vimperator.events.isCancelKey(key))
|
if (canScroll() == 0 || vimperator.events.isCancelKey(key))
|
||||||
hide();
|
pass(event);
|
||||||
else if (canScroll() == 1 && vimperator.events.isAcceptKey(key))
|
else if (canScroll() == 1 && vimperator.events.isAcceptKey(key))
|
||||||
hide();
|
pass(event);
|
||||||
else
|
else
|
||||||
; // show a more help inline like in vim
|
; // show a more help inline like in vim
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user