Check view.HasBacking() before using view.backing

pull/232/head
Simon Roberts 3 years ago
parent 4319e00dd4
commit 1b23760167
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -216,12 +216,16 @@ func (view *View) SetWrap(enabled bool) error {
// SetStyle sets the text style for the view
func (view *View) SetStyle(st tcell.Style) {
view.backing.Style = st
if view.HasBacking() {
view.backing.Style = st
}
}
// SetStyle sets the selection text style for the view
func (view *View) SetSelStyle(st tcell.Style) {
view.backing.SelStyle = st
if view.HasBacking() {
view.backing.SelStyle = st
}
}
// Read reads data in bytes buffer

Loading…
Cancel
Save