widget: tolerate nil shader in Editor movement methods

Fixes gio#142

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-28 22:34:15 +02:00
parent 2f8833d985
commit 851255f7a6
2 changed files with 44 additions and 9 deletions
+6
View File
@@ -155,6 +155,12 @@ func TestEditorCaretConsistency(t *testing.T) {
}
}
func TestEditorNoLayout(t *testing.T) {
var e Editor
e.SetText("hi!\n")
e.Move(1)
}
// Generate generates a value of itself, for testing/quick.
func (editMutation) Generate(rand *rand.Rand, size int) reflect.Value {
t := editMutation(rand.Intn(int(moveLast)))