chore: run stylua
This commit is contained in:
+11
-11
@@ -30,7 +30,7 @@ local state = {
|
||||
---@return string
|
||||
local function strip_ansi(text)
|
||||
local result =
|
||||
text:gsub("\x1b%[%??[0-9;]*[a-zA-Z]", ""):gsub("\x1b%][0-9;]*.-(\x1b\\|\x07)", ""):gsub("\x1b[()][0-9A-Za-z]", "")
|
||||
text:gsub("\x1b%[%??[0-9;]*[a-zA-Z]", ""):gsub("\x1b%][0-9;]*.-(\x1b\\|\x07)", ""):gsub("\x1b[()][0-9A-Za-z]", "")
|
||||
|
||||
return result
|
||||
end
|
||||
@@ -46,7 +46,7 @@ local function normalize_output(text)
|
||||
|
||||
text = text:gsub("\r\n", "\n")
|
||||
text =
|
||||
text:gsub("\x1b%[%??[0-9;]*[a-zA-Z]", ""):gsub("\x1b%][0-9;]*.-(\x1b\\|\x07)", ""):gsub("\x1b[()][0-9A-Za-z]", "")
|
||||
text:gsub("\x1b%[%??[0-9;]*[a-zA-Z]", ""):gsub("\x1b%][0-9;]*.-(\x1b\\|\x07)", ""):gsub("\x1b[()][0-9A-Za-z]", "")
|
||||
|
||||
local start_cr = text:len() > 0 and text:byte(1) == 0x0D
|
||||
|
||||
@@ -80,17 +80,17 @@ end
|
||||
---@param line string
|
||||
local function apply_highlights(buf, line_idx, line)
|
||||
for _, p in ipairs({
|
||||
{ p = "[Ee][Rr][Rr][Oo][Rr]", h = "DiagnosticError" },
|
||||
{ p = "[Ff][Aa][Ii][Ll][Ee][Dd]?", h = "DiagnosticError" },
|
||||
{ p = "[Ee][Rr][Rr]!", h = "DiagnosticError" },
|
||||
{ p = "[Ff][Aa][Tt][Aa][Ll]", h = "DiagnosticError" },
|
||||
{ p = "[Ee][Rr][Rr][Oo][Rr]", h = "DiagnosticError" },
|
||||
{ p = "[Ff][Aa][Ii][Ll][Ee][Dd]?", h = "DiagnosticError" },
|
||||
{ p = "[Ee][Rr][Rr]!", h = "DiagnosticError" },
|
||||
{ p = "[Ff][Aa][Tt][Aa][Ll]", h = "DiagnosticError" },
|
||||
{ p = "[Ww][Aa][Rr][Nn][Ii][Nn][Gg]", h = "DiagnosticWarn" },
|
||||
{ p = "[Ww][Aa][Rr][Nn]!", h = "DiagnosticWarn" },
|
||||
{ p = "[Ww][Aa][Rr][Nn]!", h = "DiagnosticWarn" },
|
||||
{ p = "[Ss][Uu][Cc][Cc][Ee][Ss][Ss]", h = "DiagnosticOk" },
|
||||
{ p = "[Pp][Aa][Ss][Ss][Ee][Dd]", h = "DiagnosticOk" },
|
||||
{ p = "%^%d+ .-[Ss]ucceed", h = "DiagnosticOk" },
|
||||
{ p = "%[ok%]", h = "DiagnosticOk" },
|
||||
{ p = "[Oo][Kk]!", h = "DiagnosticOk" },
|
||||
{ p = "[Pp][Aa][Ss][Ss][Ee][Dd]", h = "DiagnosticOk" },
|
||||
{ p = "%^%d+ .-[Ss]ucceed", h = "DiagnosticOk" },
|
||||
{ p = "%[ok%]", h = "DiagnosticOk" },
|
||||
{ p = "[Oo][Kk]!", h = "DiagnosticOk" },
|
||||
}) do
|
||||
local s, e = line:find(p.p)
|
||||
|
||||
|
||||
@@ -223,7 +223,6 @@ describe("watchexec runner", function()
|
||||
assert.is_false(overwrite)
|
||||
end)
|
||||
|
||||
|
||||
it("does not detect overwrite on CRLF that starts with \\r", function()
|
||||
local _, overwrite = runner._normalize_output("\r\nxyz")
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ describe("watchexec window", function()
|
||||
local buf = window.get_buf()
|
||||
local maps = vim.api.nvim_buf_get_keymap(buf, "n")
|
||||
local found = false
|
||||
|
||||
|
||||
for _, m in ipairs(maps) do
|
||||
if m.lhs == "<Esc>" then
|
||||
found = true
|
||||
|
||||
Reference in New Issue
Block a user