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

Integrated clipboard support fails with “Function name does not match script file name: provider#clipboard#Call” #245

Open
Hawk777 opened this issue Jul 30, 2020 · 0 comments

Comments

@Hawk777
Copy link

Hawk777 commented Jul 30, 2020

Describe the bug
I set g:GuiInternalClipboard. On startup, I get “Unknown error type: Wait timeout (nvim_command)”. On starting nvim directly with all the same command-line parameters except --embed, I get the error indicated in the bug title.

It seems the documented way to implement a custom clipboard provider is more like this, which seems to work:

let s:lastRegTypes = {'+': 'v', '*': 'v'}

function! s:Copy(regname, lines, regtype)
	let s:lastRegTypes[a:regname] = a:regtype
	call rpcnotify(1, 'Gui', 'Clipboard', 'Set', a:regname, join(a:lines, "\n"))
endfunction

function! s:Paste(regname)
	return [rpcrequest(1, 'Gui', 'Clipboard', 'Get', a:regname), s:lastRegTypes[a:regname]]
endfunction

let g:clipboard = {
			\	'name': 'neovim-gtk-clipboard',
			\	'copy': {
			\		'+': {lines, regtype -> s:Copy('+', lines, regtype)},
			\		'*': {lines, regtype -> s:Copy('*', lines, regtype)},
			\	},
			\	'paste': {
			\		'+': {-> s:Paste('+')},
			\		'*': {-> s:Paste('*')},
			\	},
			\}

Technical information (please complete the following information):

  • OS: Gentoo Linux
  • Neovim version: 0.4.3
  • Neovim-Gtk build version: 0.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant