Error detected while processing function ack#Ack[41]
astavonin opened this issue ยท 9 comments
Configuration:
- Windows 10 64 bit;
- PowerShell 5.1;
- NVIM v0.3.0;
- ack.vim (latest, installed thru Plug);
- ag version 2.1.0 (activated as described in "Can I use ag ...").
In Vim I'm executing:
:Ack something
Log file:
Searching ...
Error detected while processing function ack#Ack[41]..<SNR>86_SearchWithGrep:
line 8:
E40: Can't open errorfile C:\Users\ASTAVO~1\AppData\Local\Temp\nvimEjmCaX\0
Error detected while processing function ack#Ack:
line 41:
E171: Missing :endif
Press ENTER or type command to continue
I can help with debugging or provide any extra information, if it'll help.
I have the same issue but I'm working with debian 9.5 with vim 8, ack 2.15.
I have the same issue as well. I have identical specs to astavonin.
Same here, the same specs as hachreak
An :Ack
invocation uses :grep
under the hood. When Vim executes :grep
, it creates a temporary file to hold the results, runs the program, parses the temporary file to get the search results into the QuickFix window, and deletes the temporary file. I'm guessing these searches are finding some matches outside the temporary directory and writing them into the temporary file, then searching inside the temporary directory and finding additional matches in the temporary results file. Before the results can be used, however, Vim deletes the temporary file. :Ack
without !
jumps to the first match which happens to be the now-deleted temporary file, causing the E40
error. This error is not handled in ack.vim (other than a try
/finally
to restore grepprg
and grepformat
), so the exception leaves SearchWithGrep()
and ack#Ack()
without getting a chance to execute the endif
shown below, causing the additional E171
error:
Line 60 in 36e40f9
If this is indeed the problem, it can be verified by using :Ack! something
to prevent jumping to the first result, then examining the list of results in the QuickFix window. Configuring Ack to avoid searching in temporary directories should avoid this problem as well as make the search more efficient.
I am using ag with ack.vim on CentOS . Exactly same issue here. The error only occurs for some search.
Hi guys,
How did you overcome this issue? I have the same issue on Windwos 10.
@ppmadalin I am also using Neovim on Windows. I have changed to use LeaderF which is using ripgrep for fast greping in your current project. You can give it try.