diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2021-11-18 12:27:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 12:27:46 -0700 |
commit | 5e46f649e27294ccb3688a43e6eb200aa4fe4ad3 (patch) | |
tree | cc5f2e06c22e0096628e77cc77a8a1690536e7c0 /runtime/lua/vim/diagnostic.lua | |
parent | a42a9accab39705776ac9ed1455f9650c29210f3 (diff) | |
download | rneovim-5e46f649e27294ccb3688a43e6eb200aa4fe4ad3.tar.gz rneovim-5e46f649e27294ccb3688a43e6eb200aa4fe4ad3.tar.bz2 rneovim-5e46f649e27294ccb3688a43e6eb200aa4fe4ad3.zip |
fix(diagnostic): don't use nil col if missing from qflist (#16357)
If the quickfixlist item doesn't contain a column it is reported as 0.
Rather than using a nil value in such a case (which breaks diagnostics
elsewhere), just keep the 0 value.
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 191b9b9145..0bc7a305f0 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -1545,7 +1545,7 @@ function M.fromqflist(list) for _, item in ipairs(list) do if item.valid == 1 then local lnum = math.max(0, item.lnum - 1) - local col = item.col > 0 and (item.col - 1) or nil + local col = math.max(0, item.col - 1) local end_lnum = item.end_lnum > 0 and (item.end_lnum - 1) or lnum local end_col = item.end_col > 0 and (item.end_col - 1) or col local severity = item.type ~= "" and M.severity[item.type] or M.severity.ERROR |