1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 21:57:58 +01:00

Add :keepalt.

This commit is contained in:
Doug Kearns
2009-09-14 15:00:35 +10:00
parent ae66253b18
commit 9ec2a359e7
7 changed files with 61 additions and 3 deletions

View File

@@ -353,6 +353,27 @@ function Tabs() //{{{
literal: 0
});
commands.add(["keepa[lt]"],
"Execute a command without changing the current alternate buffer",
function (args)
{
let alternate = tabs.alternate;
try
{
liberator.execute(args[0], null, true);
}
finally
{
tabs.updateSelectionHistory([tabs.getTab(), alternate]);
}
},
{
argCount: "+",
completer: function (context) completion.ex(context),
literal: 0
});
// TODO: this should open in a new tab positioned directly after the current one, not at the end
commands.add(["tab"],
"Execute a command and tell it to output in a new tab",
@@ -1167,12 +1188,15 @@ function Tabs() //{{{
// alternate after a restart is often incorrectly tab 1 when there
// shouldn't be one yet.
/**
* Called on each TabSelect event to update the tab selection history.
* Sets the current and alternate tabs, updating the tab selection
* history.
*
* @param {Array(Object)} tabs The current and alternate tab.
* @see tabs#alternate
*/
updateSelectionHistory: function ()
updateSelectionHistory: function (tabs)
{
alternates = [this.getTab(), alternates[0]];
alternates = tabs || [this.getTab(), alternates[0]];
}
};
//}}}

View File

@@ -18,6 +18,7 @@
(this might change again, as this is REALLY inconsistent, and i don't
know if I like copying bugs)
* add [c]:keepalt[c]
* add [c]:styledisable[c], [c]:styleenable[c], and [c]:styletoggle[c]
* add [c]:sanitize[c], 'sanitizetimespan' and 'sanitizeitems'
* add [c]:verbose[c]

View File

@@ -207,6 +207,7 @@ section::Ex{nbsp}commands[ex-cmd-index,:index]
||[c]:iunmap[c]|| Remove a mapping in Insert mode +
||[c]:javascript[c]|| Run a JavaScript command through eval() +
||[c]:jumps[c]|| Show jumplist +
||[c]:keepalt[c]|| Execute a command without changing the current alternate buffer +
||[c]:let[c]|| Set or list a variable +
||[c]:loadplugins[c]|| Immediately load all unloaded plugins +
||[c]:macros[c]|| List all macros +

View File

@@ -12,6 +12,21 @@ section::Listing{nbsp}tabs[listing-tabs]
________________________________________________________________________________
Show a list of buffers (=tabs) matching [a][filter][a]. Without [a][filter][a]
list all tabs.
A buffer may be marked with one of the following indicators:
[frame="topbot",grid="none",cols="1,10"]
|===============================================================================
|*%*|The current buffer
|*#*|The alternate buffer for [c]:e #[c] and [m]<C-^>[m]
|===============================================================================
________________________________________________________________________________
|:keepa| |:keepalt| +
||:keepa[lt] {cmd}||
________________________________________________________________________________
Execute a command without changing the current alternate buffer.
________________________________________________________________________________
section::Opening{nbsp}tabs[opening-tabs]

View File

@@ -2,6 +2,7 @@
// TODO: this should be generated by the Makefile in the same order as
// config.helpFiles
|intro.html|
include::intro.txt[]

View File

@@ -246,6 +246,7 @@ section::Ex{nbsp}commands[ex-cmd-index,:index]
||[c]:iunmap[c]|| Remove a mapping in Insert mode +
||[c]:javascript[c]|| Run a JavaScript command through eval() +
||[c]:jumps[c]|| Show jumplist +
||[c]:keepalt[c]|| Execute a command without changing the current alternate buffer +
||[c]:let[c]|| Set or list a variable +
||[c]:load[c]|| Load a playlist +
||[c]:loadplugins[c]|| Immediately load all unloaded plugins +

View File

@@ -12,6 +12,21 @@ section::Listing{nbsp}tabs[listing-tabs]
________________________________________________________________________________
Show a list of buffers (=tabs) matching [a][filter][a]. Without [a][filter][a]
list all tabs.
A buffer may be marked with one of the following indicators:
[frame="topbot",grid="none",cols="1,10"]
|===============================================================================
|*%*|The current buffer
|*#*|The alternate buffer for [c]:e #[c] and [m]<C-^>[m]
|===============================================================================
________________________________________________________________________________
|:keepa| |:keepalt|
||:keepa[lt] {cmd}||
________________________________________________________________________________
Execute a command without changing the current alternate buffer.
________________________________________________________________________________
section::Opening{nbsp}tabs[opening-tabs]