fix(format): retain window state (jumplist/marks/etc)

This commit is contained in:
2025-10-27 20:02:44 +01:00
parent c0b30569ef
commit b0a7bde3f0
2 changed files with 113 additions and 36 deletions
+11 -3
View File
@@ -261,7 +261,7 @@ function M.setup()
stdin = true,
stdout = true,
pattern = "^.+:(%d+):(%d+): (%w+) %- (.*) %((.*)%)$",
groups = { "lnum", "col", "severity", "message", "source" },
groups = { "lnum", "col", "severity", "message", "code" },
source = "phpcs",
severity_map = {
error = vim.diagnostic.severity.ERROR,
@@ -370,8 +370,14 @@ function M.setup()
lhs = "<leader>lf",
rhs = function()
util.format({
cmd = { "stylua", "-" },
cmd = {
"stylua",
"--stdin-filepath",
"%file%",
"-",
},
output = "stdout",
auto_indent = true,
})
end,
},
@@ -382,11 +388,13 @@ function M.setup()
util.format({
cmd = {
"stylua",
"-",
"--range-start",
"%byte_start%",
"--range-end",
"%byte_end%",
"--stdin-filepath",
"%file%",
"-",
},
output = "stdout",
})