Added file-header pattern support to syntax

This commit is contained in:
rxi committed 2020-06-08 16:11:22 +01:00
1 parent db471c0554
commit ba6c14846b
5 files changed
+13 -4

No files matched your search

+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()