fix: diagnostic float would not open if scope=cursor (#275)
This commit is contained in:
parent
c4cc8240f1
commit
a1af7a1b59
3 changed files with 9 additions and 1 deletions
|
|
@ -463,6 +463,7 @@ M.try_write_changes = function(confirm, cb)
|
||||||
local was_modified = vim.bo.modified
|
local was_modified = vim.bo.modified
|
||||||
local buffers = view.get_all_buffers()
|
local buffers = view.get_all_buffers()
|
||||||
local all_diffs = {}
|
local all_diffs = {}
|
||||||
|
---@type table<integer, oil.ParseError[]>
|
||||||
local all_errors = {}
|
local all_errors = {}
|
||||||
|
|
||||||
mutation_in_progress = true
|
mutation_in_progress = true
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ M.parse = function(bufnr)
|
||||||
name = name:lower()
|
name = name:lower()
|
||||||
end
|
end
|
||||||
if seen_names[name] then
|
if seen_names[name] then
|
||||||
table.insert(errors, { message = "Duplicate filename", lnum = i - 1, col = 0 })
|
table.insert(errors, { message = "Duplicate filename", lnum = i - 1, end_lnum = i, col = 0 })
|
||||||
else
|
else
|
||||||
seen_names[name] = true
|
seen_names[name] = true
|
||||||
end
|
end
|
||||||
|
|
@ -200,6 +200,7 @@ M.parse = function(bufnr)
|
||||||
table.insert(errors, {
|
table.insert(errors, {
|
||||||
message = err,
|
message = err,
|
||||||
lnum = i - 1,
|
lnum = i - 1,
|
||||||
|
end_lnum = i,
|
||||||
col = 0,
|
col = 0,
|
||||||
})
|
})
|
||||||
goto continue
|
goto continue
|
||||||
|
|
@ -221,6 +222,7 @@ M.parse = function(bufnr)
|
||||||
table.insert(errors, {
|
table.insert(errors, {
|
||||||
message = message,
|
message = message,
|
||||||
lnum = i - 1,
|
lnum = i - 1,
|
||||||
|
end_lnum = i,
|
||||||
col = 0,
|
col = 0,
|
||||||
})
|
})
|
||||||
goto continue
|
goto continue
|
||||||
|
|
@ -273,6 +275,7 @@ M.parse = function(bufnr)
|
||||||
table.insert(errors, {
|
table.insert(errors, {
|
||||||
message = "Paths cannot start with '/'",
|
message = "Paths cannot start with '/'",
|
||||||
lnum = i - 1,
|
lnum = i - 1,
|
||||||
|
end_lnum = i,
|
||||||
col = 0,
|
col = 0,
|
||||||
})
|
})
|
||||||
goto continue
|
goto continue
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,7 @@ describe("parser", function()
|
||||||
{
|
{
|
||||||
message = "Malformed ID at start of line",
|
message = "Malformed ID at start of line",
|
||||||
lnum = 0,
|
lnum = 0,
|
||||||
|
end_lnum = 1,
|
||||||
col = 0,
|
col = 0,
|
||||||
},
|
},
|
||||||
}, errors)
|
}, errors)
|
||||||
|
|
@ -126,6 +127,7 @@ describe("parser", function()
|
||||||
{
|
{
|
||||||
message = "No filename found",
|
message = "No filename found",
|
||||||
lnum = 0,
|
lnum = 0,
|
||||||
|
end_lnum = 1,
|
||||||
col = 0,
|
col = 0,
|
||||||
},
|
},
|
||||||
}, errors)
|
}, errors)
|
||||||
|
|
@ -143,6 +145,7 @@ describe("parser", function()
|
||||||
{
|
{
|
||||||
message = "Duplicate filename",
|
message = "Duplicate filename",
|
||||||
lnum = 1,
|
lnum = 1,
|
||||||
|
end_lnum = 2,
|
||||||
col = 0,
|
col = 0,
|
||||||
},
|
},
|
||||||
}, errors)
|
}, errors)
|
||||||
|
|
@ -161,6 +164,7 @@ describe("parser", function()
|
||||||
{
|
{
|
||||||
message = "Duplicate filename",
|
message = "Duplicate filename",
|
||||||
lnum = 1,
|
lnum = 1,
|
||||||
|
end_lnum = 2,
|
||||||
col = 0,
|
col = 0,
|
||||||
},
|
},
|
||||||
}, errors)
|
}, errors)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue