RasmusLindroth/tut

crash/panic after update to 1.0.28

r3k2 opened this issue · 2 comments

r3k2 commented
tut                                                                                                                                                                                                                     ░▒▓ ✔  took 2m 15s   at 18:28:25  
panic: template: toot.tmpl:23:31: executing "toot.tmpl" at <.Toot.SpoilerText>: can't evaluate field SpoilerText in type ui.Toot [recovered]
	panic: template: toot.tmpl:23:31: executing "toot.tmpl" at <.Toot.SpoilerText>: can't evaluate field SpoilerText in type ui.Toot

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
	/home/rek2/go/pkg/mod/github.com/rivo/tview@v0.0.0-20221217182043-ccce554c3803/application.go:244 +0x4d
panic({0x9469e0, 0xc000ad9180})
	/usr/lib/go/src/runtime/panic.go:884 +0x212
github.com/RasmusLindroth/tut/ui.drawStatus(0xc0000f0510, {0xa769a0, 0xc000084640}, 0xc0002bd500, 0xc00032c180, 0xc0008c6f00, 0x0?, 0x0, {0x0, 0x0})
	ui/item_status.go:254 +0x32b6
github.com/RasmusLindroth/tut/ui.DrawItem(0xc0000a3450?, {0xa769a0, 0xc000084640}, 0xc000350560?, 0xe?, 0x10)
	ui/item.go:84 +0x3f3
github.com/RasmusLindroth/tut/ui.(*Feed).DrawContent(0xc000380f40)
	ui/feed.go:84 +0xbc
github.com/RasmusLindroth/tut/ui.(*Timeline).DrawContent(...)
	ui/timeline.go:128
github.com/RasmusLindroth/tut/ui.(*Timeline).NextItemFeed(0xc000298340)
	ui/timeline.go:227 +0xa8
github.com/RasmusLindroth/tut/ui.(*TutView).InputMainViewFeed(0xc0009600c0?, 0xc000006228?)
	ui/input.go:226 +0x40e
github.com/RasmusLindroth/tut/ui.(*TutView).InputMainView(0xc000350500?, 0x0?)
	ui/input.go:200 +0x47
github.com/RasmusLindroth/tut/ui.(*TutView).Input(0xc0000f0510, 0xc000ad8f00?)
	ui/input.go:37 +0xc8
github.com/rivo/tview.(*Application).Run(0xc0003320e0)
	/home/rek2/go/pkg/mod/github.com/rivo/tview@v0.0.0-20221217182043-ccce554c3803/application.go:319 +0x66d
	```
	

Oh, I didn't think of custom templates when I renamed SpoilerText to CWText.

You'll have to edit your custom toot.tmpl and replace it with the new value to make tut work again

r3k2 commented

@RasmusLindroth thanks! That was it, and I forgot about the templates :) all working now. thank you <3