diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 13c719874b..36f4d908b0 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -3,8 +3,6 @@ name: Nix Build on: workflow_dispatch: pull_request: - branches: - - main paths: - '**/*.rs' - '.github/workflows/nix-build.yml' @@ -26,5 +24,4 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - uses: DeterminateSystems/flake-checker-action@main - - name: Run `nix build` - run: nix build --max-jobs auto --build-max-jobs auto --print-build-logs + - run: nix build --max-jobs auto --build-max-jobs auto --print-build-logs diff --git a/frontends/rioterm/src/context/grid.rs b/frontends/rioterm/src/context/grid.rs index de49be4807..9846913777 100644 --- a/frontends/rioterm/src/context/grid.rs +++ b/frontends/rioterm/src/context/grid.rs @@ -991,7 +991,7 @@ pub mod test { assert_eq!(context_dimension.columns, 66); assert_eq!(context_dimension.lines, 88); - let rich_text_id = 1; + let rich_text_id = 0; let route_id = 0; let context = create_mock_context( VoidListener {}, diff --git a/frontends/rioterm/src/context/mod.rs b/frontends/rioterm/src/context/mod.rs index f1e54e9630..32bed74e23 100644 --- a/frontends/rioterm/src/context/mod.rs +++ b/frontends/rioterm/src/context/mod.rs @@ -181,7 +181,7 @@ pub struct ContextManager { pub titles: ContextManagerTitles, } -pub fn create_mock_context( +pub fn create_dead_context( event_proxy: T, window_id: WindowId, route_id: usize, @@ -213,6 +213,42 @@ pub fn create_mock_context( } } +#[cfg(test)] +pub fn create_mock_context< + T: rio_backend::event::EventListener + Clone + std::marker::Send + 'static, +>( + event_proxy: T, + window_id: WindowId, + route_id: usize, + rich_text_id: usize, + dimension: ContextDimension, +) -> Context { + let config = ContextManagerConfig { + #[cfg(not(target_os = "windows"))] + use_fork: true, + working_dir: None, + shell: Shell { + program: std::env::var("SHELL").unwrap_or("bash".to_string()), + args: vec![], + }, + spawn_performer: false, + is_native: false, + should_update_titles: false, + use_current_path: false, + split_color: [0., 0., 0., 0.], + }; + ContextManager::create_context( + (&Cursor::default(), false), + event_proxy.clone(), + window_id, + route_id, + rich_text_id, + dimension, + &config, + ) + .unwrap() +} + impl ContextManager { #[inline] fn create_context( @@ -358,7 +394,7 @@ impl ContextManager { window_id, ); - create_mock_context( + create_dead_context( event_proxy.clone(), window_id, route_id,