Browse Source

Ensure proper initialization of DefaultContentType in config

pull/289/head
Fabio Manganiello 3 months ago
parent
commit
40d48d2de3
No known key found for this signature in database
GPG Key ID: D90FBA7F76362774
  1. 1
      config/config.go
  2. 2
      config/toml.go
  3. 1
      config/toml_default.go

1
config/config.go

@ -842,6 +842,7 @@ func parseGeneral(cfg GeneralTOML) General {
general.ShowBoostedUser = NilDefaultBool(cfg.ShowBoostedUser, def.ShowBoostedUser)
general.DynamicTimelineName = NilDefaultBool(cfg.DynamicTimelineName, def.DynamicTimelineName)
general.CommandsInNewPane = NilDefaultBool(cfg.CommandsInNewPane, def.CommandsInNewPane)
general.DefaultContentType = NilDefaultString(cfg.DefaultContentType, def.DefaultContentType)
lp := NilDefaultString(cfg.ListPlacement, def.ListPlacement)
switch lp {

2
config/toml.go

@ -38,7 +38,7 @@ type GeneralTOML struct {
ShowBoostedUser *bool `toml:"show-boosted-user"`
DynamicTimelineName *bool `toml:"dynamic-timeline-name"`
CommandsInNewPane *bool `toml:"commands-in-new-pane"`
DefaultContentType string `toml:"default-content-type"`
DefaultContentType *string `toml:"default-content-type"`
}
type TimelineTOML struct {

1
config/toml_default.go

@ -43,6 +43,7 @@ var ConfigDefault = ConfigTOML{
TerminalTitle: ip(0),
LeaderKey: sp(""),
LeaderTimeout: ip64(1000),
DefaultContentType: sp("text/plain"),
NotificationsToHide: &[]string{},
Timelines: &[]TimelineTOML{
{

Loading…
Cancel
Save