From 2f3af71408b20d064b5abcc3eadc730938e66bc7 Mon Sep 17 00:00:00 2001 From: remique <44347542+remique@users.noreply.github.com> Date: Thu, 12 Nov 2020 15:39:50 +0100 Subject: [PATCH 1/2] Add scrollbar in branchlist (#417) * Add scrollbar in branchlist * Change scrollbar symbol to DOUBLE_VERTICAL --- src/components/select_branch.rs | 12 ++++++++++-- src/ui/scrollbar.rs | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/select_branch.rs b/src/components/select_branch.rs index 297aab5c9c..0995cfde82 100644 --- a/src/components/select_branch.rs +++ b/src/components/select_branch.rs @@ -78,12 +78,20 @@ impl DrawableComponent for SelectBranchComponent { .block( Block::default() .title(strings::SELECT_BRANCH_POPUP_MSG) - .borders(Borders::ALL) - .border_type(BorderType::Thick), + .border_type(BorderType::Thick) + .borders(Borders::ALL), ) .alignment(Alignment::Left), area, ); + + ui::draw_scrollbar( + f, + area, + &self.theme, + self.branch_names.len(), + self.scroll_top.get(), + ); } Ok(()) diff --git a/src/ui/scrollbar.rs b/src/ui/scrollbar.rs index 5cd63bd472..73f2ab9b10 100644 --- a/src/ui/scrollbar.rs +++ b/src/ui/scrollbar.rs @@ -5,7 +5,7 @@ use tui::{ buffer::Buffer, layout::{Margin, Rect}, style::Style, - symbols::{block::FULL, line::THICK_VERTICAL}, + symbols::{block::FULL, line::DOUBLE_VERTICAL}, widgets::Widget, Frame, }; @@ -50,7 +50,7 @@ impl Widget for Scrollbar { } for y in area.top()..area.bottom() { - buf.set_string(right, y, THICK_VERTICAL, self.style_bar); + buf.set_string(right, y, DOUBLE_VERTICAL, self.style_bar); } let max_pos = self.lines.saturating_sub(area.height); From ac2c0624db439fa08ad99c3bb2ff07c23d58b154 Mon Sep 17 00:00:00 2001 From: Richard Menzies Date: Fri, 13 Nov 2020 10:58:55 +0000 Subject: [PATCH 2/2] Change he and his to they and their --- asyncgit/src/sync/remotes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asyncgit/src/sync/remotes.rs b/asyncgit/src/sync/remotes.rs index ff93cce37b..f95fd02abd 100644 --- a/asyncgit/src/sync/remotes.rs +++ b/asyncgit/src/sync/remotes.rs @@ -178,8 +178,8 @@ fn remote_callbacks<'a>( }); let mut first_call_to_credentials = true; - // This boolean is used to avoid multiple call to credentials callback. - // If credentials are bad, we don't ask the user to re-fill his creds. We push an error and he will be able to restart his action (for example a push) and retype his creds. + // This boolean is used to avoid multiple calls to credentials callback. + // If credentials are bad, we don't ask the user to re-fill their creds. We push an error and they will be able to restart their action (for example a push) and retype their creds. // This behavior is explained in a issue on git2-rs project : https://github.com/rust-lang/git2-rs/issues/347 // An implementation reference is done in cargo : https://github.com/rust-lang/cargo/blob/9fb208dddb12a3081230a5fd8f470e01df8faa25/src/cargo/sources/git/utils.rs#L588 // There is also a guide about libgit2 authentication : https://libgit2.org/docs/guides/authentication/