Packer.nvim: nvim --headless +PackerCompile +PackerUpdate +qa generate errors

Created on 2 Dec 2020  路  9Comments  路  Source: wbthomason/packer.nvim

Hi,

I'm trying to use packer to run tests on plugins in Docker, but I get some errors when I run this command:
nvim --headless +PackerCompile +PackerUpdate +qa

There should be a way do check if the buffer update can happend?

bug enhancement

Most helpful comment

I tested the PR on my end, fixes my issue. Thanks!

All 9 comments

What errors do you get?

Error executing vim.schedule lua callback: .../site/pack/packer/opt/packer.nvim/lua/packer/display.lua:130: Expected 4 arguments%
Error executing vim.schedule lua callback: .../site/pack/packer/opt/packer.nvim/lua/packer/display.lua:82: Index out of bounds

I'm sorry I shoud have stated with that.

I think the error comes from the way packer updates the buffer to report progress?

Ah, I see. I'll admit that packer isn't really designed to support headless operation, but this would be good to add. It's going to take some modification to display.lua to validate that the display window actually opened.

This is related to #63

I can try to implement and submit a PR for this specific case? I'm really a beginner in Lua but that doesn't seem to hard to just validate if the buffer/window is available?

You'd think not - unfortunately, it seems like some of the existing checks for this in display.lua (search for is_valid) aren't cutting it, so I need to find a new solution. If you can find something that works and send a PR, that'd be great!

Heh, as soon as I wrote that I figured out a better solution. Please try #107 if you get a chance - if that fixes the issue for you too, I'll merge it in.

Also, just as a note, you probably want nvim --headless +PackerUpdate +PackerCompile +qa or just nvim --headless +PackerSync +qa - it seems better (though not critical) to update before compiling loaders.

I tested the PR on my end, fixes my issue. Thanks!

@wbthomason this is awesome, thank you very much! :D One last thing for perfect headless support would be a non-interactive mode (for example, when deleting a plugin, the OK to remove? [y/N] prompt will make ). Is this something you'd take a PR for?

Yes, I'd happily merge that in! That was requested in another issue (I forget where) and has been on my backlog for a while now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YaBoiBurner picture YaBoiBurner  路  4Comments

jzelinskie picture jzelinskie  路  6Comments

clason picture clason  路  6Comments

GustavoPrietoP picture GustavoPrietoP  路  7Comments

kdav5758 picture kdav5758  路  6Comments