From 01261c8067a7fc391ff2065f771fd5b49e5c9060 Mon Sep 17 00:00:00 2001 From: sholderbach Date: Tue, 7 Nov 2023 22:57:45 +0100 Subject: [PATCH] Adjust demo to sane bracketed paste API --- examples/demo.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/examples/demo.rs b/examples/demo.rs index 96bf4959..722b9fe0 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -3,8 +3,7 @@ use std::process::Command; use { crossterm::{ cursor::SetCursorStyle, - event::{DisableBracketedPaste, KeyCode, KeyModifiers}, - execute, + event::{KeyCode, KeyModifiers}, }, nu_ansi_term::{Color, Style}, reedline::{ @@ -13,7 +12,6 @@ use { EditCommand, EditMode, Emacs, ExampleHighlighter, Keybindings, ListMenu, Reedline, ReedlineEvent, ReedlineMenu, Signal, Vi, }, - std::io::stdout, }; use reedline::CursorConfig; @@ -95,11 +93,7 @@ fn main() -> std::io::Result<()> { )) .with_validator(Box::new(DefaultValidator)) .with_ansi_colors(true); - let res = line_editor.enable_bracketed_paste(); - let bracketed_paste_enabled = res.is_ok(); - if !bracketed_paste_enabled { - println!("Warn: failed to enable bracketed paste mode: {res:?}"); - } + let _ = line_editor.enable_bracketed_paste(); // Adding default menus for the compiled reedline line_editor = line_editor @@ -226,9 +220,6 @@ fn main() -> std::io::Result<()> { } } - if bracketed_paste_enabled { - let _ = execute!(stdout(), DisableBracketedPaste); - } println!(); Ok(()) }