Skip to content

Mini.test get value from "vim.fn.getreg('*')" ? #1092

Closed Answered by echasnovski
xixiaofinland asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, working with system register is indeed a bit messy. The reason (I think) is mostly because it is something shared by both instances and that Neovim has special treatment of system clipboard (see :h clipboard).

Here is one example of how I get over it.


...
child.type_keys('<leader>cc') -- copy name 'SfProject' into "*" registration
...

The answer would have been more helpful if you posted a fully reproducible (and small-ish) test case. For example, the following test case passes locally for me:

T['tmp'] = function()
  child.fn.setreg('*', 'Hello')
  eq(child.fn.getreg('*'), 'Hello')
end

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@xixiaofinland
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants