Ver Fonte

refactor: remove intermediate var

ayn2op há 10 meses atrás
pai
commit
0243039600
2 ficheiros alterados com 1 adições e 4 exclusões
  1. 0 1
      cmd/message_input.go
  2. 1 3
      cmd/messages_text.go

+ 0 - 1
cmd/message_input.go

@@ -49,7 +49,6 @@ func newMessageInput(cfg *config.Config) *messageInput {
 	}
 
 	mi.Box = ui.NewConfiguredBox(mi.Box, &cfg.Theme)
-
 	mi.
 		SetTextStyle(tcell.StyleDefault.Background(tcell.GetColor(cfg.Theme.BackgroundColor))).
 		SetClipboard(func(s string) {

+ 1 - 3
cmd/messages_text.go

@@ -49,8 +49,6 @@ func newMessagesText(cfg *config.Config) *messagesText {
 	}
 
 	mt.Box = ui.NewConfiguredBox(mt.Box, &cfg.Theme)
-
-	t := cfg.Theme
 	mt.
 		SetDynamicColors(true).
 		SetRegions(true).
@@ -60,7 +58,7 @@ func newMessagesText(cfg *config.Config) *messagesText {
 		SetTitle("Messages").
 		SetInputCapture(mt.onInputCapture)
 
-	markdown.DefaultRenderer.AddOptions(renderer.WithOption("theme", t.MessagesText))
+	markdown.DefaultRenderer.AddOptions(renderer.WithOption("theme", cfg.Theme.MessagesText))
 	return mt
 }