Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error detected while processing function ack#Ack[41] #250

Open
astavonin opened this issue Jul 1, 2018 · 9 comments
Open

Error detected while processing function ack#Ack[41] #250

astavonin opened this issue Jul 1, 2018 · 9 comments

Comments

@astavonin
Copy link

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.

@hachreak
Copy link

I have the same issue but I'm working with debian 9.5 with vim 8, ack 2.15.

@Drainful
Copy link

Drainful commented Aug 1, 2018

I have the same issue as well. I have identical specs to astavonin.

@halas
Copy link

halas commented Aug 1, 2018

Same here, the same specs as hachreak

@drmikehenry
Copy link

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:

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.

@jdhao
Copy link

jdhao commented Oct 29, 2018

I am using ag with ack.vim on CentOS . Exactly same issue here. The error only occurs for some search.

@madalinpopa
Copy link

Hi guys,
How did you overcome this issue? I have the same issue on Windwos 10.

@jdhao
Copy link

jdhao commented Apr 12, 2019

@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.

@madalinpopa
Copy link

madalinpopa commented Apr 12, 2019 via email

@neelkarma
Copy link

This may be a duplicate of #169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants