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

Ack command does not work on Windows 10 for Neovim #60

Open
jdhao opened this issue Apr 1, 2019 · 13 comments
Open

Ack command does not work on Windows 10 for Neovim #60

jdhao opened this issue Apr 1, 2019 · 13 comments

Comments

@jdhao
Copy link

jdhao commented Apr 1, 2019

I installed the latest version of ferret both on Linux and my Windows machine with Neovim. On Linux, it works as expected. But on Windows, the command Ack simply does not work.

Version info

  • Neovim: version 0.3.4
  • Windows: Windows 10 version 1803
  • rg: 0.10.0

steps to reproduce

  1. Use the following minimal init.vim
" use vim-plug to manage plugins
call plug#begin('~/AppData/Local/nvim/plugged')

" multi file search
Plug 'wincent/ferret'

call plug#end()

""""""""""""""""""""""""""""""ferret settings""""""""""""""""""""""""""""""
" do not use default mapping provided by ferret
let g:FerretMap=0

" use \f to activate :Ack command
nmap \f <Plug>(FerretAck)

" hilight search result by default
let g:FerretHlsearch=1

" prefer to use rg
let g:FerretExecutable='rg,ag'

" custom option for search prog
let g:FerretExecutableArguments = {
  \   'rg': '-S --no-heading --vimgrep'
    \ }

Open neovim with the following command:

" use the above minimal init.vim
nvim -u init.vim
  1. Use :Ack some_string to search string under the current folder. Nothing happens. If I run the search command again, the following error is produced:
Error detected while processing function ferret#private#ack[11]..ferret#private#nvim#search[1]..ferret#private#nvim#cancel:
line    3:
E474: Invalid argument
  1. Open a file and search string inside this file with :Back some_string. It works without any error.
@jdhao jdhao changed the title Ack command does not work on Windows Ack command does not work on Windows 10 for Neovim Apr 1, 2019
@wincent
Copy link
Owner

wincent commented Apr 9, 2019

I don't have a Windows development machine but if anybody does and cares to look into this a PR would be welcome.

@tmccombs
Copy link

tmccombs commented Jul 27, 2019

I also get the same error on nvim on archlinux.

Neovim version is 0.3.8

@tmccombs
Copy link

It appears that this happens if a search is already running, and the cancel function is called

@tmccombs
Copy link

specifically the jobstop function is what causes the invalid argument error

@loshjawrence
Copy link

Seeing the same error message, using nvim 0.3.8 on windows 10. rg is installed so I assume it's using that.

@loshjawrence
Copy link

I saw there were some nvim settings to play with. Setting let g:FerretNvim=0 produces this:
image

@loshjawrence
Copy link

loshjawrence commented Aug 29, 2019

@tmccombs @jdhao Setting let g:FerretJob=0 fixes it for me.
@wincent this plugin is beautiful.

@loshjawrence
Copy link

loshjawrence commented Aug 29, 2019

Nevermind, let g:FerretJob=0 doesn't fix it. It just worked that once then breaks after that.

@NICHTJ3
Copy link

NICHTJ3 commented Jan 14, 2020

I got this issue to go away by not specifying the ferret executable in my vimrc

@asidlo
Copy link

asidlo commented Jul 9, 2020

When using neovim on windows, I also experienced the ferret ack command not working as it does on unix. Interestingly, it does work fine using vim on both operating systems. In order to get it to work using neovim on windows I had to set both the variables @loshjawrence mentioned above (g:FerretJob and g:FerretNvim) to 0

let g:is_win = has('win32') || has('win64')
let g:is_nvim = has('nvim')

if g:is_win && g:is_nvim
  let g:FerretNvim = 0
  let g:FerretJob = 0
endif

Tested using the following:

  • version: NVIM v0.5.0-552-g980b12edb
  • os: Windows 10
  • term: Powershell v5.1.17763.1007
  • gui: nvim-qt

@agh0
Copy link

agh0 commented Nov 12, 2020

I had same problem with jobstop call on MacOS 10.4, nvim 0.5.0.
Changing argument from
call jobstop(l:job)
to
call jobstop(str2nr(l:job, 10))
helped me.

I don't know if it a proper solution (I'm really bad in vimscript), but if so, I can make a PR.

@rollue
Copy link

rollue commented Jun 16, 2021

This happens on MacOS Catalina 10.15.7, nvim 0.4.4, python 3.9.5. And the suggested solutions do not work :(

@nbardiuk
Copy link

@mhoonjeon there is another issue with a similar symptom caused by an upgrade of rg #78 maybe some of the workarounds can help.

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

9 participants