Implement Bare mode on Ctrl+B by default. Fixes
MODIFY
shortcuts/shortcuts.go
shortcuts/shortcuts.go
@@ -113,6 +113,8 @@ var (
globalScope, tcell.NewEventKey(tcell.KeyRune, 'U', tcell.ModAlt))
ToggleCommandView = addShortcut("toggle_command_view", "Toggle command view",
globalScope, tcell.NewEventKey(tcell.KeyRune, '.', tcell.ModAlt))
+ ToggleBareChat = addShortcut("toggle_bare_chat", "Toggle bare chat",
+ globalScope, tcell.NewEventKey(tcell.KeyCtrlB, rune(tcell.KeyCtrlB), tcell.ModCtrl))
scopes []*Scope
Shortcuts []*Shortcut

MODIFY
ui/window.go
ui/window.go
@@ -89,6 +89,8 @@ type Window struct {
userActiveTimer *time.Timer
doRestart chan bool
+
+ bareChat bool
}
//NewWindow constructs the whole application window and also registers all
@@ -1977,6 +1979,11 @@ func (window *Window) handleGlobalShortcuts(event *tcell.EventKey) *tcell.EventK
return nil
}
+ if shortcuts.ToggleBareChat.Equals(event) {
+ window.toggleBareChat()
+ return nil
+ }
+
// Maybe compare directly to table?
if window.currentContainer != window.rootContainer {
return event
@@ -2055,6 +2062,19 @@ func (window *Window) handleGlobalShortcuts(event *tcell.EventKey) *tcell.EventK
return nil
}
+func (window *Window) toggleBareChat() {
+ window.bareChat = !window.bareChat
+ if window.bareChat {
+ window.chatView.internalTextView.SetBorder(false)
+ window.currentContainer = window.chatView.GetPrimitive()
+ window.app.SetRoot(window.chatView.GetPrimitive(), true)
+ } else {
+ window.chatView.internalTextView.SetBorder(true)
+ window.currentContainer = window.rootContainer
+ window.app.SetRoot(window.rootContainer, true)
+ }
+}
+
func (window *Window) FindCommand(name string) commands.Command {
for _, cmd := range window.commands {
if commands.CommandEquals(cmd, name) {

Implement Bare mode on Ctrl+B by default. Fixes #213