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

set neovide_channel_id always #2070

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/bridge/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const REGISTER_CLIPBOARD_PROVIDER_LUA: &str = r"
cache_enabled = 0
}";

pub async fn setup_neovide_remote_clipboard(nvim: &Neovim<NeovimWriter>, neovide_channel: u64) {
pub async fn setup_neovide_remote_clipboard(nvim: &Neovim<NeovimWriter>) {
// Users can opt-out with
// vim: `let g:neovide_no_custom_clipboard = v:true`
// lua: `vim.g.neovide_no_custom_clipboard = true`
Expand All @@ -45,9 +45,6 @@ pub async fn setup_neovide_remote_clipboard(nvim: &Neovim<NeovimWriter>, neovide
return;
}

nvim.set_var("neovide_channel_id", Value::from(neovide_channel))
.await
.ok();
nvim.execute_lua(REGISTER_CLIPBOARD_PROVIDER_LUA, vec![])
.await
.ok();
Expand Down Expand Up @@ -104,6 +101,10 @@ pub async fn setup_neovide_specific_state(
neovide_channel
);

nvim.set_var("neovide_channel_id", Value::from(neovide_channel))
.await
.ok();

// Create a command for registering right click context hooking.
#[cfg(windows)]
nvim.command(&build_neovide_command(
Expand Down Expand Up @@ -138,7 +139,7 @@ pub async fn setup_neovide_specific_state(
.ok();

if should_handle_clipboard {
setup_neovide_remote_clipboard(nvim, neovide_channel).await;
setup_neovide_remote_clipboard(nvim).await;
}
} else {
warn!("Neovide could not find the correct channel id. Some functionality may be disabled.");
Expand Down