xP: separate input buffers
This commit is contained in:
parent
5fd76ba6f9
commit
976e7bfbb4
|
@ -163,13 +163,22 @@ rpc.addEventListener('BufferRemove', event => {
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.addEventListener('BufferActivate', event => {
|
rpc.addEventListener('BufferActivate', event => {
|
||||||
let e = event.detail
|
let e = event.detail, b = buffers.get(e.bufferName)
|
||||||
|
let old = buffers.get(bufferCurrent)
|
||||||
bufferCurrent = e.bufferName
|
bufferCurrent = e.bufferName
|
||||||
setTimeout(() => {
|
|
||||||
let el = document.getElementById('input')
|
let textarea = document.getElementById('input')
|
||||||
if (el !== null)
|
if (textarea === null)
|
||||||
el.focus()
|
return
|
||||||
})
|
|
||||||
|
textarea.focus()
|
||||||
|
if (old !== undefined)
|
||||||
|
old.input = textarea.value
|
||||||
|
|
||||||
|
if (b !== undefined)
|
||||||
|
textarea.value = b.input || ''
|
||||||
|
else
|
||||||
|
textarea.value = ''
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.addEventListener('BufferLine', event => {
|
rpc.addEventListener('BufferLine', event => {
|
||||||
|
@ -388,8 +397,6 @@ function onKeyDown(event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This should be remembered across buffer switches,
|
|
||||||
// and we'll probably have to intercept /all/ key presses.
|
|
||||||
let Input = {
|
let Input = {
|
||||||
view: vnode => {
|
view: vnode => {
|
||||||
return m('textarea#input', {
|
return m('textarea#input', {
|
||||||
|
|
Loading…
Reference in New Issue