Fixed merge conflict

This commit is contained in:
Mikayla Maki 2022-07-07 14:54:13 -07:00
parent a8237858bc
commit 415e28e2d3
3 changed files with 15 additions and 16 deletions

View file

@ -9,11 +9,8 @@ use alacritty_terminal::{
Term, Term,
}; };
<<<<<<< HEAD
use dirs::home_dir;
=======
use color_translation::{get_color_at_index, to_alac_rgb}; use color_translation::{get_color_at_index, to_alac_rgb};
>>>>>>> 3fe0d66d (Began working on selections, refactored colors) use dirs::home_dir;
use futures::{ use futures::{
channel::mpsc::{unbounded, UnboundedSender}, channel::mpsc::{unbounded, UnboundedSender},
StreamExt, StreamExt,
@ -475,13 +472,12 @@ fn get_working_directory(wt: &LocalWorktree) -> Option<PathBuf> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::{path::Path, sync::atomic::AtomicUsize, time::Duration};
use super::*; use super::*;
use alacritty_terminal::{grid::GridIterator, term::cell::Cell}; use alacritty_terminal::{grid::GridIterator, term::cell::Cell};
use gpui::TestAppContext; use gpui::TestAppContext;
use itertools::Itertools; use itertools::Itertools;
use project::{FakeFs, Fs, RealFs, RemoveOptions, Worktree}; 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, ///Basic integration test, can we get the terminal to show up, execute a command,
//and produce noticable output? //and produce noticable output?
@ -489,7 +485,6 @@ mod tests {
async fn test_terminal(cx: &mut TestAppContext) { async fn test_terminal(cx: &mut TestAppContext) {
let terminal = cx.add_view(Default::default(), |cx| Terminal::new(cx, None)); let terminal = cx.add_view(Default::default(), |cx| Terminal::new(cx, None));
cx.set_condition_duration(Duration::from_secs(2)); cx.set_condition_duration(Duration::from_secs(2));
terminal.update(cx, |terminal, cx| { terminal.update(cx, |terminal, cx| {
terminal.write_to_pty(&Input(("expr 3 + 4".to_string()).to_string()), cx); terminal.write_to_pty(&Input(("expr 3 + 4".to_string()).to_string()), cx);
terminal.carriage_return(&Return, cx); terminal.carriage_return(&Return, cx);
@ -499,6 +494,7 @@ mod tests {
.condition(cx, |terminal, _cx| { .condition(cx, |terminal, _cx| {
let term = terminal.term.clone(); let term = terminal.term.clone();
let content = grid_as_str(term.lock().renderable_content().display_iter); let content = grid_as_str(term.lock().renderable_content().display_iter);
dbg!(&content);
content.contains("7") content.contains("7")
}) })
.await; .await;

View file

@ -247,7 +247,7 @@ impl Element for TerminalEl {
//TODO: Better way of doing this? //TODO: Better way of doing this?
let mutex1 = terminal_mutex.clone(); let mutex1 = terminal_mutex.clone();
let _mutex2 = terminal_mutex.clone(); let mutex2 = terminal_mutex.clone();
cx.scene.push_mouse_region(MouseRegion { cx.scene.push_mouse_region(MouseRegion {
view_id: self.view.id(), view_id: self.view.id(),
@ -269,14 +269,18 @@ impl Element for TerminalEl {
cx.focus_parent_view() cx.focus_parent_view()
})), })),
bounds: visible_bounds, bounds: visible_bounds,
drag: Some(Rc::new(move |_delta, _cx| { drag: Some(Rc::new(move |_delta, pos, cx| {
// let (point, side) = mouse_to_cell_data(pos, origin, cur_size, display_offset); let (point, side) = mouse_to_cell_data(pos, origin, cur_size, display_offset);
// let mut term = mutex2.lock(); let mut term = mutex2.lock();
// if let Some(mut selection) = term.selection.take() { if let Some(mut selection) = term.selection.take() {
// selection.update(point, side); selection.update(point, side);
// term.selection = Some(selection); term.selection = Some(selection);
// } } else {
term.selection = Some(Selection::new(SelectionType::Simple, point, side));
}
cx.notify()
})), })),
..Default::default() ..Default::default()
}); });

View file

@ -5,7 +5,6 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "styles",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {