Skip to content

Commit

Permalink
Merge branch 'master' into freebsd-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly committed Dec 22, 2020
2 parents d7f353a + 6fcbb99 commit dee7f68
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 36 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ chrono = "0.4"
backtrace = "0.3"
ron = "0.6"
serde = "1.0"
anyhow = "1.0.35"
anyhow = "1.0.36"
unicode-width = "0.1"
textwrap = "0.13"

Expand Down
22 changes: 11 additions & 11 deletions src/components/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,21 @@ impl ChangesComponent {
_ => sync::stage_add_file(CWD, path)?,
};

return Ok(true);
} else {
//TODO: check if we can handle the one file case with it aswell
sync::stage_add_all(
CWD,
tree_item.info.full_path.as_str(),
)?;

return Ok(true);
}
} else {
let path = tree_item.info.full_path.as_str();
sync::reset_stage(CWD, path)?;

//TODO: check if we can handle the one file case with it aswell
sync::stage_add_all(
CWD,
tree_item.info.full_path.as_str(),
)?;

return Ok(true);
}

let path = tree_item.info.full_path.as_str();
sync::reset_stage(CWD, path)?;
return Ok(true);
}

Ok(false)
Expand Down
23 changes: 11 additions & 12 deletions src/components/filetree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,17 @@ impl FileTreeComponent {
{
should_skip_over -= 1;
break;
} else {
// There is only one item at this level (i.e only one folder in the folder),
// so do fold up

let vec_draw_text_info_len =
vec_draw_text_info.len();
vec_draw_text_info[vec_draw_text_info_len - 1]
.name += &(String::from("/")
+ &tree_items[idx_temp].info.path);
if index_above_select {
selection_offset += 1;
}
}

// There is only one item at this level (i.e only one folder in the folder),
// so do fold up

let vec_draw_text_info_len = vec_draw_text_info.len();
vec_draw_text_info[vec_draw_text_info_len - 1]
.name += &(String::from("/")
+ &tree_items[idx_temp].info.path);
if index_above_select {
selection_offset += 1;
}
}
}
Expand Down
19 changes: 9 additions & 10 deletions src/components/utils/statustree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ impl StatusTree {
{
current_index_in_available_selections = pos;
break;
} else {
// Find the closest to the index, usually this shouldn't happen
if current_index == 0 {
// This should never happen
current_index_in_available_selections = 0;
break;
}
cur_index_find -= 1;
}

// Find the closest to the index, usually this shouldn't happen
if current_index == 0 {
// This should never happen
current_index_in_available_selections = 0;
break;
}
cur_index_find -= 1;
}
}

Expand Down Expand Up @@ -398,9 +398,8 @@ impl StatusTree {
}
// we are still in a collapsed inner path
continue;
} else {
inner_collapsed = None;
}
inner_collapsed = None;
}

let item_kind = self.tree[i].kind.clone();
Expand Down

0 comments on commit dee7f68

Please sign in to comment.