From 430da6131458609ba28da7b952349169ec84c873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:25:09 +0200 Subject: [PATCH] highlighter: Remove EmptyDef since it's superseeded by a nil check of SyntaxDef --- internal/buffer/buffer.go | 2 -- pkg/highlight/highlighter.go | 3 --- 2 files changed, 5 deletions(-) diff --git a/internal/buffer/buffer.go b/internal/buffer/buffer.go index 6865fe12..772ee00a 100644 --- a/internal/buffer/buffer.go +++ b/internal/buffer/buffer.go @@ -908,8 +908,6 @@ func (b *Buffer) UpdateRules() { if b.SyntaxDef != nil { b.Settings["filetype"] = b.SyntaxDef.FileType } - } else { - b.SyntaxDef = &highlight.EmptyDef } if b.SyntaxDef != nil { diff --git a/pkg/highlight/highlighter.go b/pkg/highlight/highlighter.go index 10a78d5c..ebcd2aaa 100644 --- a/pkg/highlight/highlighter.go +++ b/pkg/highlight/highlighter.go @@ -67,9 +67,6 @@ func combineLineMatch(src, dst LineMatch) LineMatch { // A State represents the region at the end of a line type State *region -// EmptyDef is an empty definition. -var EmptyDef = Def{nil, &rules{}} - // LineStates is an interface for a buffer-like object which can also store the states and matches for every line type LineStates interface { LineBytes(n int) []byte