Added file-header pattern support to syntax

This commit is contained in:
rxi
2020-06-08 16:11:22 +01:00
parent db471c0554
commit ba6c14846b
5 changed files with 13 additions and 4 deletions
+2 -1
View File
@@ -56,7 +56,8 @@ end
function Doc:reset_syntax()
local syn = syntax.get(self.filename or "")
local header = self:get_text(1, 1, self:position_offset(1, 1, 128))
local syn = syntax.get(self.filename or "", header)
if self.syntax ~= syn then
self.syntax = syn
self.highlighter:reset()