]> git.lizzy.rs Git - micro.git/commitdiff
Fix syntax highlighting on empty buffer
authorZachary Yedidia <zyedidia@gmail.com>
Mon, 29 Jan 2018 03:35:43 +0000 (22:35 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Mon, 29 Jan 2018 03:35:43 +0000 (22:35 -0500)
cmd/micro/settings.go

index 08d4adabaef6ed173edd5d30420aba2e53267bc4..cf1b209316ee5cb02568625e727fdf616317e456 100644 (file)
@@ -425,7 +425,9 @@ func SetLocalOption(option, value string, view *View) error {
                if !nativeValue.(bool) {
                        buf.ClearMatches()
                } else {
-                       buf.highlighter.HighlightStates(buf)
+                       if buf.highlighter != nil {
+                               buf.highlighter.HighlightStates(buf)
+                       }
                }
        }