Append space to excmds again

This commit is contained in:
Oliver Blanthorn 2017-10-19 20:34:16 +01:00
commit 31ca72cc55
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
4 changed files with 6 additions and 30 deletions

View file

@ -37,7 +37,7 @@ function process() {
export function fillcmdline(newcommand?: string){
if (newcommand !== undefined) {
clInput.value = newcommand
clInput.value = newcommand + " "
}
// Focus is lost for some reason.
focus()

View file

@ -359,8 +359,6 @@ export function fillcmdline(str?: string) {
}
//#content
<<<<<<< Updated upstream
||||||| merged common ancestors
export function clipboard(excmd = "open"){
let scratchpad = document.createElement("input")
scratchpad.contentEditable = "true"
@ -369,7 +367,6 @@ export function clipboard(excmd = "open"){
scratchpad.value = window.location.href
scratchpad.select()
document.execCommand("Copy")
scratchpad.select()
// open is broken - fails with Failed to execute excmd: clipboard(...open)!
} else if (excmd == "open"){
scratchpad.focus()
@ -384,32 +381,6 @@ export function clipboard(excmd = "open"){
}
//#content
=======
export function clipboard(excmd = "open"){
let scratchpad = document.createElement("input")
scratchpad.contentEditable = "true"
document.documentElement.appendChild(scratchpad)
if (excmd == "yank"){
scratchpad.value = window.location.href
scratchpad.select()
document.execCommand("Copy")
// open is broken - fails with Failed to execute excmd: clipboard(...open)!
} else if (excmd == "open"){
console.log("blah")
scratchpad.focus()
scratchpad.select()
// document.execCommand("Paste")
let url = scratchpad.textContent
console.log(url)
// open(url)
}
// document.documentElement.removeChild(scratchpad)
// let pastecontent = scratchpad.textContent
// console.log(pastecontent)
}
//#content
>>>>>>> Stashed changes
export function resizecmdline() {
CommandLineContent.resize()
}

View file

@ -26,6 +26,8 @@
"bookmarks",
"contextMenus",
"cookies",
"clipboardWrite",
"clipboardRead",
"downloads",
"downloads.open",
"find",

View file

@ -38,6 +38,9 @@ export namespace normalmode {
["]]", "clicknext"],
["[[", "clicknext prev"],
["T", "current-url tab"],
["yy", "clipboard yank"],
["p", "clipboard open"],
["P", "clipboard tabopen"],
["j", "scrollline 10"],
["k", "scrollline -10"],
["h", "scrollx -5"],