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

Invalid argument error when setting option with vim.opt.clipboard:append #14739

Open
macintacos opened this issue Jun 7, 2021 · 5 comments
Open
Labels
bug issues reporting wrong behavior lua stdlib

Comments

@macintacos
Copy link

  • nvim --version: NVIM v0.5.0-dev+1381-gb3e3ab056
  • Operating system/version: macOS 11.4
  • Terminal name/version:
  • $TERM: iTerm 3.4.7beta2

Steps to reproduce using nvim -u NORC

nvim -u NORC
# Alternative for shell-related problems:
# env -i TERM=ansi-256color "$(which nvim)"

# Run the following command
:lua vim.opt.clipboard:append {"unnamedplus"}

Actual behaviour

After running the above command (which should work, according to :h lua-vim-options?) I get the following error:

E5108: Error executing lua ...ovim/HEAD-b3e3ab0_2/share/nvim/runtime/lua/vim/_meta.lua:170: E474: Invalid argument

Expected behaviour

The option should be set without issue.

@macintacos macintacos added the bug issues reporting wrong behavior label Jun 7, 2021
@macintacos
Copy link
Author

macintacos commented Jun 7, 2021

Just confirmed that prepend works as expected, so not sure what's going on here:

vim.opt.clipboard:prepend {"unnamedplus"}

@ChrisTsou
Copy link

ChrisTsou commented Jul 19, 2021

Probably related:
vim.opt.clipboard:append("vert:▏")
causes:

E5113: Error while calling lua chunk: vim/shared.lua:423: s: expected string, got nil
stack traceback:
        vim/shared.lua:423: in function 'trim'
        /usr/share/nvim/runtime/lua/vim/_meta.lua:497: in function 'convert_value_to_lua'
        /usr/share/nvim/runtime/lua/vim/_meta.lua:581: in function 'add_value'
        /usr/share/nvim/runtime/lua/vim/_meta.lua:697: in function '__add'
        /usr/share/nvim/runtime/lua/vim/_meta.lua:693: in function 'append'
        /home/chris/.config/nvim/init.lua:19: in main chunk

vim.o.clipboard = vim.o.clipboard .. vert:▏ works

@cinerea0

This comment was marked as off-topic.

@comiluv

This comment was marked as off-topic.

@clason

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior lua stdlib
Projects
None yet
Development

No branches or pull requests

6 participants