浏览代码

ui: inline onMessageTextViewChanged handler

rigormorrtiss 4 年之前
父节点
当前提交
12ac9072b3
共有 1 个文件被更改,包括 3 次插入7 次删除
  1. 3 7
      ui/textviews.go

+ 3 - 7
ui/textviews.go

@@ -13,16 +13,12 @@ func NewMessagesTextView(app *tview.Application, theme *util.Theme) *tview.TextV
 		SetDynamicColors(true).
 		SetWordWrap(true).
 		ScrollToEnd().
-		SetChangedFunc(onMessagesTextViewChanged(app)).
+		SetChangedFunc(func() {
+			app.Draw()
+		}).
 		SetBackgroundColor(tcell.GetColor(theme.TextViewBackground)).
 		SetBorder(true).
 		SetBorderPadding(0, 0, 1, 1)
 
 	return messagesTextView
 }
-
-func onMessagesTextViewChanged(app *tview.Application) func() {
-	return func() {
-		app.Draw()
-	}
-}