Skip to content

Commit

Permalink
Remove unused newline toggle. Fixes #434
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 27, 2024
1 parent 4616f33 commit e6a2c3f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ type UserPreferences struct {
DisableDownloads bool `yaml:"disable_downloads"`
DisableNotifications bool `yaml:"disable_notifications"`
DisableShowURLs bool `yaml:"disable_show_urls"`
AltEnterToSend bool `yaml:"alt_enter_to_send"`

InlineURLMode string `yaml:"inline_url_mode"`
}
Expand Down
17 changes: 0 additions & 17 deletions ui/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -954,20 +954,6 @@ func (itm InvertedToggleMessage) Name() string {
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{
"rooms": HideMessage("Room list sidebar"),
"users": HideMessage("User list sidebar"),
Expand All @@ -983,7 +969,6 @@ var toggleMsg = map[string]ToggleMessage{
"unverified": SimpleToggleMessage("sending messages to unverified devices"),
"showurls": SimpleToggleMessage("show URLs in text format"),
"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 {
Expand Down Expand Up @@ -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.")
}
continue
case "newline":
val = &cmd.Config.Preferences.AltEnterToSend
default:
cmd.Reply("Unknown toggle %s. Use /toggle without arguments for a list of togglable things.", thing)
return
Expand Down

0 comments on commit e6a2c3f

Please sign in to comment.