Skip to content

Commit

Permalink
Change the linter match to a regex in the file name when "domatch=true"
Browse files Browse the repository at this point in the history
  • Loading branch information
taconi committed Mar 1, 2024
1 parent 59dda01 commit 7f3f792
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/plugins/linter/linter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local buffer = import("micro/buffer")
local config = import("micro/config")
local util = import("micro/util")
local os = import("os")
local regexp = import("regexp")

local linters = {}

Expand Down Expand Up @@ -115,7 +116,7 @@ function runLinter(buf)
for k, v in pairs(linters) do
local ftmatch = ft == v.filetype
if v.domatch then
ftmatch = string.match(ft, v.filetype)
ftmatch = regexp.MatchString(v.filetype, buf.AbsPath)
end

local hasOS = contains(v.os, runtime.GOOS)
Expand Down

0 comments on commit 7f3f792

Please sign in to comment.