[BUG] 多行errorfmt 不显示匹配的错误信息
MaiLunJiye opened this issue · 1 comments
MaiLunJiye commented
非常喜欢这个插件的errorfmt功能,但是在处理多行errorfmt时候会出现匹配的错误信息在quickfix窗口消失问题。
复现步骤
配置:
{
'skywind3000/asynctasks.vim',
dependencies = {
'skywind3000/asyncrun.vim',
'nvim-telescope/telescope.nvim',
'GustavoKatel/telescope-asynctasks.nvim',
'voldikss/vim-floaterm',
},
init = function()
vim.g.asynctasks_extra_config = {'~/.config/nvim/tasks.ini'}
vim.g.asyncrun_open = 6
end
},
测试文件 test_output
ERROR: space prohibited before open square bracket '['
#62: FILE: net/ipv4/tcp.c:4231:
+ init_net.ipv4.sysctl_tcp_rmem [0] =SK_MEM_QUANTUM;
ERROR: spaces required around that '=' (ctx:WxV)
#62: FILE: net/ipv4/tcp.c:4231:
+ init_net.ipv4.sysctl_tcp_rmem [0] =SK_MEM_QUANTUM;
^
ERROR: space prohibited before open square bracket '['
#63: FILE: net/ipv4/tcp.c:4232:
+ init_net.ipv4.sysctl_tcp_rmem [1] =131072;
ERROR: spaces required around that '=' (ctx:WxV)
#63: FILE: net/ipv4/tcp.c:4232:
+ init_net.ipv4.sysctl_tcp_rmem [1] =131072;
^
ERROR: space prohibited before open square bracket '['
#64: FILE: net/ipv4/tcp.c:4233:
+ init_net.ipv4.sysctl_tcp_rmem [2] =max(131072, max_rshare);
ERROR: spaces required around that '=' (ctx:WxV)
#64: FILE: net/ipv4/tcp.c:4233:
+ init_net.ipv4.sysctl_tcp_rmem [2] =max(131072, max_rshare);
^
total: 6 errors, 0 warnings, 0 checks, 50 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
测试 task.ini
[test]
command=cat ./test_output.txt
cwd=$(VIM_ROOT)
output=quickfix
errorformat=%Z%p^,%C+%.%#,%C#%n: FILE: %f:%l:,%EERROR:\ %m
save=1
执行结果:
可以发现,所有efm匹配的错误日志行都消失了。
除非再次输入 :copen
才能达到预期效果:
skywind3000 commented
加个 once 即可,让输出在程序结束时一次性写入 quickfix 而不是实时分批写入:
[test]
command=cat ./test_output.txt
cwd=$(VIM_ROOT)
output=quickfix
errorformat=%Z%p^,%C+%.%#,%C#%n: FILE: %f:%l:,%EERROR:\ %m
save=1
once=1
详细见:https://github.com/skywind3000/asynctasks.vim/wiki/Task-Config