mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 00:17:58 +01:00
move global quit() command to a vimperator slot
This commit is contained in:
@@ -593,7 +593,7 @@ function Commands() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["quita[ll]", "qa[ll]"],
|
addDefaultCommand(new Command(["quita[ll]", "qa[ll]"],
|
||||||
function() { quit(false); },
|
function() { vimperator.quit(false); },
|
||||||
{
|
{
|
||||||
usage: ["quita[ll]"],
|
usage: ["quita[ll]"],
|
||||||
short_help: "Quit Vimperator",
|
short_help: "Quit Vimperator",
|
||||||
@@ -811,7 +811,7 @@ function Commands() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["xa[ll]", "wqa[ll]", "wq"],
|
addDefaultCommand(new Command(["xa[ll]", "wqa[ll]", "wq"],
|
||||||
function() { quit(true); },
|
function() { vimperator.quit(true); },
|
||||||
{
|
{
|
||||||
usage: ["wqa[ll]", "xa[ll]"],
|
usage: ["wqa[ll]", "xa[ll]"],
|
||||||
short_help: "Save the session and quit",
|
short_help: "Save the session and quit",
|
||||||
@@ -1536,7 +1536,7 @@ Vimperator.prototype.beep = function()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// quit vimperator, no matter how many tabs/windows are open
|
// quit vimperator, no matter how many tabs/windows are open
|
||||||
function quit(save_session)
|
Vimperator.prototype.quit = function(save_session)
|
||||||
{
|
{
|
||||||
if (save_session)
|
if (save_session)
|
||||||
Options.setFirefoxPref("browser.startup.page", 3); // start with saved session
|
Options.setFirefoxPref("browser.startup.page", 3); // start with saved session
|
||||||
|
|||||||
@@ -460,14 +460,14 @@ function Mappings() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["ZQ"],
|
addDefaultMap(new Map(vimperator.modes.NORMAL, ["ZQ"],
|
||||||
function(count) { quit(false); },
|
function(count) { vimperator.quit(false); },
|
||||||
{
|
{
|
||||||
short_help: "Quit and don't save the session",
|
short_help: "Quit and don't save the session",
|
||||||
help: "Works like <code class=\"command\">:qall</code>."
|
help: "Works like <code class=\"command\">:qall</code>."
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["ZZ"],
|
addDefaultMap(new Map(vimperator.modes.NORMAL, ["ZZ"],
|
||||||
function(count) { quit(true); },
|
function(count) { vimperator.quit(true); },
|
||||||
{
|
{
|
||||||
short_help: "Quit and save the session",
|
short_help: "Quit and save the session",
|
||||||
help: "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.<br/>" +
|
help: "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.<br/>" +
|
||||||
|
|||||||
@@ -985,7 +985,7 @@ function Tabs() //{{{
|
|||||||
if (count < 1) count = 1;
|
if (count < 1) count = 1;
|
||||||
|
|
||||||
if (quit_on_last_tab >= 1 && getBrowser().mTabs.length <= count)
|
if (quit_on_last_tab >= 1 && getBrowser().mTabs.length <= count)
|
||||||
quit(quit_on_last_tab == 2);
|
vimperator.quit(quit_on_last_tab == 2);
|
||||||
|
|
||||||
if(focus_left_tab && tab.previousSibling)
|
if(focus_left_tab && tab.previousSibling)
|
||||||
this.select("-1", false);
|
this.select("-1", false);
|
||||||
|
|||||||
Reference in New Issue
Block a user