diff --git a/runtime/plugins/linter/linter.lua b/runtime/plugins/linter/linter.lua index 3256bad792..4abfd8c73d 100644 --- a/runtime/plugins/linter/linter.lua +++ b/runtime/plugins/linter/linter.lua @@ -189,7 +189,7 @@ function onExit(output, args) elseif col == nil then hascol = false end - if basename(buf.Path) == basename(file) then + if filepath.Base(buf.Path) == filepath.Base(file) then local bmsg = nil if hascol then local mstart = buffer.Loc(tonumber(col-1+coff), tonumber(line-1+loff)) @@ -212,12 +212,3 @@ function split(str, sep) end return result end - -function basename(file) - local sep = "/" - if runtime.GOOS == "windows" then - sep = "\\" - end - local name = string.gsub(file, "(.*" .. sep .. ")(.*)", "%2") - return name -end