Skip to content

Commit

Permalink
Use neovide's clipboard provider by default
Browse files Browse the repository at this point in the history
  • Loading branch information
cshuaimin committed Nov 8, 2023
1 parent 608fd29 commit a07256b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lua/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local function get_clipboard(register)
end
end

if args.register_clipboard and not vim.g.neovide_no_custom_clipboard then
if not vim.g.neovide_no_custom_clipboard then
vim.g.clipboard = {
name = "neovide",
copy = {
Expand Down
3 changes: 1 addition & 2 deletions src/bridge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ async fn launch(grid_size: Option<Dimensions>) -> Result<NeovimSession> {
}
let settings = SETTINGS.get::<CmdLineSettings>();

let should_handle_clipboard = settings.wsl || settings.server.is_some();
setup_neovide_specific_state(&session.neovim, should_handle_clipboard).await?;
setup_neovide_specific_state(&session.neovim).await?;

start_ui_command_handler(Arc::clone(&session.neovim));
SETTINGS.read_initial_values(&session.neovim).await?;
Expand Down
10 changes: 1 addition & 9 deletions src/bridge/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ use crate::bridge::NeovimWriter;

const INIT_LUA: &str = include_str!("../../lua/init.lua");

pub async fn setup_neovide_specific_state(
nvim: &Neovim<NeovimWriter>,
should_handle_clipboard: bool,
) -> Result<()> {
pub async fn setup_neovide_specific_state(nvim: &Neovim<NeovimWriter>) -> Result<()> {
// Set variable indicating to user config that neovide is being used.
nvim.set_var("neovide", Value::Boolean(true))
.await
Expand Down Expand Up @@ -57,15 +54,10 @@ pub async fn setup_neovide_specific_state(
);
let neovide_channel = Value::from(neovide_channel);

let register_clipboard = should_handle_clipboard;
let register_right_click = cfg!(target_os = "windows");

let args = Value::from(vec![
(Value::from("neovide_channel_id"), neovide_channel),
(
Value::from("register_clipboard"),
Value::from(register_clipboard),
),
(
Value::from("register_right_click"),
Value::from(register_right_click),
Expand Down

0 comments on commit a07256b

Please sign in to comment.