Reduce the size of hinting*.ts

by adding some more lines of code
This commit is contained in:
Oliver Blanthorn 2018-07-20 17:39:00 +01:00
parent 247fc05d1c
commit a2e95035dd
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -659,6 +659,16 @@ function hintPageExStr(...exStr: string[]) {
})
}
async function hintPagePipe(selectors,key) {
let hint = await new Promise(resolve => {
hintPage(hintables(selectors, true), resolve)
})
return (hint as any).target[key]
// Promise takes function which it calls immediately with another function
// as its argument. When this second function is called, it gives its
// argument to the promise as its value
}
function hintPageTextYank() {
hintPage(elementswithtext(), hint => {
messageActiveTab("commandline_frame", "setClipboard", [