Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pretty_assertions = "1.4.1"
temp-dir = "0.1.16"
criterion = "0.8.1"
insta = "1.46.0"
unicode-width = "0.2.0"
temp-env = "0.3.6"
stdext = "0.3.3"
url = "2.5.7"
Expand Down Expand Up @@ -77,4 +76,5 @@ tinyvec = "1.10.0"
smashquote = "0.1.2"
imara-diff = { version = "0.2.0", default-features = false }
fuzzy-matcher = "0.3.7"
unicode-width = "0.2.0"
url = "2.5.7"
4 changes: 2 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl App {

pub fn update_screens(&mut self) -> Res<()> {
for screen in &mut self.state.screens {
screen.update()?;
screen.refresh()?;
}

self.stage_redraw();
Expand All @@ -206,7 +206,7 @@ impl App {
match event {
Event::Resize(w, h) => {
for screen in self.state.screens.iter_mut() {
screen.size = Size::new(w, h);
screen.resize(w, h)?;
}

self.stage_redraw();
Expand Down
5 changes: 2 additions & 3 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use std::hash::Hash;
use std::hash::Hasher;
use std::iter;
use std::rc::Rc;
use std::sync::Arc;

pub type ItemId = u64;

Expand All @@ -32,7 +31,7 @@ pub(crate) struct Item {
}

impl Item {
pub fn to_line(&'_ self, config: Arc<Config>) -> Line<'_> {
pub fn to_line(&'_ self, config: &Config) -> Line<'_> {
match self.data.clone() {
ItemData::Raw(content) => Line::raw(content),
ItemData::AllUnstaged(count) => Line::from(vec![
Expand Down Expand Up @@ -118,7 +117,7 @@ impl Item {
line_i,
} => {
let hunk_highlights =
highlight::highlight_hunk(self.id, &config, &Rc::clone(&diff), file_i, hunk_i);
highlight::highlight_hunk(self.id, config, &Rc::clone(&diff), file_i, hunk_i);

let hunk_content = &diff.hunk_content(file_i, hunk_i);
let hunk_line = &hunk_content[line_range.clone()];
Expand Down
2 changes: 1 addition & 1 deletion src/ops/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl OpTrait for ToggleSection {
fn get_action(&self, target: &ItemData) -> Option<Action> {
if target.is_section() {
Some(Rc::new(|app, _term| {
app.screen_mut().toggle_section();
app.screen_mut().toggle_section()?;
Ok(())
}))
} else {
Expand Down
Loading
Loading