Skip to content

Commit

Permalink
let's try to break in parts
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Dec 21, 2024
1 parent 019c279 commit 8ac69ff
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
56 changes: 28 additions & 28 deletions frontends/rioterm/src/context/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,34 +991,34 @@ pub mod test {

assert_eq!(context_dimension.columns, 66);
assert_eq!(context_dimension.lines, 88);
let rich_text_id = 1;
let route_id = 0;
let context = create_mock_context(
VoidListener {},
WindowId::from(0),
route_id,
rich_text_id,
context_dimension,
);
let context_width = context.dimension.width;
let context_height = context.dimension.height;
let context_margin = context.dimension.margin;
let grid = ContextGrid::<VoidListener>::new(context, margin, [0., 0., 0., 0.]);
// The first context should fill completely w/h grid
assert_eq!(grid.width, context_width);
assert_eq!(grid.height, context_height);

// Context margin should empty
assert_eq!(Delta::<f32>::default(), context_margin);
assert_eq!(grid.margin, margin);

assert_eq!(
grid.objects(),
vec![Object::RichText(RichText {
id: rich_text_id,
position: [10., 20.],
})]
);
// let rich_text_id = 1;
// let route_id = 0;
// let context = create_mock_context(
// VoidListener {},
// WindowId::from(0),
// route_id,
// rich_text_id,
// context_dimension,
// );
// let context_width = context.dimension.width;
// let context_height = context.dimension.height;
// let context_margin = context.dimension.margin;
// let grid = ContextGrid::<VoidListener>::new(context, margin, [0., 0., 0., 0.]);
// // The first context should fill completely w/h grid
// assert_eq!(grid.width, context_width);
// assert_eq!(grid.height, context_height);

// // Context margin should empty
// assert_eq!(Delta::<f32>::default(), context_margin);
// assert_eq!(grid.margin, margin);

// assert_eq!(
// grid.objects(),
// vec![Object::RichText(RichText {
// id: rich_text_id,
// position: [10., 20.],
// })]
// );
}

// #[test]
Expand Down
34 changes: 17 additions & 17 deletions frontends/rioterm/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl<T: EventListener + Clone + std::marker::Send + 'static> ContextManager<T> {
let pty;
#[cfg(not(target_os = "windows"))]
{
// if config.use_fork {
if config.use_fork {
tracing::info!("rio -> teletypewriter: create_pty_with_fork");
pty = match create_pty_with_fork(
&Cow::Borrowed(&config.shell.program),
Expand All @@ -253,22 +253,22 @@ impl<T: EventListener + Clone + std::marker::Send + 'static> ContextManager<T> {
return Err(Box::new(err));
}
}
// } else {
// tracing::info!("rio -> teletypewriter: create_pty_with_spawn");
// pty = match create_pty_with_spawn(
// &Cow::Borrowed(&config.shell.program),
// config.shell.args.clone(),
// &config.working_dir,
// cols,
// rows,
// ) {
// Ok(created_pty) => created_pty,
// Err(err) => {
// tracing::error!("{err:?}");
// return Err(Box::new(err));
// }
// }
// };
} else {
tracing::info!("rio -> teletypewriter: create_pty_with_spawn");
pty = match create_pty_with_spawn(
&Cow::Borrowed(&config.shell.program),
config.shell.args.clone(),
&config.working_dir,
cols,
rows,
) {
Ok(created_pty) => created_pty,
Err(err) => {
tracing::error!("{err:?}");
return Err(Box::new(err));
}
}
};
}

#[cfg(not(target_os = "windows"))]
Expand Down

0 comments on commit 8ac69ff

Please sign in to comment.