fix(compatibility): do not duplicate bracketed paste in chunked stdin input (#917)

* debug message

* fix attempt

* oops

* remove log message

* rustfmt

* style(clippy): make clippy happy

* style(clippy): make clippy happy again!
This commit is contained in:
Aram Drevekenin 2021-12-02 18:35:55 +01:00 committed by GitHub
parent 180aa786a5
commit cbe0d5405e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 43 deletions

View file

@ -94,8 +94,20 @@ pub(crate) fn stdin_loop(
pasting = false; pasting = false;
} }
None => { None => {
let starts_with_bracketed_paste_start = stdin_buffer
.iter()
.take(bracketed_paste_start.len())
.eq(bracketed_paste_start.iter());
if starts_with_bracketed_paste_start {
drop(stdin_buffer.drain(..6)); // bracketed paste start
}
send_input_instructions send_input_instructions
.send(InputInstruction::PastedText((true, stdin_buffer, false))) .send(InputInstruction::PastedText((
starts_with_bracketed_paste_start,
stdin_buffer,
false,
)))
.unwrap(); .unwrap();
pasting = true; pasting = true;
continue; continue;

View file

@ -109,7 +109,7 @@ impl NamedColor {
} }
} }
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq, Default)]
pub struct CharacterStyles { pub struct CharacterStyles {
pub foreground: Option<AnsiCode>, pub foreground: Option<AnsiCode>,
pub background: Option<AnsiCode>, pub background: Option<AnsiCode>,
@ -125,25 +125,6 @@ pub struct CharacterStyles {
pub link_anchor: Option<LinkAnchor>, pub link_anchor: Option<LinkAnchor>,
} }
impl Default for CharacterStyles {
fn default() -> Self {
Self {
foreground: None,
background: None,
strike: None,
hidden: None,
reverse: None,
slow_blink: None,
fast_blink: None,
underline: None,
bold: None,
dim: None,
italic: None,
link_anchor: None,
}
}
}
impl CharacterStyles { impl CharacterStyles {
pub fn new() -> Self { pub fn new() -> Self {
Self::default() Self::default()

View file

@ -946,7 +946,7 @@ impl Tab {
.or_insert_with(|| Boundaries::new(self.viewport)); .or_insert_with(|| Boundaries::new(self.viewport));
pane_contents_and_ui.render_pane_boundaries( pane_contents_and_ui.render_pane_boundaries(
*client_id, *client_id,
&mut boundaries, boundaries,
self.session_is_mirrored, self.session_is_mirrored,
); );
} }

View file

@ -44,19 +44,11 @@ impl Overlayable for OverlayType {
/// Entrypoint from [`Screen`], which holds the context in which /// Entrypoint from [`Screen`], which holds the context in which
/// the overlays are being rendered. /// the overlays are being rendered.
/// The most recent overlays draw over the previous overlays. /// The most recent overlays draw over the previous overlays.
#[derive(Clone, Debug)] #[derive(Clone, Debug, Default)]
pub struct OverlayWindow { pub struct OverlayWindow {
pub overlay_stack: Vec<Overlay>, pub overlay_stack: Vec<Overlay>,
} }
impl Default for OverlayWindow {
fn default() -> Self {
Self {
overlay_stack: vec![],
}
}
}
impl Overlayable for OverlayWindow { impl Overlayable for OverlayWindow {
fn generate_overlay(&self, size: Size) -> String { fn generate_overlay(&self, size: Size) -> String {
let mut output = String::new(); let mut output = String::new();

View file

@ -162,7 +162,7 @@ pub struct LayoutFromYamlIntermediate {
// The struct that is used to deserialize the layout from // The struct that is used to deserialize the layout from
// a yaml configuration file // a yaml configuration file
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
#[serde(crate = "self::serde")] #[serde(crate = "self::serde")]
#[serde(default)] #[serde(default)]
pub struct LayoutFromYaml { pub struct LayoutFromYaml {
@ -775,17 +775,6 @@ impl Default for LayoutTemplate {
} }
} }
impl Default for LayoutFromYaml {
fn default() -> Self {
Self {
session: SessionFromYaml::default(),
template: LayoutTemplate::default(),
borderless: false,
tabs: vec![],
}
}
}
impl Default for Direction { impl Default for Direction {
fn default() -> Self { fn default() -> Self {
Direction::Horizontal Direction::Horizontal