Remove unused newline toggle. Fixes #434

This commit is contained in:
Tulir Asokan 2024-07-27 11:57:25 +03:00
parent 4616f33d50
commit e6a2c3ff85
2 changed files with 0 additions and 18 deletions

View file

@ -59,7 +59,6 @@ type UserPreferences struct {
DisableDownloads bool `yaml:"disable_downloads"` DisableDownloads bool `yaml:"disable_downloads"`
DisableNotifications bool `yaml:"disable_notifications"` DisableNotifications bool `yaml:"disable_notifications"`
DisableShowURLs bool `yaml:"disable_show_urls"` DisableShowURLs bool `yaml:"disable_show_urls"`
AltEnterToSend bool `yaml:"alt_enter_to_send"`
InlineURLMode string `yaml:"inline_url_mode"` InlineURLMode string `yaml:"inline_url_mode"`
} }

View file

@ -954,20 +954,6 @@ func (itm InvertedToggleMessage) Name() string {
return string(unicode.ToUpper(rune(itm[0]))) + string(itm[1:]) return string(unicode.ToUpper(rune(itm[0]))) + string(itm[1:])
} }
type NewlineKeybindMessage string
func (nkm NewlineKeybindMessage) Format(state bool) string {
if state {
return "Now using <enter> to create new line and <alt+enter> to send"
} else {
return "Now using <enter> to send and <alt+enter> to create new line"
}
}
func (nkm NewlineKeybindMessage) Name() string {
return string(nkm)
}
var toggleMsg = map[string]ToggleMessage{ var toggleMsg = map[string]ToggleMessage{
"rooms": HideMessage("Room list sidebar"), "rooms": HideMessage("Room list sidebar"),
"users": HideMessage("User list sidebar"), "users": HideMessage("User list sidebar"),
@ -983,7 +969,6 @@ var toggleMsg = map[string]ToggleMessage{
"unverified": SimpleToggleMessage("sending messages to unverified devices"), "unverified": SimpleToggleMessage("sending messages to unverified devices"),
"showurls": SimpleToggleMessage("show URLs in text format"), "showurls": SimpleToggleMessage("show URLs in text format"),
"inlineurls": InvertedToggleMessage("use fancy terminal features to render URLs inside text"), "inlineurls": InvertedToggleMessage("use fancy terminal features to render URLs inside text"),
"newline": NewlineKeybindMessage("should <alt+enter> make a new line or send the message"),
} }
func makeUsage() string { func makeUsage() string {
@ -1040,8 +1025,6 @@ func cmdToggle(cmd *Command) {
cmd.Reply("Force-enabled using fancy terminal features to render URLs inside text. Restart gomuks to apply changes.") cmd.Reply("Force-enabled using fancy terminal features to render URLs inside text. Restart gomuks to apply changes.")
} }
continue continue
case "newline":
val = &cmd.Config.Preferences.AltEnterToSend
default: default:
cmd.Reply("Unknown toggle %s. Use /toggle without arguments for a list of togglable things.", thing) cmd.Reply("Unknown toggle %s. Use /toggle without arguments for a list of togglable things.", thing)
return return