diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index c2df86de61..dbbd1341e6 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -9,11 +9,8 @@ use alacritty_terminal::{ Term, }; -<<<<<<< HEAD -use dirs::home_dir; -======= use color_translation::{get_color_at_index, to_alac_rgb}; ->>>>>>> 3fe0d66d (Began working on selections, refactored colors) +use dirs::home_dir; use futures::{ channel::mpsc::{unbounded, UnboundedSender}, StreamExt, @@ -475,13 +472,12 @@ fn get_working_directory(wt: &LocalWorktree) -> Option { #[cfg(test)] mod tests { - use std::{path::Path, sync::atomic::AtomicUsize, time::Duration}; - use super::*; use alacritty_terminal::{grid::GridIterator, term::cell::Cell}; use gpui::TestAppContext; use itertools::Itertools; use project::{FakeFs, Fs, RealFs, RemoveOptions, Worktree}; + use std::{path::Path, sync::atomic::AtomicUsize, time::Duration}; ///Basic integration test, can we get the terminal to show up, execute a command, //and produce noticable output? @@ -489,7 +485,6 @@ mod tests { async fn test_terminal(cx: &mut TestAppContext) { let terminal = cx.add_view(Default::default(), |cx| Terminal::new(cx, None)); cx.set_condition_duration(Duration::from_secs(2)); - terminal.update(cx, |terminal, cx| { terminal.write_to_pty(&Input(("expr 3 + 4".to_string()).to_string()), cx); terminal.carriage_return(&Return, cx); @@ -499,6 +494,7 @@ mod tests { .condition(cx, |terminal, _cx| { let term = terminal.term.clone(); let content = grid_as_str(term.lock().renderable_content().display_iter); + dbg!(&content); content.contains("7") }) .await; diff --git a/crates/terminal/src/terminal_element.rs b/crates/terminal/src/terminal_element.rs index a339c2c6f9..ad928068ed 100644 --- a/crates/terminal/src/terminal_element.rs +++ b/crates/terminal/src/terminal_element.rs @@ -247,7 +247,7 @@ impl Element for TerminalEl { //TODO: Better way of doing this? let mutex1 = terminal_mutex.clone(); - let _mutex2 = terminal_mutex.clone(); + let mutex2 = terminal_mutex.clone(); cx.scene.push_mouse_region(MouseRegion { view_id: self.view.id(), @@ -269,14 +269,18 @@ impl Element for TerminalEl { cx.focus_parent_view() })), bounds: visible_bounds, - drag: Some(Rc::new(move |_delta, _cx| { - // let (point, side) = mouse_to_cell_data(pos, origin, cur_size, display_offset); + drag: Some(Rc::new(move |_delta, pos, cx| { + let (point, side) = mouse_to_cell_data(pos, origin, cur_size, display_offset); - // let mut term = mutex2.lock(); - // if let Some(mut selection) = term.selection.take() { - // selection.update(point, side); - // term.selection = Some(selection); - // } + let mut term = mutex2.lock(); + if let Some(mut selection) = term.selection.take() { + selection.update(point, side); + term.selection = Some(selection); + } else { + term.selection = Some(Selection::new(SelectionType::Simple, point, side)); + } + + cx.notify() })), ..Default::default() }); diff --git a/styles/package-lock.json b/styles/package-lock.json index 49304dc2fa..2eb6d3a1bf 100644 --- a/styles/package-lock.json +++ b/styles/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "styles", "version": "1.0.0", "license": "ISC", "dependencies": {