Cleaned up debugging code
This commit is contained in:
parent
8e4c54ab61
commit
ce60a9a50a
2 changed files with 2 additions and 32 deletions
|
@ -484,7 +484,6 @@ mod tests {
|
||||||
let (chunks, _) = build_chunks(
|
let (chunks, _) = build_chunks(
|
||||||
term.lock().renderable_content().display_iter,
|
term.lock().renderable_content().display_iter,
|
||||||
&Default::default(),
|
&Default::default(),
|
||||||
0.,
|
|
||||||
);
|
);
|
||||||
let content = chunks.iter().map(|e| e.0.trim()).collect::<String>();
|
let content = chunks.iter().map(|e| e.0.trim()).collect::<String>();
|
||||||
content.contains("7")
|
content.contains("7")
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use alacritty_terminal::{
|
use alacritty_terminal::{
|
||||||
ansi::Color as AnsiColor,
|
ansi::Color as AnsiColor,
|
||||||
grid::{Dimensions, GridIterator, Indexed},
|
grid::{GridIterator, Indexed},
|
||||||
index::Point,
|
index::Point,
|
||||||
term::{
|
term::{
|
||||||
cell::{Cell, Flags},
|
cell::{Cell, Flags},
|
||||||
|
@ -121,13 +121,8 @@ impl Element for TerminalEl {
|
||||||
let term = view_handle.read(cx).term.lock();
|
let term = view_handle.read(cx).term.lock();
|
||||||
let content = term.renderable_content();
|
let content = term.renderable_content();
|
||||||
|
|
||||||
//TODO: Remove
|
|
||||||
// dbg!("*******");
|
|
||||||
// dbg!(cur_size.columns());
|
|
||||||
|
|
||||||
//And we're off! Begin layouting
|
//And we're off! Begin layouting
|
||||||
let (chunks, line_count) =
|
let (chunks, line_count) = build_chunks(content.display_iter, &terminal_theme);
|
||||||
build_chunks(content.display_iter, &terminal_theme, cell_width.0);
|
|
||||||
|
|
||||||
let shaped_lines = layout_highlighted_chunks(
|
let shaped_lines = layout_highlighted_chunks(
|
||||||
chunks
|
chunks
|
||||||
|
@ -140,11 +135,6 @@ impl Element for TerminalEl {
|
||||||
line_count,
|
line_count,
|
||||||
);
|
);
|
||||||
|
|
||||||
//TODO: Remove
|
|
||||||
// for shaped_line in &shaped_lines {
|
|
||||||
// dbg!(shaped_line.width());
|
|
||||||
// }
|
|
||||||
|
|
||||||
let backgrounds = chunks
|
let backgrounds = chunks
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|(_, _, line_span)| line_span != &RectSpan::default())
|
.filter(|(_, _, line_span)| line_span != &RectSpan::default())
|
||||||
|
@ -192,16 +182,6 @@ impl Element for TerminalEl {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
//TODO: Implement cursor region based styling
|
|
||||||
// cx.scene.push_cursor_region(CursorRegion {
|
|
||||||
// bounds,
|
|
||||||
// style: if !view.link_go_to_definition_state.definitions.is_empty() {
|
|
||||||
// CursorStyle::PointingHand
|
|
||||||
// } else {
|
|
||||||
// CursorStyle::IBeam
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
let origin = bounds.origin() + vec2f(layout.em_width.0, 0.);
|
let origin = bounds.origin() + vec2f(layout.em_width.0, 0.);
|
||||||
|
|
||||||
//Start us off with a nice simple background color
|
//Start us off with a nice simple background color
|
||||||
|
@ -336,7 +316,6 @@ fn make_new_size(
|
||||||
pub(crate) fn build_chunks(
|
pub(crate) fn build_chunks(
|
||||||
grid_iterator: GridIterator<Cell>,
|
grid_iterator: GridIterator<Cell>,
|
||||||
theme: &TerminalStyle,
|
theme: &TerminalStyle,
|
||||||
em_width: f32,
|
|
||||||
) -> (Vec<(String, Option<HighlightStyle>, RectSpan)>, usize) {
|
) -> (Vec<(String, Option<HighlightStyle>, RectSpan)>, usize) {
|
||||||
let mut line_count: usize = 0;
|
let mut line_count: usize = 0;
|
||||||
//Every `group_by()` -> `into_iter()` pair needs to be seperated by a local variable so
|
//Every `group_by()` -> `into_iter()` pair needs to be seperated by a local variable so
|
||||||
|
@ -369,14 +348,6 @@ pub(crate) fn build_chunks(
|
||||||
.chain(iter::once(("\n".to_string(), None, Default::default())))
|
.chain(iter::once(("\n".to_string(), None, Default::default())))
|
||||||
.collect::<Vec<(String, Option<HighlightStyle>, RectSpan)>>()
|
.collect::<Vec<(String, Option<HighlightStyle>, RectSpan)>>()
|
||||||
})
|
})
|
||||||
//TODO: Remove
|
|
||||||
// .inspect(|line_chunks| {
|
|
||||||
// let mut line_len = 0;
|
|
||||||
// for chunk in line_chunks {
|
|
||||||
// line_len += chunk.0.len();
|
|
||||||
// }
|
|
||||||
// dbg!((line_len, line_len as f32 * em_width));
|
|
||||||
// })
|
|
||||||
.flatten()
|
.flatten()
|
||||||
//We have a Vec<Vec<>> (Vec of lines of styled chunks), flatten to just Vec<> (the styled chunks)
|
//We have a Vec<Vec<>> (Vec of lines of styled chunks), flatten to just Vec<> (the styled chunks)
|
||||||
.collect::<Vec<(String, Option<HighlightStyle>, RectSpan)>>();
|
.collect::<Vec<(String, Option<HighlightStyle>, RectSpan)>>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue