feat(config): add toggleable auto focus on channel select (#671)

Co-authored-by: Ayyan <ayn2op@gmail.com>
This commit is contained in:
Vara Rahul Rajana 2025-12-22 06:30:20 +05:30 • committed by GitHub
parent 88c7a75222
commit 6f7381df9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View file

@ -194,7 +194,9 @@ func (gt *guildsTree) onSelected(node *tview.TreeNode) {
app.chatView.messageInput.SetPlaceholder("You do not have permission to send messages in this channel.")
} else {
app.chatView.messageInput.SetPlaceholder("Message...")
app.SetFocus(app.chatView.messageInput)
if gt.cfg.AutoFocus {
app.SetFocus(app.chatView.messageInput)
}
}
case nil: // Direct messages folder

View file

@ -32,8 +32,9 @@ type (
}
Config struct {
Mouse bool `toml:"mouse"`
Editor string `toml:"editor"`
AutoFocus bool `toml:"auto_focus"`
Mouse bool `toml:"mouse"`
Editor string `toml:"editor"`
Status discord.Status `toml:"status"`

View file

@ -1,3 +1,7 @@
# Whether to focus the message input automatically when a channel is selected.
# Set to false to preview channels without moving focus.
auto_focus = true
# Whether to enable mouse or not.
mouse = true
# The program to open when the `keys.message_input.editor` keymap is pressed. Set the value to `"default"` to use `$EDITOR`.