@@ -1286,7 +1286,7 @@ func (window *Window) loadPrivateChannel(channel *discordgo.Channel) {
1286
1286
func (window * Window ) insertNewLineAtCursor () {
1287
1287
window .messageInput .InsertCharacter ('\n' )
1288
1288
window .app .QueueUpdateDraw (func () {
1289
- window .messageInput .triggerHeightRequestIfNecessary ()
1289
+ window .messageInput .TriggerHeightRequestIfNecessary ()
1290
1290
window .messageInput .internalTextView .ScrollToHighlight ()
1291
1291
})
1292
1292
}
@@ -2229,6 +2229,18 @@ func (window *Window) handleGlobalShortcuts(event *tcell.EventKey) *tcell.EventK
2229
2229
return nil
2230
2230
}
2231
2231
2232
+ //This two have to work in baremode as well, since otherwise only the mouse
2233
+ //can be used for focus switching, which sucks in a terminal app.
2234
+ if shortcuts .FocusMessageInput .Equals (event ) {
2235
+ window .app .SetFocus (window .messageInput .GetPrimitive ())
2236
+ return nil
2237
+ }
2238
+
2239
+ if shortcuts .FocusMessageContainer .Equals (event ) {
2240
+ window .app .SetFocus (window .chatView .internalTextView )
2241
+ return nil
2242
+ }
2243
+
2232
2244
if window .app .GetRoot () != window .rootContainer {
2233
2245
return event
2234
2246
}
@@ -2278,14 +2290,10 @@ func (window *Window) handleGlobalShortcuts(event *tcell.EventKey) *tcell.EventK
2278
2290
} else if shortcuts .FocusGuildContainer .Equals (event ) {
2279
2291
window .SwitchToGuildsPage ()
2280
2292
window .app .SetFocus (window .guildList )
2281
- } else if shortcuts .FocusMessageContainer .Equals (event ) {
2282
- window .app .SetFocus (window .chatView .internalTextView )
2283
2293
} else if shortcuts .FocusUserContainer .Equals (event ) {
2284
2294
if window .activeView == Guilds && window .userList .internalTreeView .IsVisible () {
2285
2295
window .app .SetFocus (window .userList .internalTreeView )
2286
2296
}
2287
- } else if shortcuts .FocusMessageInput .Equals (event ) {
2288
- window .app .SetFocus (window .messageInput .GetPrimitive ())
2289
2297
} else {
2290
2298
return event
2291
2299
}
@@ -2321,12 +2329,22 @@ func (window *Window) toggleUserContainer() {
2321
2329
func (window * Window ) toggleBareChat () {
2322
2330
window .bareChat = ! window .bareChat
2323
2331
if window .bareChat {
2324
- window .chatView .internalTextView .SetBorder (false )
2325
- window .app .SetRoot (window .chatView .GetPrimitive (), true )
2332
+ window .chatView .internalTextView .SetBorderSides (true , false , true , false )
2333
+ window .messageInput .internalTextView .SetBorderSides (false , true , false , true )
2334
+ previousFocus := window .app .GetFocus ()
2335
+ window .app .SetRoot (window .chatArea , true )
2336
+ window .app .SetFocus (previousFocus )
2326
2337
} else {
2327
- window .chatView .internalTextView .SetBorder (true )
2338
+ window .chatView .internalTextView .SetBorderSides (true , true , true , true )
2339
+ window .messageInput .internalTextView .SetBorderSides (true , true , true , true )
2328
2340
window .app .SetRoot (window .rootContainer , true )
2341
+ window .app .SetFocus (window .messageInput .GetPrimitive ())
2329
2342
}
2343
+
2344
+ window .app .QueueUpdateDraw (func () {
2345
+ window .messageInput .TriggerHeightRequestIfNecessary ()
2346
+ window .chatView .Reprint ()
2347
+ })
2330
2348
}
2331
2349
2332
2350
// FindCommand searches through the registered command, whether any of them
0 commit comments