mirror of
https://github.com/extrawurst/gitui.git
synced 2024-11-22 02:12:58 +03:00
fix a bunch more typos
This commit is contained in:
parent
5dad9f4adb
commit
2bbaa6f3a1
@ -212,7 +212,7 @@ Bugfix followup release - check `0.22.0` notes for more infos!
|
|||||||
### Added
|
### Added
|
||||||
* stack popups ([#846](https://github.com/extrawurst/gitui/issues/846))
|
* stack popups ([#846](https://github.com/extrawurst/gitui/issues/846))
|
||||||
* file history log [[@cruessler](https://github.com/cruessler)] ([#381](https://github.com/extrawurst/gitui/issues/381))
|
* file history log [[@cruessler](https://github.com/cruessler)] ([#381](https://github.com/extrawurst/gitui/issues/381))
|
||||||
* termux support on andriod [[@PeroSar](https://github.com/PeroSar)] ([#1139](https://github.com/extrawurst/gitui/issues/1139))
|
* termux support on android [[@PeroSar](https://github.com/PeroSar)] ([#1139](https://github.com/extrawurst/gitui/issues/1139))
|
||||||
* use `GIT_DIR` and `GIT_WORK_DIR` from environment if set ([#1191](https://github.com/extrawurst/gitui/pull/1191))
|
* use `GIT_DIR` and `GIT_WORK_DIR` from environment if set ([#1191](https://github.com/extrawurst/gitui/pull/1191))
|
||||||
* new [FAQ](./FAQ.md)s page
|
* new [FAQ](./FAQ.md)s page
|
||||||
* mention macports in install section [[@fs111](https://github.com/fs111)]([#1237](https://github.com/extrawurst/gitui/pull/1237))
|
* mention macports in install section [[@fs111](https://github.com/fs111)]([#1237](https://github.com/extrawurst/gitui/pull/1237))
|
||||||
@ -648,7 +648,7 @@ Thanks for your interest and support over this year! Read more about the 1 year
|
|||||||
- min size for relative popups on small terminals ([#179](https://github.com/extrawurst/gitui/issues/179))
|
- min size for relative popups on small terminals ([#179](https://github.com/extrawurst/gitui/issues/179))
|
||||||
- fix crash on resizing terminal to very small width ([#198](https://github.com/extrawurst/gitui/issues/198))
|
- fix crash on resizing terminal to very small width ([#198](https://github.com/extrawurst/gitui/issues/198))
|
||||||
- fix broken tags when using a different internal representation ([#206](https://github.com/extrawurst/gitui/issues/206))
|
- fix broken tags when using a different internal representation ([#206](https://github.com/extrawurst/gitui/issues/206))
|
||||||
- tags are not cleanly seperated in details view ([#212](https://github.com/extrawurst/gitui/issues/212))
|
- tags are not cleanly separated in details view ([#212](https://github.com/extrawurst/gitui/issues/212))
|
||||||
|
|
||||||
## [0.8.1] - 2020-07-07
|
## [0.8.1] - 2020-07-07
|
||||||
|
|
||||||
@ -814,7 +814,7 @@ Thanks for your interest and support over this year! Read more about the 1 year
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- show longer commit messages in log view
|
- show longer commit messages in log view
|
||||||
- introduce propper error handling in `asyncgit` [[@MCord](https://github.com/MCord)]([#53](https://github.com/extrawurst/gitui/issues/53))
|
- introduce proper error handling in `asyncgit` [[@MCord](https://github.com/MCord)]([#53](https://github.com/extrawurst/gitui/issues/53))
|
||||||
- better error message when trying to run outside of a valid git repo ([#56](https://github.com/extrawurst/gitui/issues/56))
|
- better error message when trying to run outside of a valid git repo ([#56](https://github.com/extrawurst/gitui/issues/56))
|
||||||
- improve ctrl+c handling so it is checked first and no component needs to worry of blocking it
|
- improve ctrl+c handling so it is checked first and no component needs to worry of blocking it
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ impl<T: Copy + Send, P: Clone + Send + Sync + PartialEq>
|
|||||||
/// send an intermediate update notification.
|
/// send an intermediate update notification.
|
||||||
/// do not confuse this with the return value of `run`.
|
/// do not confuse this with the return value of `run`.
|
||||||
/// `send` should only be used about progress notifications
|
/// `send` should only be used about progress notifications
|
||||||
/// and not for the final notifcation indicating the end of the async job.
|
/// and not for the final notification indicating the end of the async job.
|
||||||
/// see `run` for more info
|
/// see `run` for more info
|
||||||
pub fn send(&self, notification: T) -> Result<()> {
|
pub fn send(&self, notification: T) -> Result<()> {
|
||||||
self.sender.send(notification)?;
|
self.sender.send(notification)?;
|
||||||
@ -191,10 +191,10 @@ mod test {
|
|||||||
value_to_add: u32,
|
value_to_add: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
type TestNotificaton = ();
|
type TestNotification = ();
|
||||||
|
|
||||||
impl AsyncJob for TestJob {
|
impl AsyncJob for TestJob {
|
||||||
type Notification = TestNotificaton;
|
type Notification = TestNotification;
|
||||||
type Progress = ();
|
type Progress = ();
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
|
@ -66,7 +66,7 @@ impl RemoteProgress {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// spawn thread to listen to progress notifcations coming in from blocking remote git method (fetch/push)
|
/// spawn thread to listen to progress notifications coming in from blocking remote git method (fetch/push)
|
||||||
pub(crate) fn spawn_receiver_thread<
|
pub(crate) fn spawn_receiver_thread<
|
||||||
T: 'static + AsyncProgress,
|
T: 'static + AsyncProgress,
|
||||||
>(
|
>(
|
||||||
|
@ -263,7 +263,7 @@ mod test {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
//this should not have commited cause we left conflicts behind
|
//this should not have committed cause we left conflicts behind
|
||||||
assert_eq!(res, None);
|
assert_eq!(res, None);
|
||||||
|
|
||||||
let state = crate::sync::repo_state(
|
let state = crate::sync::repo_state(
|
||||||
|
@ -10,7 +10,7 @@ use crate::{
|
|||||||
use git2::BranchType;
|
use git2::BranchType;
|
||||||
use scopetime::scope_time;
|
use scopetime::scope_time;
|
||||||
|
|
||||||
/// trys merging current branch with its upstrema using rebase
|
/// tries merging current branch with its upstream using rebase
|
||||||
pub fn merge_upstream_rebase(
|
pub fn merge_upstream_rebase(
|
||||||
repo_path: &RepoPath,
|
repo_path: &RepoPath,
|
||||||
branch_name: &str,
|
branch_name: &str,
|
||||||
|
@ -384,7 +384,7 @@ pub fn checkout_remote_branch(
|
|||||||
if let Err(e) = repo.checkout_head(Some(
|
if let Err(e) = repo.checkout_head(Some(
|
||||||
git2::build::CheckoutBuilder::new().force(),
|
git2::build::CheckoutBuilder::new().force(),
|
||||||
)) {
|
)) {
|
||||||
// This is safe beacuse cur_ref was just found
|
// This is safe because cur_ref was just found
|
||||||
repo.set_head(bytes2string(cur_ref.name_bytes())?.as_str())?;
|
repo.set_head(bytes2string(cur_ref.name_bytes())?.as_str())?;
|
||||||
return Err(Error::Git(e));
|
return Err(Error::Git(e));
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ mod tests {
|
|||||||
eprintln!("\n----\n{cmd}");
|
eprintln!("\n----\n{cmd}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// helper to fetch commmit details using log walker
|
/// helper to fetch commit details using log walker
|
||||||
pub fn get_commit_ids(
|
pub fn get_commit_ids(
|
||||||
r: &Repository,
|
r: &Repository,
|
||||||
max_count: usize,
|
max_count: usize,
|
||||||
|
@ -254,7 +254,7 @@ mod tests {
|
|||||||
&format!("git remote add origin {remote_path}")[..],
|
&format!("git remote add origin {remote_path}")[..],
|
||||||
);
|
);
|
||||||
|
|
||||||
//NOTE: aparently remotes are not chronolically sorted but alphabetically
|
//NOTE: apparently remotes are not chronolically sorted but alphabetically
|
||||||
let remotes = get_remotes(repo_path).unwrap();
|
let remotes = get_remotes(repo_path).unwrap();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
@ -49,7 +49,7 @@ fn get_current_branch(
|
|||||||
/// Changes the commit message of a commit with a specified oid
|
/// Changes the commit message of a commit with a specified oid
|
||||||
///
|
///
|
||||||
/// While this function is most commonly associated with doing a
|
/// While this function is most commonly associated with doing a
|
||||||
/// reword opperation in an interactive rebase, that is not how it
|
/// reword operation in an interactive rebase, that is not how it
|
||||||
/// is implemented in git2rs
|
/// is implemented in git2rs
|
||||||
///
|
///
|
||||||
/// This is dangerous if it errors, as the head will be detached so this should
|
/// This is dangerous if it errors, as the head will be detached so this should
|
||||||
|
@ -100,13 +100,13 @@ pub(crate) fn apply_selection(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if !first_hunk_encountered {
|
if !first_hunk_encountered {
|
||||||
let any_slection_in_hunk =
|
let any_selection_in_hunk =
|
||||||
hunk.lines.iter().any(|line| {
|
hunk.lines.iter().any(|line| {
|
||||||
let line: DiffLinePosition = line.into();
|
let line: DiffLinePosition = line.into();
|
||||||
lines.contains(&line)
|
lines.contains(&line)
|
||||||
});
|
});
|
||||||
|
|
||||||
first_hunk_encountered = any_slection_in_hunk;
|
first_hunk_encountered = any_selection_in_hunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
if first_hunk_encountered {
|
if first_hunk_encountered {
|
||||||
|
@ -213,7 +213,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_stash_without_2nd_parent() -> Result<()> {
|
fn test_stash_without_second_parent() -> Result<()> {
|
||||||
let file_path1 = Path::new("file1.txt");
|
let file_path1 = Path::new("file1.txt");
|
||||||
let (_td, repo) = repo_init()?;
|
let (_td, repo) = repo_init()?;
|
||||||
let root = repo.path().parent().unwrap();
|
let root = repo.path().parent().unwrap();
|
||||||
|
@ -126,7 +126,7 @@ pub fn is_workdir_clean(
|
|||||||
Ok(statuses.is_empty())
|
Ok(statuses.is_empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// gurantees sorting
|
/// guarantees sorting
|
||||||
pub fn get_status(
|
pub fn get_status(
|
||||||
repo_path: &RepoPath,
|
repo_path: &RepoPath,
|
||||||
status_type: StatusType,
|
status_type: StatusType,
|
||||||
|
@ -590,7 +590,7 @@ mod tests {
|
|||||||
assert_eq!(it.next(), None);
|
assert_eq!(it.next(), None);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_visibles(tree: &FileTreeItems) -> Vec<bool> {
|
pub fn get_visible(tree: &FileTreeItems) -> Vec<bool> {
|
||||||
tree.tree_items
|
tree.tree_items
|
||||||
.iter()
|
.iter()
|
||||||
.map(|e| e.info().is_visible())
|
.map(|e| e.info().is_visible())
|
||||||
@ -614,7 +614,7 @@ mod tests {
|
|||||||
|
|
||||||
tree.collapse(1, false);
|
tree.collapse(1, false);
|
||||||
|
|
||||||
let visibles = get_visibles(&tree);
|
let visibles = get_visible(&tree);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visibles,
|
||||||
@ -628,7 +628,7 @@ mod tests {
|
|||||||
|
|
||||||
tree.expand(1, false);
|
tree.expand(1, false);
|
||||||
|
|
||||||
let visibles = get_visibles(&tree);
|
let visibles = get_visible(&tree);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visibles,
|
||||||
@ -661,7 +661,7 @@ mod tests {
|
|||||||
tree.collapse(0, false);
|
tree.collapse(0, false);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&tree),
|
get_visible(&tree),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -674,7 +674,7 @@ mod tests {
|
|||||||
tree.expand(0, false);
|
tree.expand(0, false);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&tree),
|
get_visible(&tree),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -702,7 +702,7 @@ mod tests {
|
|||||||
|
|
||||||
tree.collapse(0, false);
|
tree.collapse(0, false);
|
||||||
|
|
||||||
let visibles = get_visibles(&tree);
|
let visibles = get_visible(&tree);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visibles,
|
||||||
@ -732,7 +732,7 @@ mod tests {
|
|||||||
|
|
||||||
tree.collapse(1, false);
|
tree.collapse(1, false);
|
||||||
|
|
||||||
let visibles = get_visibles(&tree);
|
let visibles = get_visible(&tree);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visibles,
|
||||||
@ -746,7 +746,7 @@ mod tests {
|
|||||||
|
|
||||||
tree.collapse(0, false);
|
tree.collapse(0, false);
|
||||||
|
|
||||||
let visibles = get_visibles(&tree);
|
let visibles = get_visible(&tree);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visibles,
|
||||||
@ -760,10 +760,10 @@ mod tests {
|
|||||||
|
|
||||||
tree.expand(0, false);
|
tree.expand(0, false);
|
||||||
|
|
||||||
let visibles = get_visibles(&tree);
|
let visible = get_visible(&tree);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visible,
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -799,7 +799,7 @@ mod tests {
|
|||||||
assert!(!tree.tree_items[3].kind().is_path_collapsed());
|
assert!(!tree.tree_items[3].kind().is_path_collapsed());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&tree),
|
get_visible(&tree),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -828,7 +828,7 @@ mod tests {
|
|||||||
tree.collapse(0, true);
|
tree.collapse(0, true);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&tree),
|
get_visible(&tree),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -840,7 +840,7 @@ mod tests {
|
|||||||
assert_eq!(res, 2);
|
assert_eq!(res, 2);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&tree),
|
get_visible(&tree),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -872,7 +872,7 @@ mod tests {
|
|||||||
assert_eq!(res, 4);
|
assert_eq!(res, 4);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&tree),
|
get_visible(&tree),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -898,7 +898,7 @@ mod tests {
|
|||||||
tree.collapse(0, true);
|
tree.collapse(0, true);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&tree),
|
get_visible(&tree),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -911,7 +911,7 @@ mod tests {
|
|||||||
assert!(!tree.tree_items[0].kind().is_path_collapsed());
|
assert!(!tree.tree_items[0].kind().is_path_collapsed());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&tree),
|
get_visible(&tree),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
|
@ -72,8 +72,8 @@ impl ChangesComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
pub fn is_file_seleted(&self) -> bool {
|
pub fn is_file_selected(&self) -> bool {
|
||||||
self.files.is_file_seleted()
|
self.files.is_file_selected()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn index_add_remove(&mut self) -> Result<bool> {
|
fn index_add_remove(&mut self) -> Result<bool> {
|
||||||
|
@ -184,7 +184,7 @@ impl DetailsComponent {
|
|||||||
if let Some(ref committer) = data.committer {
|
if let Some(ref committer) = data.committer {
|
||||||
res.extend(vec![
|
res.extend(vec![
|
||||||
Line::from(vec![
|
Line::from(vec![
|
||||||
style_detail(&self.theme, &Detail::Commiter),
|
style_detail(&self.theme, &Detail::Committer),
|
||||||
Span::styled(
|
Span::styled(
|
||||||
Cow::from(format!(
|
Cow::from(format!(
|
||||||
"{} <{}>",
|
"{} <{}>",
|
||||||
|
@ -5,7 +5,7 @@ use std::borrow::Cow;
|
|||||||
pub enum Detail {
|
pub enum Detail {
|
||||||
Author,
|
Author,
|
||||||
Date,
|
Date,
|
||||||
Commiter,
|
Committer,
|
||||||
Sha,
|
Sha,
|
||||||
Message,
|
Message,
|
||||||
}
|
}
|
||||||
@ -23,7 +23,7 @@ pub fn style_detail<'a>(
|
|||||||
Cow::from(strings::commit::details_date()),
|
Cow::from(strings::commit::details_date()),
|
||||||
theme.text(false, false),
|
theme.text(false, false),
|
||||||
),
|
),
|
||||||
Detail::Commiter => Span::styled(
|
Detail::Committer => Span::styled(
|
||||||
Cow::from(strings::commit::details_committer()),
|
Cow::from(strings::commit::details_committer()),
|
||||||
theme.text(false, false),
|
theme.text(false, false),
|
||||||
),
|
),
|
||||||
|
@ -119,7 +119,7 @@ impl StatusTreeComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
pub fn is_file_seleted(&self) -> bool {
|
pub fn is_file_selected(&self) -> bool {
|
||||||
self.tree.selected_item().map_or(false, |item| {
|
self.tree.selected_item().map_or(false, |item| {
|
||||||
match item.kind {
|
match item.kind {
|
||||||
FileTreeItemKind::File(_) => true,
|
FileTreeItemKind::File(_) => true,
|
||||||
|
@ -109,7 +109,7 @@ impl ItemBatch {
|
|||||||
self.items.iter()
|
self.items.iter()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// clear curent list of items
|
/// clear current list of items
|
||||||
pub fn clear(&mut self) {
|
pub fn clear(&mut self) {
|
||||||
self.items.clear();
|
self.items.clear();
|
||||||
self.index_offset = None;
|
self.index_offset = None;
|
||||||
|
@ -26,7 +26,7 @@ macro_rules! try_or_popup {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// helper func to convert unix time since epoch to formated time string in local timezone
|
/// helper func to convert unix time since epoch to formatted time string in local timezone
|
||||||
pub fn time_to_string(secs: i64, short: bool) -> String {
|
pub fn time_to_string(secs: i64, short: bool) -> String {
|
||||||
let time = DateTime::<Local>::from(
|
let time = DateTime::<Local>::from(
|
||||||
DateTime::<Utc>::from_naive_utc_and_offset(
|
DateTime::<Utc>::from_naive_utc_and_offset(
|
||||||
|
@ -444,7 +444,7 @@ mod tests {
|
|||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_visibles(tree: &StatusTree) -> Vec<bool> {
|
fn get_visible(tree: &StatusTree) -> Vec<bool> {
|
||||||
tree.tree
|
tree.tree
|
||||||
.items()
|
.items()
|
||||||
.iter()
|
.iter()
|
||||||
@ -503,7 +503,7 @@ mod tests {
|
|||||||
|
|
||||||
res.update(&string_vec_to_status(&["a/b"])).unwrap();
|
res.update(&string_vec_to_status(&["a/b"])).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&res),
|
get_visible(&res),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -533,7 +533,7 @@ mod tests {
|
|||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&res),
|
get_visible(&res),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -554,7 +554,7 @@ mod tests {
|
|||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&res),
|
get_visible(&res),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -581,10 +581,10 @@ mod tests {
|
|||||||
|
|
||||||
res.collapse(&String::from("a/b"), 1);
|
res.collapse(&String::from("a/b"), 1);
|
||||||
|
|
||||||
let visibles = get_visibles(&res);
|
let visible = get_visible(&res);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visible,
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -595,10 +595,10 @@ mod tests {
|
|||||||
|
|
||||||
res.expand(&String::from("a/b"), 1);
|
res.expand(&String::from("a/b"), 1);
|
||||||
|
|
||||||
let visibles = get_visibles(&res);
|
let visible = get_visible(&res);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visible,
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -628,7 +628,7 @@ mod tests {
|
|||||||
res.collapse(&String::from("a"), 0);
|
res.collapse(&String::from("a"), 0);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&res),
|
get_visible(&res),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -641,7 +641,7 @@ mod tests {
|
|||||||
res.expand(&String::from("a"), 0);
|
res.expand(&String::from("a"), 0);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_visibles(&res),
|
get_visible(&res),
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -669,10 +669,10 @@ mod tests {
|
|||||||
|
|
||||||
res.collapse(&String::from("a"), 0);
|
res.collapse(&String::from("a"), 0);
|
||||||
|
|
||||||
let visibles = get_visibles(&res);
|
let visible = get_visible(&res);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visible,
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -699,10 +699,10 @@ mod tests {
|
|||||||
|
|
||||||
res.collapse(&String::from("a/b"), 1);
|
res.collapse(&String::from("a/b"), 1);
|
||||||
|
|
||||||
let visibles = get_visibles(&res);
|
let visible = get_visible(&res);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visible,
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
@ -713,10 +713,10 @@ mod tests {
|
|||||||
|
|
||||||
res.collapse(&String::from("a"), 0);
|
res.collapse(&String::from("a"), 0);
|
||||||
|
|
||||||
let visibles = get_visibles(&res);
|
let visible = get_visible(&res);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visible,
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
false, //
|
false, //
|
||||||
@ -727,10 +727,10 @@ mod tests {
|
|||||||
|
|
||||||
res.expand(&String::from("a"), 0);
|
res.expand(&String::from("a"), 0);
|
||||||
|
|
||||||
let visibles = get_visibles(&res);
|
let visible = get_visible(&res);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
visibles,
|
visible,
|
||||||
vec![
|
vec![
|
||||||
true, //
|
true, //
|
||||||
true, //
|
true, //
|
||||||
|
@ -85,8 +85,8 @@ pub struct KeysList {
|
|||||||
pub log_tag_commit: GituiKeyEvent,
|
pub log_tag_commit: GituiKeyEvent,
|
||||||
pub log_mark_commit: GituiKeyEvent,
|
pub log_mark_commit: GituiKeyEvent,
|
||||||
pub log_checkout_commit: GituiKeyEvent,
|
pub log_checkout_commit: GituiKeyEvent,
|
||||||
pub log_reset_comit: GituiKeyEvent,
|
pub log_reset_commit: GituiKeyEvent,
|
||||||
pub log_reword_comit: GituiKeyEvent,
|
pub log_reword_commit: GituiKeyEvent,
|
||||||
pub log_find: GituiKeyEvent,
|
pub log_find: GituiKeyEvent,
|
||||||
pub find_commit_sha: GituiKeyEvent,
|
pub find_commit_sha: GituiKeyEvent,
|
||||||
pub commit_amend: GituiKeyEvent,
|
pub commit_amend: GituiKeyEvent,
|
||||||
@ -176,8 +176,8 @@ impl Default for KeysList {
|
|||||||
log_tag_commit: GituiKeyEvent::new(KeyCode::Char('t'), KeyModifiers::empty()),
|
log_tag_commit: GituiKeyEvent::new(KeyCode::Char('t'), KeyModifiers::empty()),
|
||||||
log_mark_commit: GituiKeyEvent::new(KeyCode::Char(' '), KeyModifiers::empty()),
|
log_mark_commit: GituiKeyEvent::new(KeyCode::Char(' '), KeyModifiers::empty()),
|
||||||
log_checkout_commit: GituiKeyEvent { code: KeyCode::Char('S'), modifiers: KeyModifiers::SHIFT },
|
log_checkout_commit: GituiKeyEvent { code: KeyCode::Char('S'), modifiers: KeyModifiers::SHIFT },
|
||||||
log_reset_comit: GituiKeyEvent { code: KeyCode::Char('R'), modifiers: KeyModifiers::SHIFT },
|
log_reset_commit: GituiKeyEvent { code: KeyCode::Char('R'), modifiers: KeyModifiers::SHIFT },
|
||||||
log_reword_comit: GituiKeyEvent { code: KeyCode::Char('r'), modifiers: KeyModifiers::empty() },
|
log_reword_commit: GituiKeyEvent { code: KeyCode::Char('r'), modifiers: KeyModifiers::empty() },
|
||||||
log_find: GituiKeyEvent { code: KeyCode::Char('f'), modifiers: KeyModifiers::empty() },
|
log_find: GituiKeyEvent { code: KeyCode::Char('f'), modifiers: KeyModifiers::empty() },
|
||||||
find_commit_sha: GituiKeyEvent::new(KeyCode::Char('j'), KeyModifiers::CONTROL),
|
find_commit_sha: GituiKeyEvent::new(KeyCode::Char('j'), KeyModifiers::CONTROL),
|
||||||
commit_amend: GituiKeyEvent::new(KeyCode::Char('a'), KeyModifiers::CONTROL),
|
commit_amend: GituiKeyEvent::new(KeyCode::Char('a'), KeyModifiers::CONTROL),
|
||||||
|
@ -24,7 +24,7 @@ struct OptionsData {
|
|||||||
pub commit_msgs: Vec<String>,
|
pub commit_msgs: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
const COMMIT_MSG_HISTRY_LENGTH: usize = 20;
|
const COMMIT_MSG_HISTORY_LENGTH: usize = 20;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
@ -109,7 +109,8 @@ impl Options {
|
|||||||
|
|
||||||
pub fn add_commit_msg(&mut self, msg: &str) {
|
pub fn add_commit_msg(&mut self, msg: &str) {
|
||||||
self.data.commit_msgs.push(msg.to_owned());
|
self.data.commit_msgs.push(msg.to_owned());
|
||||||
while self.data.commit_msgs.len() > COMMIT_MSG_HISTRY_LENGTH {
|
while self.data.commit_msgs.len() > COMMIT_MSG_HISTORY_LENGTH
|
||||||
|
{
|
||||||
self.data.commit_msgs.remove(0);
|
self.data.commit_msgs.remove(0);
|
||||||
}
|
}
|
||||||
self.save();
|
self.save();
|
||||||
|
@ -36,7 +36,7 @@ use std::{
|
|||||||
use super::ExternalEditorPopup;
|
use super::ExternalEditorPopup;
|
||||||
|
|
||||||
enum CommitResult {
|
enum CommitResult {
|
||||||
ComitDone,
|
CommitDone,
|
||||||
Aborted,
|
Aborted,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ impl CommitPopup {
|
|||||||
.as_bytes(),
|
.as_bytes(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
file.write_all(b"\n#\n# Changes to be commited:")?;
|
file.write_all(b"\n#\n# Changes to be committed:")?;
|
||||||
|
|
||||||
for change in changes {
|
for change in changes {
|
||||||
let status_char =
|
let status_char =
|
||||||
@ -218,7 +218,7 @@ impl CommitPopup {
|
|||||||
|
|
||||||
if matches!(
|
if matches!(
|
||||||
self.commit_with_msg(msg)?,
|
self.commit_with_msg(msg)?,
|
||||||
CommitResult::ComitDone
|
CommitResult::CommitDone
|
||||||
) {
|
) {
|
||||||
self.options
|
self.options
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
@ -279,7 +279,7 @@ impl CommitPopup {
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(CommitResult::ComitDone)
|
Ok(CommitResult::CommitDone)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_commit(&self, msg: &str) -> Result<()> {
|
fn do_commit(&self, msg: &str) -> Result<()> {
|
||||||
|
@ -187,7 +187,7 @@ impl FuzzyFindPopup {
|
|||||||
.iter()
|
.iter()
|
||||||
.skip(scroll_skip)
|
.skip(scroll_skip)
|
||||||
.take(height)
|
.take(height)
|
||||||
.map(|(idx, indicies)| {
|
.map(|(idx, indices)| {
|
||||||
let selected = self
|
let selected = self
|
||||||
.selected_index
|
.selected_index
|
||||||
.map_or(false, |index| index == *idx);
|
.map_or(false, |index| index == *idx);
|
||||||
@ -205,7 +205,7 @@ impl FuzzyFindPopup {
|
|||||||
Cow::from(c.to_string()),
|
Cow::from(c.to_string()),
|
||||||
self.theme.text(
|
self.theme.text(
|
||||||
selected,
|
selected,
|
||||||
indicies.contains(
|
indices.contains(
|
||||||
&(c_idx + trim_length),
|
&(c_idx + trim_length),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -245,7 +245,7 @@ impl LogSearchPopupPopup {
|
|||||||
),
|
),
|
||||||
)]),
|
)]),
|
||||||
Line::from(vec![Span::styled(
|
Line::from(vec![Span::styled(
|
||||||
format!("[{x_files}] commited files",),
|
format!("[{x_files}] committed files",),
|
||||||
self.theme.text(
|
self.theme.text(
|
||||||
matches!(
|
matches!(
|
||||||
self.selection,
|
self.selection,
|
||||||
|
@ -318,10 +318,10 @@ impl SubmodulesListPopup {
|
|||||||
|
|
||||||
fn set_selection(&mut self, selection: u16) -> Result<()> {
|
fn set_selection(&mut self, selection: u16) -> Result<()> {
|
||||||
let num_entriess: u16 = self.submodules.len().try_into()?;
|
let num_entriess: u16 = self.submodules.len().try_into()?;
|
||||||
let num_entriess = num_entriess.saturating_sub(1);
|
let num_entries = num_entriess.saturating_sub(1);
|
||||||
|
|
||||||
let selection = if selection > num_entriess {
|
let selection = if selection > num_entries {
|
||||||
num_entriess
|
num_entries
|
||||||
} else {
|
} else {
|
||||||
selection
|
selection
|
||||||
};
|
};
|
||||||
|
@ -83,7 +83,7 @@ impl DrawableComponent for TagListPopup {
|
|||||||
Constraint::Length(10),
|
Constraint::Length(10),
|
||||||
// author width
|
// author width
|
||||||
Constraint::Length(19),
|
Constraint::Length(19),
|
||||||
// attachement
|
// attachment
|
||||||
Constraint::Length(1),
|
Constraint::Length(1),
|
||||||
// commit id
|
// commit id
|
||||||
Constraint::Percentage(100),
|
Constraint::Percentage(100),
|
||||||
@ -443,7 +443,7 @@ impl TagListPopup {
|
|||||||
///
|
///
|
||||||
fn get_row(&self, tag: &TagWithMetadata) -> Row {
|
fn get_row(&self, tag: &TagWithMetadata) -> Row {
|
||||||
const UPSTREAM_SYMBOL: &str = "\u{2191}";
|
const UPSTREAM_SYMBOL: &str = "\u{2191}";
|
||||||
const ATTACHEMENT_SYMBOL: &str = "@";
|
const ATTACHMENT_SYMBOL: &str = "@";
|
||||||
const EMPTY_SYMBOL: &str = " ";
|
const EMPTY_SYMBOL: &str = " ";
|
||||||
|
|
||||||
let is_tag_missing_on_remote = self
|
let is_tag_missing_on_remote = self
|
||||||
@ -462,7 +462,7 @@ impl TagListPopup {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let has_attachement_str = if tag.annotation.is_some() {
|
let has_attachement_str = if tag.annotation.is_some() {
|
||||||
ATTACHEMENT_SYMBOL
|
ATTACHMENT_SYMBOL
|
||||||
} else {
|
} else {
|
||||||
EMPTY_SYMBOL
|
EMPTY_SYMBOL
|
||||||
};
|
};
|
||||||
|
@ -1356,7 +1356,7 @@ pub mod commands {
|
|||||||
CommandText::new(
|
CommandText::new(
|
||||||
format!(
|
format!(
|
||||||
"Reset [{}]",
|
"Reset [{}]",
|
||||||
key_config.get_hint(key_config.keys.log_reset_comit),
|
key_config.get_hint(key_config.keys.log_reset_commit),
|
||||||
),
|
),
|
||||||
"reset to commit",
|
"reset to commit",
|
||||||
CMD_GROUP_LOG,
|
CMD_GROUP_LOG,
|
||||||
@ -1368,7 +1368,8 @@ pub mod commands {
|
|||||||
CommandText::new(
|
CommandText::new(
|
||||||
format!(
|
format!(
|
||||||
"Reword [{}]",
|
"Reword [{}]",
|
||||||
key_config.get_hint(key_config.keys.log_reword_comit),
|
key_config
|
||||||
|
.get_hint(key_config.keys.log_reword_commit),
|
||||||
),
|
),
|
||||||
"reword commit message",
|
"reword commit message",
|
||||||
CMD_GROUP_LOG,
|
CMD_GROUP_LOG,
|
||||||
|
@ -542,7 +542,7 @@ impl Component for Revlog {
|
|||||||
return Ok(EventState::Consumed);
|
return Ok(EventState::Consumed);
|
||||||
} else if key_match(
|
} else if key_match(
|
||||||
k,
|
k,
|
||||||
self.key_config.keys.log_reset_comit,
|
self.key_config.keys.log_reset_commit,
|
||||||
) && !self.is_search_pending()
|
) && !self.is_search_pending()
|
||||||
{
|
{
|
||||||
return self.selected_commit().map_or(
|
return self.selected_commit().map_or(
|
||||||
@ -556,7 +556,7 @@ impl Component for Revlog {
|
|||||||
);
|
);
|
||||||
} else if key_match(
|
} else if key_match(
|
||||||
k,
|
k,
|
||||||
self.key_config.keys.log_reword_comit,
|
self.key_config.keys.log_reword_commit,
|
||||||
) && !self.is_search_pending()
|
) && !self.is_search_pending()
|
||||||
{
|
{
|
||||||
return self.selected_commit().map_or(
|
return self.selected_commit().map_or(
|
||||||
|
@ -311,8 +311,8 @@ impl Status {
|
|||||||
|
|
||||||
fn can_focus_diff(&self) -> bool {
|
fn can_focus_diff(&self) -> bool {
|
||||||
match self.focus {
|
match self.focus {
|
||||||
Focus::WorkDir => self.index_wd.is_file_seleted(),
|
Focus::WorkDir => self.index_wd.is_file_selected(),
|
||||||
Focus::Stage => self.index.is_file_seleted(),
|
Focus::Stage => self.index.is_file_selected(),
|
||||||
Focus::Diff => false,
|
Focus::Diff => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ pub struct LineTruncator<'a, 'b> {
|
|||||||
symbols: &'b mut dyn Iterator<Item = StyledGrapheme<'a>>,
|
symbols: &'b mut dyn Iterator<Item = StyledGrapheme<'a>>,
|
||||||
max_line_width: u16,
|
max_line_width: u16,
|
||||||
current_line: Vec<StyledGrapheme<'a>>,
|
current_line: Vec<StyledGrapheme<'a>>,
|
||||||
/// Record the offet to skip render
|
/// Record the offset to skip render
|
||||||
horizontal_offset: u16,
|
horizontal_offset: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ mod test {
|
|||||||
assert_eq!(line_truncator, vec![" "]);
|
assert_eq!(line_truncator, vec![" "]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tests an input starting with a letter, folowed by spaces - some of the behaviour is
|
/// Tests an input starting with a letter, followed by spaces - some of the behaviour is
|
||||||
/// incidental.
|
/// incidental.
|
||||||
#[test]
|
#[test]
|
||||||
fn line_composer_char_plus_lots_of_spaces() {
|
fn line_composer_char_plus_lots_of_spaces() {
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
# configuration for https://github.com/crate-ci/typos
|
||||||
|
|
||||||
|
[default.extend-words]
|
||||||
|
ratatui = "ratatui"
|
||||||
|
syntact = "syntact"
|
||||||
|
|
||||||
|
[files]
|
||||||
|
extend-exclude = ["CHANGELOG.md"]
|
@ -175,7 +175,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Uncomment the next `WixVaraible` tag to customize the installer's
|
Uncomment the next `WixVariable` tag to customize the installer's
|
||||||
Graphical User Interface (GUI) and add a custom banner image across
|
Graphical User Interface (GUI) and add a custom banner image across
|
||||||
the top of each screen. See the WiX Toolset documentation for details
|
the top of each screen. See the WiX Toolset documentation for details
|
||||||
about customization.
|
about customization.
|
||||||
|
Loading…
Reference in New Issue
Block a user