summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2023-12-27 09:52:53 +0100
committerSebastian Thiel <sebastian.thiel@icloud.com>2023-12-27 09:52:53 +0100
commit0a0dfe65c4a7bd8851841edf488296966ba27bf0 (patch)
treee213edfc1ad503f2924b78c7793a2167ee32401f
parentc9738265c40598f0a79befc8dd7be0d47a9f8179 (diff)
parent20e85c1ebe7ce3a5254fe2675a52cb5d321f1e34 (diff)
Merge branch 'help-language-consistency'
-rw-r--r--src/aggregate.rs2
-rw-r--r--src/interactive/app/handlers.rs8
-rw-r--r--src/interactive/app/tests/journeys_readonly.rs22
-rw-r--r--src/interactive/app/tests/journeys_with_writes.rs4
-rw-r--r--src/interactive/widgets/footer.rs2
-rw-r--r--src/interactive/widgets/help.rs72
6 files changed, 57 insertions, 53 deletions
diff --git a/src/aggregate.rs b/src/aggregate.rs
index 895282f..f867247 100644
--- a/src/aggregate.rs
+++ b/src/aggregate.rs
@@ -44,7 +44,7 @@ pub fn aggregate(
stats.entries_traversed += 1;
progress.throttled(|| {
if let Some(err) = err.as_mut() {
- write!(err, "Enumerating {} entries\r", stats.entries_traversed).ok();
+ write!(err, "Enumerating {} items\r", stats.entries_traversed).ok();
}
});
match entry {
diff --git a/src/interactive/app/handlers.rs b/src/interactive/app/handlers.rs
index 6e12c3d..6d5a7dd 100644
--- a/src/interactive/app/handlers.rs
+++ b/src/interactive/app/handlers.rs
@@ -207,7 +207,7 @@ impl AppState {
window.mark_pane = match res {
Some((pane, mode)) => match mode {
Some(MarkMode::Delete) => {
- self.message = Some("Deleting entries...".to_string());
+ self.message = Some("Deleting items...".to_string());
let mut entries_deleted = 0;
let res = pane.iterate_deletable_items(|mut pane, entry_to_delete| {
window.mark_pane = Some(pane);
@@ -217,7 +217,7 @@ impl AppState {
Ok(ed) => {
entries_deleted += ed;
self.message =
- Some(format!("Deleted {} entries...", entries_deleted));
+ Some(format!("Deleted {} items...", entries_deleted));
Ok(pane)
}
Err(c) => Err((pane, c)),
@@ -228,7 +228,7 @@ impl AppState {
}
#[cfg(feature = "trash-move")]
Some(MarkMode::Trash) => {
- self.message = Some("Trashing entries...".to_string());
+ self.message = Some("Trashing items...".to_string());
let mut entries_trashed = 0;
let res = pane.iterate_deletable_items(|mut pane, entry_to_trash| {
window.mark_pane = Some(pane);
@@ -238,7 +238,7 @@ impl AppState {
Ok(ed) => {
entries_trashed += ed;
self.message =
- Some(format!("Trashed {} entries...", entries_trashed));
+ Some(format!("Trashed {} items...", entries_trashed));
Ok(pane)
}
Err(c) => Err((pane, c)),
diff --git a/src/interactive/app/tests/journeys_readonly.rs b/src/interactive/app/tests/journeys_readonly.rs
index 6781508..28e0529 100644
--- a/src/interactive/app/tests/journeys_readonly.rs
+++ b/src/interactive/app/tests/journeys_readonly.rs
@@ -36,7 +36,7 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
app.state.sorting,
SortMode::SizeDescending,
- "it will sort entries in descending order by size"
+ "it will sort items in descending order by size"
);
assert!(
@@ -97,7 +97,7 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
node_by_index(&app, app.state.entries[0].index),
node_by_name(&app, fixture_str(long_root)),
- "it recomputes the cached entries"
+ "it recomputes the cached items"
);
// when hitting the S key
app.process_events(&mut terminal, into_codes("s"))?;
@@ -109,7 +109,7 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
node_by_index(&app, app.state.entries[1].index),
node_by_name(&app, fixture_str(long_root)),
- "it recomputes the cached entries"
+ "it recomputes the cached items"
);
// when hitting the S key again
app.process_events(&mut terminal, into_codes("s"))?;
@@ -125,7 +125,7 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
node_by_index(&app, app.state.entries[0].index),
node_by_name(&app, fixture_str(short_root)),
- "it recomputes the cached entries"
+ "it recomputes the cached items"
);
}
@@ -136,7 +136,7 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
node_by_name(&app, fixture_str(long_root)),
node_by_index(&app, *app.state.navigation().selected.as_ref().unwrap()),
- "it moves the cursor down and selects the next entry based on the current sort mode"
+ "it moves the cursor down and selects the next item based on the current sort mode"
);
// when hitting it while there is nowhere to go
app.process_events(&mut terminal, into_codes("j"))?;
@@ -150,7 +150,7 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
node_by_name(&app, fixture_str(short_root)),
node_by_index(&app, *app.state.navigation().selected.as_ref().unwrap()),
- "it moves the cursor up and selects the next entry based on the current sort mode"
+ "it moves the cursor up and selects the next item based on the current sort mode"
);
// when hitting the k key again
app.process_events(&mut terminal, into_codes("k"))?;
@@ -166,12 +166,12 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
new_root_idx,
app.state.navigation().view_root,
- "it enters the entry if it is a directory, changing the root"
+ "it enters the item if it is a directory, changing the root"
);
assert_eq!(
index_by_name(&app, "dir"),
*app.state.navigation().selected.as_ref().unwrap(),
- "it selects the first entry in the directory"
+ "it selects the first item in the directory"
);
// when hitting the u key while inside a sub-directory
@@ -185,7 +185,7 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
node_by_name(&app, fixture_str(short_root)),
node_by_index(&app, *app.state.navigation().selected.as_ref().unwrap()),
- "changes the selection to the first item in the list of entries"
+ "changes the selection to the first item in the list of items"
);
}
}
@@ -255,14 +255,14 @@ fn simple_user_journey_read_only() -> Result<()> {
assert_eq!(
Some(1),
app.window.mark_pane.as_ref().map(|p| p.marked().len()),
- "it toggled the previous selected entry off",
+ "it toggled the previous selected item off",
);
assert!(
app.window.mark_pane.as_ref().map_or(false, |p| p
.marked()
.contains_key(&previously_selected_index)),
- "it leaves the first selected entry marked"
+ "it leaves the first selected item marked"
);
}
// when hitting the spacebar (after moving up to the first entry)
diff --git a/src/interactive/app/tests/journeys_with_writes.rs b/src/interactive/app/tests/journeys_with_writes.rs
index 9a941e6..80e65d7 100644
--- a/src/interactive/app/tests/journeys_with_writes.rs
+++ b/src/interactive/app/tests/journeys_with_writes.rs
@@ -18,7 +18,7 @@ fn basic_user_journey_with_deletion() -> Result<()> {
assert_eq!(
app.window.mark_pane.as_ref().map(|p| p.marked().len()),
Some(4),
- "expecting 4 selected entries, the parent dir, and some children"
+ "expecting 4 selected items, the parent dir, and some children"
);
assert!(fixture.as_ref().is_dir(), "expecting fixture root to exist");
@@ -34,7 +34,7 @@ fn basic_user_journey_with_deletion() -> Result<()> {
)?;
assert!(
app.window.mark_pane.is_none(),
- "the marker pane is gone as all entries have been removed"
+ "the marker pane is gone as all items have been removed"
);
assert_eq!(
app.state.navigation().selected,
diff --git a/src/interactive/widgets/footer.rs b/src/interactive/widgets/footer.rs
index 892ff4d..a91fdb6 100644
--- a/src/interactive/widgets/footer.rs
+++ b/src/interactive/widgets/footer.rs
@@ -37,7 +37,7 @@ impl Footer {
let spans = vec![
Span::from(format!(
- "Sort mode: {} Total disk usage: {} Entries: {} {progress} ",
+ "Sort mode: {} Total disk usage: {} Items: {} {progress} ",
match sort_mode {
SortMode::SizeAscending => "size ascending",
SortMode::SizeDescending => "size descending",
diff --git a/src/interactive/widgets/help.rs b/src/interactive/widgets/help.rs
index 092fb00..52948da 100644
--- a/src/interactive/widgets/help.rs
+++ b/src/interactive/widgets/help.rs
@@ -106,105 +106,109 @@ impl HelpPane {
}
};
- title("Keys for pane control");
+ title("Pane control");
{
hotkey(
"q/<Esc>",
- "Close the current pane. Closes the program if no",
- Some("pane is open"),
+ "Close the current pane.",
+ Some("Closes the program if no pane is open."),
);
hotkey(
"<Tab>",
"Cycle between all open panes.",
Some("Activate 'Marked Items' pane to delete selected files."),
);
- hotkey("?", "Show or hide the help pane", None);
+ hotkey("?", "Show or hide this help pane.", None);
spacer();
}
- title("Keys for Navigation");
+ title("Navigation");
{
- hotkey("j/<Down>", "move down an entry", None);
- hotkey("k/<Up>", "move up an entry", None);
- hotkey("o/l/<Enter>", "descent into the selected directory", None);
+ hotkey("j/<Down>", "Move down 1 item.", None);
+ hotkey("k/<Up>", "Move up 1 item.", None);
+ hotkey("o/l/<Enter>", "Descent into the selected directory.", None);
hotkey("<Right>", "^", None);
hotkey(
"u/h/<Left>",
- "ascent one level into the parent directory",
+ "Ascent one level into the parent directory.",
None,
);
hotkey("<Backspace>", "^", None);
- hotkey("Ctrl + d", "move down 10 entries at once", None);
+ hotkey("Ctrl + d", "Move down 10 items.", None);
hotkey("<Page Down>", "^", None);
- hotkey("Ctrl + u", "move up 10 entries at once", None);
+ hotkey("Ctrl + u", "Move up 10 items.", None);
hotkey("<Page Up>", "^", None);
- hotkey("H/<Home>", "Move to the top of the entries list", None);
- hotkey("G/<End>", "Move to the bottom of the entries list", None);
+ hotkey("H/<Home>", "Move to the top of the list.", None);
+ hotkey("G/<End>", "Move to the bottom of the list.", None);
spacer();
}
- title("Keys for display");
+ title("Display");
{
- hotkey("s", "toggle sort by size ascending/descending", None);
- hotkey("m", "toggle sort by mtime ascending/descending", None);
- hotkey("c", "toggle sort by items ascending/descending", None);
+ hotkey("s", "Toggle sort by size descending/ascending.", None);
+ hotkey(
+ "m",
+ "Toggle sort by modified time descending/ascending.",
+ None,
+ );
+ hotkey("c", "Toggle sort by items descending/ascending.", None);
hotkey(
"g",
- "cycle through percentage display and bar options",
+ "Cycle through percentage display and bar options.",
None,
);
spacer();
}
- title("Keys for entry operations");
+ title("Open/Mark/Search");
{
hotkey(
"Shift + o",
- "Open the entry with the associated program",
+ "Open the selected item with the associated program.",
None,
);
hotkey(
"d",
- "Toggle the currently selected entry and move down",
+ "Toggle the currently selected item and move down.",
None,
);
hotkey(
"x",
- "Mark the currently selected entry for deletion and move down",
+ "Mark the currently selected item for deletion and move down.",
None,
);
- hotkey("<Space>", "Toggle the currently selected entry", None);
- hotkey("a", "Toggle all entries", None);
+ hotkey("<Space>", "Toggle the currently selected item.", None);
+ hotkey("a", "Toggle all items.", None);
hotkey(
"/",
- "Git-style glob search, case-insensitive, always from the top of the tree",
- None,
+ "Git-style glob search, case-insensitive.",
+ Some("Search starts from the current directory."),
);
spacer();
}
- title("Keys in the Mark pane");
+ title("Mark items pane");
{
hotkey(
"x/d/<Space>",
- "Remove the selected entry from the list",
+ "Remove the selected item from the list.",
None,
);
- hotkey("a", "Remove all entries from the list", None);
+ hotkey("a", "Remove all items from the list.", None);
hotkey(
"Ctrl + r",
- "Permanently delete all marked entries without prompt!",
+ "Permanently delete all marked items without prompt.",
Some("This operation cannot be undone!"),
);
#[cfg(feature = "trash-move")]
hotkey(
"Ctrl + t",
- "Move all marked entries to the trash bin",
- Some("The entries can be restored from the trash bin"),
+ "Move all marked items to the trash bin.",
+ Some("The items can be restored from the trash bin."),
);
spacer();
}
- title("Keys for application control");
+ title("Application control");
{
hotkey(
"Ctrl + c",
- "close the application. No questions asked!",
+ "Close the application. No questions asked!",
None,
);
spacer();