From 6479df63b96a53ea3a1decf7bcd4ce7ebdf23494 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 22 Dec 2022 07:31:18 -0700 Subject: [PATCH] removed deprecated Copy, Paste, PastePrimarySelection actions These have been deprecated since early 2021; time to remove them and simplify a little. --- config/src/keyassignment.rs | 3 --- docs/changelog.md | 3 +++ docs/config/lua/keyassignment/Copy.md | 4 ++++ docs/config/lua/keyassignment/Paste.md | 4 ++++ .../keyassignment/PastePrimarySelection.md | 4 ++++ wezterm-gui/src/commands.rs | 21 ------------------- wezterm-gui/src/termwindow/mod.rs | 17 ++------------- 7 files changed, 17 insertions(+), 39 deletions(-) diff --git a/config/src/keyassignment.rs b/config/src/keyassignment.rs index 43e62c459..65f1332e4 100644 --- a/config/src/keyassignment.rs +++ b/config/src/keyassignment.rs @@ -437,10 +437,7 @@ pub enum KeyAssignment { SpawnTab(SpawnTabDomain), SpawnWindow, ToggleFullScreen, - Copy, CopyTo(ClipboardCopyDestination), - Paste, - PastePrimarySelection, PasteFrom(ClipboardPasteSource), ActivateTabRelative(isize), ActivateTabRelativeNoWrap(isize), diff --git a/docs/changelog.md b/docs/changelog.md index 20fcf3dca..4b29a3ea7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -32,6 +32,9 @@ As features stabilize some brief notes about them will accumulate here. * Withdraw DEC private SGR escapes that affect superscript and subscript due to xterm/vim conflict [mintty/#1189](https://github.com/mintty/mintty/issues/1189) +* Removed deprecated `Copy`, `Paste` and `PastePrimarySelection` actions. Use + [CopyTo](config/lua/keyassignment/CopyTo.md) and + [PasteFrom](config/lua/keyassignment/PasteFrom.md) instead. #### Updated * Bundled harfbuzz updated to version 6.0.0 diff --git a/docs/config/lua/keyassignment/Copy.md b/docs/config/lua/keyassignment/Copy.md index fe6803b22..d721e60a1 100644 --- a/docs/config/lua/keyassignment/Copy.md +++ b/docs/config/lua/keyassignment/Copy.md @@ -7,6 +7,10 @@ Copy the selection to the clipboard. This action is considered to be deprecated and will be removed in a future release; please use [CopyTo](CopyTo.md) instead. +*Since: nightly builds only* + +This action has been removed. Please use [CopyTo](CopyTo.md) instead. + ## Example diff --git a/docs/config/lua/keyassignment/Paste.md b/docs/config/lua/keyassignment/Paste.md index a74d74ae5..3c36ffe5f 100644 --- a/docs/config/lua/keyassignment/Paste.md +++ b/docs/config/lua/keyassignment/Paste.md @@ -7,6 +7,10 @@ Paste the clipboard to the current pane. This action is considered to be deprecated and will be removed in a future release; please use [PasteFrom](PasteFrom.md) instead. +*Since: nightly builds only* + +This action has been removed. Please use [PasteFrom](PasteFrom.md) instead. + ## Example ```lua diff --git a/docs/config/lua/keyassignment/PastePrimarySelection.md b/docs/config/lua/keyassignment/PastePrimarySelection.md index 713b5a343..fbaa5c580 100644 --- a/docs/config/lua/keyassignment/PastePrimarySelection.md +++ b/docs/config/lua/keyassignment/PastePrimarySelection.md @@ -8,6 +8,10 @@ On other systems, this behaves identically to [Paste](Paste.md). This action is considered to be deprecated and will be removed in a future release; please use [PasteFrom](PasteFrom.md) instead. +*Since: nightly builds only* + +This action has been removed. Please use [PasteFrom](PasteFrom.md) instead. + ## Example ```lua diff --git a/wezterm-gui/src/commands.rs b/wezterm-gui/src/commands.rs index 0abafbd70..ae19c6478 100644 --- a/wezterm-gui/src/commands.rs +++ b/wezterm-gui/src/commands.rs @@ -280,13 +280,6 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option CommandDef { - brief: "Paste primary selection".into(), - doc: "Pastes text from the primary selection".into(), - keys: vec![], - args: &[ArgType::ActivePane], - menubar: &[], - }, CopyTo(ClipboardCopyDestination::PrimarySelection) => CommandDef { brief: "Copy to primary selection".into(), doc: "Copies text to the primary selection".into(), @@ -311,13 +304,6 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option CommandDef { - brief: "Copy to clipboard and primary selection".into(), - doc: "Copies text to the clipboard and the primary selection".into(), - keys: vec![], - args: &[ArgType::ActivePane], - menubar: &[], - }, PasteFrom(ClipboardPasteSource::Clipboard) => CommandDef { brief: "Paste from clipboard".into(), doc: "Pastes text from the clipboard".into(), @@ -328,13 +314,6 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option CommandDef { - brief: "Paste from clipboard".into(), - doc: "Pastes text from the clipboard".into(), - keys: vec![], - args: &[ArgType::ActivePane], - menubar: &[], - }, ToggleFullScreen => CommandDef { brief: "Toggle full screen mode".into(), doc: "Switch between normal and full screen mode".into(), diff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rs index f0c5ff8c0..41233673d 100644 --- a/wezterm-gui/src/termwindow/mod.rs +++ b/wezterm-gui/src/termwindow/mod.rs @@ -28,8 +28,8 @@ use ::wezterm_term::input::{ClickPosition, MouseButton as TMB}; use ::window::*; use anyhow::{anyhow, ensure, Context}; use config::keyassignment::{ - ClipboardCopyDestination, ClipboardPasteSource, KeyAssignment, PaneDirection, Pattern, - QuickSelectArguments, RotationDirection, SpawnCommand, SplitSize, + KeyAssignment, PaneDirection, Pattern, QuickSelectArguments, RotationDirection, SpawnCommand, + SplitSize, }; use config::{ configuration, AudibleBell, ConfigHandle, Dimension, DimensionContext, FrontEndSelection, @@ -2328,23 +2328,10 @@ impl TermWindow { ToggleFullScreen => { self.window.as_ref().unwrap().toggle_fullscreen(); } - Copy => { - let text = self.selection_text(pane); - self.copy_to_clipboard( - ClipboardCopyDestination::ClipboardAndPrimarySelection, - text, - ); - } CopyTo(dest) => { let text = self.selection_text(pane); self.copy_to_clipboard(*dest, text); } - Paste => { - self.paste_from_clipboard(pane, ClipboardPasteSource::Clipboard); - } - PastePrimarySelection => { - self.paste_from_clipboard(pane, ClipboardPasteSource::PrimarySelection); - } PasteFrom(source) => { self.paste_from_clipboard(pane, *source); }