Add open excmd

This commit is contained in:
Oliver Blanthorn 2017-10-05 22:05:25 +01:00 committed by Colin Caine
parent f990bd0134
commit 4dc218084d
2 changed files with 8 additions and 1 deletions

View file

@ -137,10 +137,14 @@ export async function tabnext(increment = 1) {
}
export function tabprev(increment = 1) { tabnext(increment*-1) }
// History functions
// History/navigation functions
export function history(n = 1) {messageActiveTab("history",[n])}
export function historyback(n = 1) {history(n*-1)}
export function historyforward(n = 1) {history(n)}
export function open(url: string) {
url = (hasScheme(url)? "" : "http://") + url
messageActiveTab("open", [url])
}
// Misc functions
export function focuscmdline() { messageActiveTab("focuscmdline") }

View file

@ -23,6 +23,9 @@ const commands = new Map<string, ContentCommand>([
function history(n: number) {
window.history.go(n)
},
function open(url: string) {
window.location.href = url
},
function showcommandline() {
CommandLineContent.focus()
},