paq-nvim icon indicating copy to clipboard operation
paq-nvim copied to clipboard

`Vim(split):E518: Unknown option: add`

Open David-Else opened this issue 2 years ago • 10 comments

After selecting 'PaqLogOpen' right after an update that had https://github.com/savq/paq-nvim/issues/112 :

E5108: Error executing lua ...cal/share/nvim/site/pack/paqs/start/paq-nvim/lua/paq.lua:283: Vim(split):E518: Unknown option: add                                                                
stack traceback:                                                                                                                                                                                
        [C]: in function 'cmd'                                                                                                                                                                  
        ...cal/share/nvim/site/pack/paqs/start/paq-nvim/lua/paq.lua:283: in function 'log_open'                                                                                                 
        [string ":lua"]:1: in main chunk 

After hitting enter the actual log shows, and there doesn't seem anything notable about it.

Is my config messed up, anyone else getting these errors?

I am on Neovim 0.7.

David-Else avatar Jun 08 '22 15:06 David-Else

I tried to reproduce this, but was not able to. It seems that somewhere a set add or vim.o.add = ... is run, giving the E518 error. This would happen in Vim(split), which is called in the log_open function.

log_open is simply this:

vim.cmd("sp " .. logfile)

which calls split, so makes sense that the error is in vim's split. I was thinking, maybe a weird logfile name? Could you for example change this line:

    log_open = function() vim.cmd("sp " .. logfile) end,

in:

    log_open = function()
        print(logfile)
        vim.cmd("sp " .. logfile)
    end,

and see if that contains 'weird' characters? Maybe try running it directly as command and see if it results in the same error?

yochem avatar Jun 20 '22 14:06 yochem

You could also try the following to fix it:

    log_open = function() vim.cmd("sp '" .. logfile .. "'") end,

which should put single quotes around the log path.

yochem avatar Jun 20 '22 14:06 yochem

line 284 was log_open = function() vim.cmd("sp " .. logfile) end, I changed it to log_open = function() vim.cmd("sp '" .. logfile .. "'") end,, but now the log does not display, just an empty file. If I change it back then it shows the last log.

Thanks for looking at this, would be great to get it fixed, I want to recommend this package manager but with the crashes I am reluctant... fingers crossed! :)

Please give me explicit instructions and I can troubleshoot, I am not a lua expert.

David-Else avatar Jun 20 '22 14:06 David-Else

Okay then I'm pretty sure something is wrong with the value of logfile. Could you change that line 284 into this:

    log_open = function() print(logfile) vim.cmd("sp " .. logfile) end,

and report what the message in vim is when you run PaqLogOpen?

yochem avatar Jun 20 '22 15:06 yochem

After I change it to what you asked it works and shows the log:

From https://github.com/hrsh7th/cmp-nvim-lsp-signature-help
   8014f6d..007dd27  main       -> origin/main
cmp-nvim-lsp-signature-help updating...
* Merge pull request #15 from tzachar/fix-undefined-signatures
* fix nilFrom https://github.com/williamboman/nvim-lsp-installer
   f4a4c06..004017e  main       -> origin/main
From https://github.com/L3MON4D3/LuaSnip
   e9afd03..a12441e  master     -> origin/master
nvim-lsp-installer updating...
* run autogen_metadata.lua (#820)
* fix(texlab): download aarch64 assets on arm macOS (#819)LuaSnip updating...
* Auto generate docs
* fix(env): vim.tbl_extend does not preserve metatables!!!

Is there any way to improve the readability of the log, maybe a blank line between each plugin?

David-Else avatar Jun 20 '22 15:06 David-Else

so no error anymore? what is the filename of the log file?

I'm not a maintainer, you can create a PR if you want blank lines between each plugin.

yochem avatar Jun 20 '22 15:06 yochem

The error this issue is about is very intermittent. I don't know how to trigger it, but it does come often. I am not seeing it now, but it usually comes after an update.

The log file is $HOME/.cache/nvim/paq.log

I'm not a maintainer, you can create a PR if you want blank lines between each plugin.

No problem, I had a quick go at Lua recently, if I get any better I will look into a PR.

David-Else avatar Jun 20 '22 15:06 David-Else

The PR would be this I think:

changing line 146 in lua/paq.lua to this:

                log("\n" .. pkg.name .. " updating...")

yochem avatar Jun 20 '22 15:06 yochem

The PR would be this I think:

changing line 146 in lua/paq.lua to this:

                log("\n" .. pkg.name .. " updating...")

Is it possible you have an older version or have different formatting? https://github.com/savq/paq-nvim/blob/master/lua/paq.lua#L146 is an else statement. Please can you confirm exactly what line to replace?

I will run it for a while and if I have no problems make a PR, unless you would like to make the PR? THANKS for your help!

David-Else avatar Jun 20 '22 17:06 David-Else

Sorry, should be 142: https://github.com/savq/paq-nvim/blob/master/lua/paq.lua#L142

yochem avatar Jun 20 '22 19:06 yochem