Fix duplicated words in tips and plugin comment (#5677)

* Fix duplicated words in tips and a comment

* Use color_substring helpers for the Ctrl o tip

* Use substring helpers for the remaining tip highlights

---------

Co-authored-by: GhostCoder6969 <[email protected]>
This commit is contained in:
GhostCoder6969
2026-10-04 18:40:05 +02:00
committed by GitHub
co-authored by GhostCoder6969
parent ef497e1ae3
commit 4ba55d7248
2 changed files with 15 additions and 13 deletions
+14 -12
View File
@@ -553,12 +553,13 @@ impl Page {
)
.with_paragraph(vec![ComponentLine::new(vec![ActiveComponent::new(
TextOrCustomRender::Text(match *base_mode.borrow() {
InputMode::Locked => Text::from("Check it out with with: Ctrl g + o + w")
.color_range(3, 24..=29)
.color_indices(3, vec![33, 37]),
_ => Text::from("Check it out with with: Ctrl o + w")
.color_range(3, 24..=29)
.color_indices(3, vec![33]),
InputMode::Locked => Text::from("Check it out with: Ctrl g + o + w")
.color_substring(3, "Ctrl g")
.color_nth_substring(3, "o", 1)
.color_last_substring(3, "w"),
_ => Text::from("Check it out with: Ctrl o + w")
.color_substring(3, "Ctrl o")
.color_last_substring(3, "w"),
}),
)])])
.with_paragraph(vec![ComponentLine::new(vec![ActiveComponent::new(
@@ -650,14 +651,15 @@ impl Page {
ActiveComponent::new(TextOrCustomRender::Text(
match *base_mode.borrow() {
InputMode::Locked => {
Text::from("Check it out with with: Ctrl g + o + p")
.color_range(3, 24..=29)
.color_indices(3, vec![33, 37])
Text::from("Check it out with: Ctrl g + o + p")
.color_substring(3, "Ctrl g")
.color_nth_substring(3, "o", 1)
.color_last_substring(3, "p")
},
_ => {
Text::from("Check it out with with: Ctrl o + p")
.color_range(3, 24..=29)
.color_indices(3, vec![33])
Text::from("Check it out with: Ctrl o + p")
.color_substring(3, "Ctrl o")
.color_last_substring(3, "p")
}
}
)),
+1 -1
View File
@@ -469,7 +469,7 @@ impl<'a> PluginLoader<'a> {
let dirs = dirs.into_iter().filter(|(_dir_name, dir)| {
// note that this does not protect against TOCTOU errors
// eg. if one or more of these folders existed at the time of check but was deleted
// before we mounted in in the wasi environment, we'll crash
// before we mounted in the wasi environment, we'll crash
// when we move to a new wasi environment, we should address this with locking if
// there's no built-in solution
dir.try_exists().ok().unwrap_or(false)