aboutsummaryrefslogtreecommitdiff
path: root/xP/public/xP.js
diff options
context:
space:
mode:
Diffstat (limited to 'xP/public/xP.js')
-rw-r--r--xP/public/xP.js28
1 files changed, 17 insertions, 11 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js
index dbba7e2..93fe642 100644
--- a/xP/public/xP.js
+++ b/xP/public/xP.js
@@ -687,18 +687,24 @@ let Status = {
let status = `${bufferCurrent}`
if (b.hideUnimportant)
status += `<H>`
+ return m('.status', {}, status)
+ },
+}
+let Prompt = {
+ view: vnode => {
// This should be handled differently, so don't mind the lookup.
- if (b.server !== undefined) {
- let state = b.server.state
- for (const s in Relay.ServerState)
- if (Relay.ServerState[s] == b.server.state) {
- state = s
- break
- }
- status += ` (${state})`
- }
- return m('.status', {}, status)
+ let b = buffers.get(bufferCurrent)
+ if (b === undefined || b.server === undefined)
+ return
+
+ let state = b.server.state
+ for (const s in Relay.ServerState)
+ if (Relay.ServerState[s] == b.server.state) {
+ state = s
+ break
+ }
+ return m('.prompt', {}, `(${state})`)
},
}
@@ -934,7 +940,7 @@ let Main = {
m('.title', {}, [`xP`, m(Toolbar)]),
m('.middle', {}, [m(BufferList), m(BufferContainer)]),
m(Status),
- m(Input),
+ m('.input', {}, [m(Prompt), m(Input)]),
])
},
}