Working on selection

This commit is contained in:
Mikayla Maki 2022-06-24 15:12:30 -07:00
parent 9e55c60b6a
commit 2b1fa07e89

View file

@ -7,6 +7,7 @@ use alacritty_terminal::{
event_loop::{EventLoop, Msg, Notifier}, event_loop::{EventLoop, Msg, Notifier},
grid::Indexed, grid::Indexed,
index::Point, index::Point,
selection,
sync::FairMutex, sync::FairMutex,
term::{ term::{
cell::{Cell, Flags}, cell::{Cell, Flags},
@ -15,8 +16,10 @@ use alacritty_terminal::{
}, },
tty, Term, tty, Term,
}; };
use editor::CursorShape;
use futures::{ use futures::{
channel::mpsc::{unbounded, UnboundedSender}, channel::mpsc::{unbounded, UnboundedSender},
future::select,
StreamExt, StreamExt,
}; };
use gpui::{ use gpui::{
@ -492,6 +495,7 @@ impl Element for TerminalEl {
)); ));
let content = term.renderable_content(); let content = term.renderable_content();
let selection = content.selection;
let cursor = RectF::new( let cursor = RectF::new(
vec2f( vec2f(
@ -510,6 +514,9 @@ impl Element for TerminalEl {
color: Some(Color::white()), color: Some(Color::white()),
..Default::default() ..Default::default()
}; };
let select_boxes = vec![];
for cell in content.display_iter { for cell in content.display_iter {
let Indexed { let Indexed {
point: Point { line, .. }, point: Point { line, .. },
@ -518,6 +525,9 @@ impl Element for TerminalEl {
}, //TODO: Learn what 'CellExtra does' }, //TODO: Learn what 'CellExtra does'
} = cell; } = cell;
if let Some(selection) = selection {
selection.contains_cell(&cell, ???, CursorShape::Block);
}
let new_highlight = make_style_from_cell(fg, flags); let new_highlight = make_style_from_cell(fg, flags);
HighlightStyle { HighlightStyle {
color: Some(alac_color_to_gpui_color(fg)), color: Some(alac_color_to_gpui_color(fg)),