Show the connection state in the neoirc-cli status bar (closes #229)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The status bar has colour tags turned on, so tview read "[connected]" and "[disconnected]" as colour names and dropped them. It dropped the bracketed part of a nick such as "erin[away]" the same way. renderStatusBar now passes the whole status line through tview.Escape, so every bracket shows as it is. TestStartUp checks that the status bar shows [disconnected] at start-up. TestStatusBar checks [connected] with plain nicks and with nicks that hold brackets. Model: opus-5-5
This commit is contained in:
+5
-2
@@ -332,10 +332,13 @@ func (ui *UI) renderStatusBar(
|
||||
|
||||
ui.statusBar.Clear()
|
||||
|
||||
_, _ = fmt.Fprintf(ui.statusBar,
|
||||
// The status bar has colour tags turned on, so tview would read
|
||||
// "[connected]", or a name in square brackets, as a colour tag
|
||||
// and drop it. Escape makes it show every bracket as it is.
|
||||
_, _ = fmt.Fprint(ui.statusBar, tview.Escape(fmt.Sprintf(
|
||||
" [%s] %s %s %s%s",
|
||||
connStatus, nick, bufInfo, target, unread,
|
||||
)
|
||||
)))
|
||||
}
|
||||
|
||||
func (ui *UI) getOrCreateBuffer(name string) *Buffer {
|
||||
|
||||
Reference in New Issue
Block a user