airblade / vim-gitgutter

A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks.
MIT License
8.34k stars 296 forks source link

files are not tracked (no hunk in file) #894

Closed echaya closed 2 months ago

echaya commented 2 months ago

What is the latest commit SHA in your installed vim-gitgutter? e801371 What vim/nvim version are you on? nvim 0.9.5

Hi there - hope you are well! I am switching from vscode to nvim now. And would appreciate any help!

This is my current gitgutter config:

let g:gitgutter_log=1
let g:gitgutter_git_executable = 'C:/Program Files/Git/bin/git.exe'
let s:log_file    = g:WorkDir.'gitgutter.log'
let g:gitgutter_async=0
let s:grep_available=0

When I do [-c] =>no hunk in file, also there is no sign in the singcolumn which is set toauto`. When ckecking the log file I see:

 38.228285 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..<SNR>81_setup_path[3]..gitgutter#utility#set_repo_path[19]..gitgutter#utility#system[1]:
 38.228285 cd /d "d:/Dropbox/neovim/config" && C:/Program Files/Git/bin/git.exe ls-files -v --error-unmatch --full-name -z -- .vimrc

 38.279601 CursorHold Autocommands for "*"..function gitgutter#process_buffer[25]:
 38.279601 Not tracked: "d:/Dropbox/neovim/config/.vimrc"

When try to execute cd /d "d:/Dropbox/neovim/config" && C:/Program Files/Git/bin/git.exe ls-files -v --error-unmatch --full-name -z -- .vimrc from the comand line, it produces

E344: Can't find directory "/d" in cdpath E472: Command failed

I thought I was on the right track and found a similar issue #174 and also tried set GIT_DISCOVERY_ACROSS_FILESYSTEM=1 on cmd bebefore running nvim. Got the same issue.

other things i have tried:

Thanks a lot in advance!

airblade commented 2 months ago

Good idea to turn on logging, find the command that gitgutter was running, and try to run it directly in your shell. With this kind of problem, fixing it in the shell will tell us what the code needs to do differently.

Having said that, E344 and E472 are vim/nvim errors so it doesn't look like you ran it in the shell. Perhaps you could try this in your shell (and let me know which shell that is)?

cd /d "d:/Dropbox/neovim/config"

And inside nvim, what does :echo &shell produce?

echaya commented 2 months ago

Thanks for your prompt reply!

When I said I try to run "cd /d "d:/Dropbox/neovim/config" && C:/Program Files/Git/bin/git.exe ls-files -v --error-unmatch --full-name -z -- .vimrc" on command line, I actually mean cmdline within nvim

echo &shell returns me cmd.exe

cd /d "d:/Dropbox/neovim/config" works fine in CMD. or shall i run it in bash?

echaya commented 2 months ago

Now I run cd /d "d:/Dropbox/neovim/config" && c:/Program Files/Git/bin/git.exe ls-files -v --error-unmatch --full-name -z -- .vimrc in CMD, I got 'c:/program' is not recognized as an internal or external command, operable program or batch file.

airblade commented 2 months ago

Interesting that &shell is cmd.exe and cd /d d:/Dropbox/neovim/config" works fine in CMD – but fails inside nvim. I'll have to think about that.

The 'c:/program' is not recognized... is separate. I don't know how to specify the absolute path to Git on Windows. If you use plain git instead, does it work? I.e. cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

echaya commented 2 months ago

Seems to me the error is caused by the space between "Program" and "Files". On my home pc, I can try changing the install dir later and try but on my corp PC, it is not changable.

airblade commented 2 months ago

(By the way I'm planning to update gitgutter to use -C <dir> to avoid having to cd. But it would be good to get you up and running in the meantime.)

echaya commented 2 months ago

Interesting that &shell is cmd.exe and cd /d d:/Dropbox/neovim/config" works fine in CMD – but fails inside nvim. I'll have to think about that.

The 'c:/program' is not recognized... is separate. I don't know how to specify the absolute path to Git on Windows. If you use plain git instead, does it work? I.e. cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

It returns me H .vimrc so it seems it is working fine (?).

airblade commented 2 months ago

OK, so don't set let g:gitgutter_git_executable = ... in your config.

echaya commented 2 months ago

I think it is working now - Thanks much!!!

echaya commented 2 months ago

Just curious, I feel the editor is bit "stuttering" => so I have turned they Async on, it stops working immediately.

I saw you asks another windows user to turn async off - may I check why?

airblade commented 2 months ago

When vim/nvim had only just introduced jobs, it was useful to turn off async to find out whether the problem at hand was caused by buggy async code or the core diffing stuff. These days there's no benefit to turning async off; in fact doing so will make your editor feel slower.

When you stay it stops working immediately, can you be more specific?

Also, what is your updatetime? You can find out with :echo &updatetime. Vim/nvim's default is 4000 (milliseconds) which is far too slow; you want something like 100.

echaya commented 2 months ago

When vim/nvim had only just introduced jobs, it was useful to turn off async to find out whether the problem at hand was caused by buggy async code or the core diffing stuff. These days there's no benefit to turning async off; in fact doing so will make your editor feel slower.

When you stay it stops working immediately, can you be more specific?

Also, what is your updatetime? You can find out with :echo &updatetime. Vim/nvim's default is 4000 (milliseconds) which is far too slow; you want something like 100.

my updatetime has been set to 100; When set let g:gitgutter_async=1 in .vimrc then source $MYVIMRC:

echaya commented 2 months ago

check the async command produced in the log [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc which works fine in the cmd.

airblade commented 2 months ago

Please could you post more of the log? The command you pasted above is just the first one it runs, to find out whether a file is tracked by git. The diff stuff will be further down the log.

Also I just noticed that you are telling gitgutter that grep isn't available by setting a script variable (s:) instead of a global (g:). It needs to be a global.

echaya commented 2 months ago

Please could you post more of the log? The command you pasted above is just the first one it runs, to find out whether a file is tracked by git. The diff stuff will be further down the log.

Also I just noticed that you are telling gitgutter that grep isn't available by setting a script variable (s:) instead of a global (g:). It needs to be a global.

I may have paste it from somewhere have update it to g: for grep. Below is the log just gen:

========== start log session 13.07.2024 13:25:55 ==========

0.002292 function startify#open_buffers[6]..84_open_buffer[12]..BufEnter Autocommands for "*"..function 36_on_bufenter[24]..gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 0.002292 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

0.162554 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 0.162554 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

1.198566 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 1.198566 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

1.864175 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 1.864175 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

2.093610 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 2.093610 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

2.249814 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 2.249814 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

2.406145 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 2.406145 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

2.604755 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 2.604755 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

4.115714 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 4.115714 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

8.076096 BufEnter Autocommands for "*"..function 36_on_bufenter[24]..gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 8.076096 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- .vimrc

8.107685 nvim_exec2()..BufEnter Autocommands for "*"..function 36_on_bufenter[24]..gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 8.107685 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

8.258966 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 8.258966 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

8.955768 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 8.955768 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

9.879474 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 9.879474 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

10.191138 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 10.191138 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

10.989487 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 10.989487 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

11.127895 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 11.127895 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

11.373412 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 11.373412 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

11.632597 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 11.632597 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

12.401863 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 12.401863 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

12.727002 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 12.727002 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

13.317027 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 13.317027 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

13.919332 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 13.919332 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

14.071309 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 14.071309 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

14.193420 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 14.193420 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

15.621553 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 15.621553 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

16.879140 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 16.879140 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

18.114964 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 18.114964 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

18.813974 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 18.813974 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

19.133967 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 19.133967 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

19.475529 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 19.475529 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

20.444032 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 20.444032 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

20.597150 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 20.597150 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

20.844639 CursorHold Autocommands for "*"..function gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 20.844639 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

25.416507 BufEnter Autocommands for "*"..function 36_on_bufenter[24]..gitgutter#process_buffer[14]..83_setup_path[3]..gitgutter#utility#set_repo_path[15]..gitgutter#async#execute[1]: 25.416507 [async] cd /d "d:/Dropbox/neovim/config" && git ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

airblade commented 2 months ago

Thank you. And what does :echo b:gitgutter give?

airblade commented 2 months ago

By the way, I just pushed a change which avoids the cd /d step. Perhaps you could update your gitgutter, reproduce the problem, and tell me what :echo b:gitgutter shows.

echaya commented 2 months ago

By the way, I just pushed a change which avoids the cd /d step. Perhaps you could update your gitgutter, reproduce the problem, and tell me what :echo b:gitgutter shows.

{'path': -2, 'enable': 1, 'mapped': 1}

airblade commented 2 months ago

Thanks!

A path of -2 means either that gitgutter thinks the file is not tracked by git or that the git ls-files command error'ed for some other reason.

Given that signs appear when you turn off async, the problem must be running the git ls-files asynchronously – which is weird because that stuff hasn't caused any problems for years, as far as I know.

If you've updated gitgutter, the command should look like:

git -C "d:/Dropbox/neovim/config" ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

Please could you confirm that? And whether :echo has("win32") prints 1?

I confess I'm not really sure what the problem is. I'll keep thinking...

echaya commented 2 months ago

Thanks!

A path of -2 means either that gitgutter thinks the file is not tracked by git or that the git ls-files command error'ed for some other reason.

Given that signs appear when you turn off async, the problem must be running the git ls-files asynchronously – which is weird because that stuff hasn't caused any problems for years, as far as I know.

If you've updated gitgutter, the command should look like:

git -C "d:/Dropbox/neovim/config" ls-files -v --error-unmatch --full-name -z -- vim_config.vimrc

Please could you confirm that? And whether :echo has("win32") prints 1?

I confess I'm not really sure what the problem is. I'll keep thinking...

Thanks!

re :echo has("win32") prints 1 => yes and confirm now the command looks like git -C "d:/Dropbox/neovim/config" ls-files -v --error-unmatch --full-name -z -- repl_config.lua

Separately, I have managed to get gitsign-nvim works out of box. But since I have been using both vim and nvim depending on secnairo / enviroment, I'll also keep exploring :)

echaya commented 2 months ago

not much progress - I have updated my git to the latest versions the same issue persists.

airblade commented 2 months ago

Ok, to summarise:

Is that all correct?

echaya commented 2 months ago

All correct. Except now I run :echo b:gitgutter => 'path':'vim_config.vimrc'. It was in a different out format (only 3 keys) with path = -2.

Ok, to summarise:

  • You're using Neovim on Windows.
  • When you edit a file tracked by git, with let g:gitgutter_async = 0, the diff signs appear.
  • When you edit a file tracked by git, without let g:gitgutter_async = 0, the diff signs don't appear and b:gitgutter.path is -2.
  • Running git -C "d:/Dropbox/neovim/config" ls-files -v --error-unmatch --full-name -z -- repl_config.lua in your shell produces H repl_config.lua.
  • Running :!git -C "d:/Dropbox/neovim/config" ls-files -v --error-unmatch --full-name -z -- repl_config.lua in Neovim produces H repl_config.lua.

Is that all correct?

airblade commented 2 months ago

The path format doesn't matter. b:gitgutter is a dictionary and path is one of its keys.

Anyway, if it says vim_config.vimrc instead of -2, that's progress. It means gitgutter has established that the file is tracked by git and can move on to diffing it.

But you're still not seeing diff signs? What does the log say now?

echaya commented 2 months ago

The path format doesn't matter. b:gitgutter is a dictionary and path is one of its keys.

Anyway, if it says vim_config.vimrc instead of -2, that's progress. It means gitgutter has established that the file is tracked by git and can move on to diffing it.

But you're still not seeing diff signs? What does the log say now?

Okay. It is still -2 when doing async, returns the file_name in sync mode.

airblade commented 2 months ago

Please make this change, which hopefully will tell us what the problem is:

diff --git i/autoload/gitgutter/async.vim w/autoload/gitgutter/async.vim
index 8b9f130..114ca90 100644
--- i/autoload/gitgutter/async.vim
+++ w/autoload/gitgutter/async.vim
@@ -63,9 +63,14 @@ function! s:on_stdout_nvim(_job_id, data, _event) dict abort
   endif
 endfunction

+let s:lines = ['']
 function! s:on_stderr_nvim(_job_id, data, _event) dict abort
   if a:data != ['']  " With Neovim there is always [''] reported on stderr.
+    let s:lines[-1] .= a:data[0]
+    call extend(s:lines, a:data[1:])
     call self.handler.err(self.buffer)
+  else
+    echom s:lines[0]
   endif
 endfunction

You can see the error message with :messages.

echaya commented 2 months ago

Please make this change, which hopefully will tell us what the problem is:

diff --git i/autoload/gitgutter/async.vim w/autoload/gitgutter/async.vim
index 8b9f130..114ca90 100644
--- i/autoload/gitgutter/async.vim
+++ w/autoload/gitgutter/async.vim
@@ -63,9 +63,14 @@ function! s:on_stdout_nvim(_job_id, data, _event) dict abort
   endif
 endfunction

+let s:lines = ['']
 function! s:on_stderr_nvim(_job_id, data, _event) dict abort
   if a:data != ['']  " With Neovim there is always [''] reported on stderr.
+    let s:lines[-1] .= a:data[0]
+    call extend(s:lines, a:data[1:])
     call self.handler.err(self.buffer)
+  else
+    echom s:lines[0]
   endif
 endfunction

You can see the error message with :messages.

I think we are getting there. Finally there is some error msg, actually an array of "The syntax of the command is incorrect. ^M" ^M is a bad key from windows tho I'm not entirely sure how it is only happening in async mode: ref link

image

airblade commented 2 months ago

The ^M is irrelevant: it's just a stray line ending from the first line of the error message.

The syntax of the command is incorrect.

This is coming from cmd.exe but I don't know why.

airblade commented 2 months ago

This is a total guess:

diff --git i/autoload/gitgutter/async.vim w/autoload/gitgutter/async.vim
index 8b9f130..c9d782e 100644
--- i/autoload/gitgutter/async.vim
+++ w/autoload/gitgutter/async.vim
@@ -46,7 +46,7 @@ function! s:build_command(cmd)
   endif

   if has('win32')
-    return has('nvim') ? ['cmd.exe', '/c', a:cmd] : 'cmd.exe /c '.a:cmd
+    return has('nvim') ? a:cmd : 'cmd.exe /c '.a:cmd
   endif

   throw 'unknown os'
@@ -63,9 +63,14 @@ function! s:on_stdout_nvim(_job_id, data, _event) dict abort
   endif
 endfunction

+let s:lines = ['']
 function! s:on_stderr_nvim(_job_id, data, _event) dict abort
   if a:data != ['']  " With Neovim there is always [''] reported on stderr.
+    let s:lines[-1] .= a:data[0]
+    call extend(s:lines, a:data[1:])
     call self.handler.err(self.buffer)
+  else
+    echom s:lines[0]
   endif
 endfunction

If that doesn't work, you could try:

-    return has('nvim') ? ['cmd.exe', '/c', a:cmd] : 'cmd.exe /c '.a:cmd
+    return has('nvim') ? [a:cmd] : 'cmd.exe /c '.a:cmd
echaya commented 2 months ago
return has('nvim') ? a:cmd : 'cmd.exe /c '.a:cmd

This line works! Really appreciate your help all along. Confirm the plug-in works on my vim and vim.

Feel free to close or lmk if you want me to test anything. Thanks again!

I re-entered this post as it was accidentally deleted :p]

airblade commented 2 months ago

Phew! Thanks for your help debugging this.