edwinb / idris2-vim

Vim mode for Idris 2
75 stars 26 forks source link

File error in --no-color: File Not Found #19

Open yoeluk opened 3 years ago

yoeluk commented 3 years ago

When I reach for \t on a hole I get this error followed by an idris error that doesn't make sense like undefined name...

Screen Shot 2020-11-28 at 09 01 34
buzden commented 3 years ago

What version of idris2 are you using?

yoeluk commented 3 years ago

I am using Idris2 v0.2.1 btw, this very same file works just fine in Atom. The problem I have seems to be with the vim plugin. I reproduced this issue in Manjaro as well as OSX.11. It seems fine in Atom in both OS.

BorisNikulin commented 3 years ago

Same error with nearly all commands save \t which puts the cursor on the : character of the type decl (claim?). Just installed idris2 from AUR and this plugin via Vundle. idris2 is on the PATH.

Idris versions is 'Idris 2, version 0.2.1-2cd7350fb' and plugin version 964cebee493c85f75796e4f4e6bbb4ac54e2da9e. Running on Arch Linux.

WizardOfMenlo commented 3 years ago

Hi, I have the same issue. I think the issue originates from this line

function! s:IdrisCommand(...)
  let idriscmd = shellescape(join(a:000))
  " Vim does not support ANSI escape codes natively, so we need to disable
  " automatic colouring
  return system("idris2 --no-color --find-ipkg " . shellescape(expand('%:p')) . " --client " . idriscmd)
endfunction

From looking at the help and doing some testing I think that it would be enough to move --no-color after the filename and that should be enough

jumper149 commented 3 years ago

That didn't really work for me. I didn't look into the problem a lot, but pinning to an earlier commit seems to make at least reloading work:

# ...
          (idris2-vim.overrideAttrs ({ ... }: {
            src = fetchGit {
              url = "https://github.com/edwinb/idris2-vim.git";
              ref = "master";
              rev = "099129e08c89d9526ad092b7980afa355ddaa24c";
            };
          }))
# ...
JonathanLorimer commented 3 years ago

@jumper149 this worked for me (also using nix). Thank you!