aboutsummaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
authorDenis Maximov <denismaximov98@gmail.com>2020-12-18 12:11:25 +0200
committerGitHub <noreply@github.com>2020-12-18 11:11:25 +0100
commitd47904ea5bf3c7d5043c73d953c6ac2545ccdbd9 (patch)
treeb38e2d9ad9090e58d3f33988c4fb82f175a983c7 /src/errors.rs
parentfix(compatibility): fix bash linewrap (#109) (diff)
downloadsl0ppij-d47904ea5bf3c7d5043c73d953c6ac2545ccdbd9.tar.gz
sl0ppij-d47904ea5bf3c7d5043c73d953c6ac2545ccdbd9.tar.xz
sl0ppij-d47904ea5bf3c7d5043c73d953c6ac2545ccdbd9.zip
feature(infrastructure): tabs (#89)
* wip: tabs, just outlining stuff, for now it is a mess * wip: tabs, just outlining stuff, for now it is a mess * wip: formatting * wip: some moving around * wip: not sure why those things are not imported * wip: cleaning up a bit * wip: doesn't render when new tab is created? * wip: doesnt re-render when a new tab is spawned for now * wip: tabs now are a BTreeMap and we can switch between them in both directions * wip: I think that should also be here * wip: cleanup * Spawn a new terminal simultaneously with a new tab * Ensure proper Opening and Closing of tabs * cleanup * more cleanup * tests(snapshots): add 'loading' snapshot to each scenario * fix(tests): update snapshots * Add tests for tabs implementation * wip: added tests, moved tab related stuff to a separate file * wip: var name change, removed unused imports * chore: fromatting * wip: tests are you ok? * Remove next_tab_index field * clean close_tab() logic in screen.render() * wip: more tests added, review changes covered * chore: a programmer and a formatter walk into a bar.... * style(screen): update description comment * docs(tab): add comment description Co-authored-by: denis <denis@airheadventures.com> Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com> Co-authored-by: Aram Drevekenin <aram@poor.dev> Co-authored-by: Kunal Mohan <44079328+kunalmohan@users.noreply.github.com>
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs
index 8478969d..f2e68058 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -153,6 +153,10 @@ pub enum ScreenContext {
ToggleActiveTerminalFullscreen,
ClosePane,
ApplyLayout,
+ NewTab,
+ SwitchTabNext,
+ SwitchTabPrev,
+ CloseTab,
}
impl From<&ScreenInstruction> for ScreenContext {
@@ -183,6 +187,10 @@ impl From<&ScreenInstruction> for ScreenContext {
}
ScreenInstruction::ClosePane(_) => ScreenContext::ClosePane,
ScreenInstruction::ApplyLayout(_) => ScreenContext::ApplyLayout,
+ ScreenInstruction::NewTab(_) => ScreenContext::NewTab,
+ ScreenInstruction::SwitchTabNext => ScreenContext::SwitchTabNext,
+ ScreenInstruction::SwitchTabPrev => ScreenContext::SwitchTabPrev,
+ ScreenInstruction::CloseTab => ScreenContext::CloseTab,
}
}
}
@@ -192,7 +200,9 @@ pub enum PtyContext {
SpawnTerminal,
SpawnTerminalVertically,
SpawnTerminalHorizontally,
+ NewTab,
ClosePane,
+ CloseTab,
Quit,
}
@@ -203,6 +213,8 @@ impl From<&PtyInstruction> for PtyContext {
PtyInstruction::SpawnTerminalVertically(_) => PtyContext::SpawnTerminalVertically,
PtyInstruction::SpawnTerminalHorizontally(_) => PtyContext::SpawnTerminalHorizontally,
PtyInstruction::ClosePane(_) => PtyContext::ClosePane,
+ PtyInstruction::CloseTab(_) => PtyContext::CloseTab,
+ PtyInstruction::NewTab => PtyContext::NewTab,
PtyInstruction::Quit => PtyContext::Quit,
}
}