aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/strider/src
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2021-08-12 14:50:00 +0200
committerGitHub <noreply@github.com>2021-08-12 14:50:00 +0200
commita37d3e5889476bbac209d20f89886daa3e9d3992 (patch)
treec02fbf779dda57b615a852fd6a43818b20722b19 /default-plugins/strider/src
parentdocs(governance): arbiter no-confidence vote (diff)
downloadsl0ppij-a37d3e5889476bbac209d20f89886daa3e9d3992.tar.gz
sl0ppij-a37d3e5889476bbac209d20f89886daa3e9d3992.tar.xz
sl0ppij-a37d3e5889476bbac209d20f89886daa3e9d3992.zip
feat(ui): pane frames (new pane UI) (#643)
* work * resize working * move focus working * close pane working * selection and fullscreen working * pane title line * titles and conditional scroll title * whole tab resize working * plugin frames working * plugin splitting working * truncate pane frame titles * cleanup * panes always draw their own borders - also fix gap * toggle pane frames * move toggle to screen and fix some bugs * fix plugin frame toggle * fix terminal window resize * fix scrolling and fullscreen bugs * unit tests passing * e2e tests passing and new test for new frames added * refactor: TerminalPane and PluginPane * refactor: Tab * refactor: moar Tab * refactor: Boundaries * only render and calculate boundaries when there are no pane frames * refactor: Layout * fix(grid): properly resize when coming back from alternative viewport * style: remove commented code * style: fmt * style: fmt * style: fmt + clippy * docs(changelog): update change
Diffstat (limited to 'default-plugins/strider/src')
-rw-r--r--default-plugins/strider/src/state.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/default-plugins/strider/src/state.rs b/default-plugins/strider/src/state.rs
index 0d96ae0b..0ae84ab2 100644
--- a/default-plugins/strider/src/state.rs
+++ b/default-plugins/strider/src/state.rs
@@ -47,10 +47,10 @@ impl FsEntry {
FsEntry::Dir(_, s) => s.to_string(),
FsEntry::File(_, s) => pb::convert(*s as f64),
};
- let space = width - info.len();
+ let space = width.saturating_sub(info.len());
let name = self.name();
- if space - 1 < name.len() {
- [&name[..space - 2], &info].join("~ ")
+ if space.saturating_sub(1) < name.len() {
+ [&name[..space.saturating_sub(2)], &info].join("~ ")
} else {
let padding = " ".repeat(space - name.len());
[name, padding, info].concat()