Skip to content

Commit 769e292

Browse files
committed
fix: Make the help text copyable
1 parent 1fa9dc0 commit 769e292

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/app.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,25 +218,27 @@ impl App {
218218
*/
219219
pub fn show_help_message(&mut self, kernel_modules: &mut KernelModules<'_>) {
220220
let key_bindings: Vec<(&str, &str)> = util::KEY_BINDINGS.to_vec();
221-
222221
let mut help_text = Vec::new();
222+
let mut help_text_raw = Vec::new();
223223
for (key, desc) in &key_bindings {
224224
help_text.push(Spans::from(Span::styled(
225-
format!("{}:", key),
225+
format!("{}:", &key),
226226
self.style.colored,
227227
)));
228+
help_text_raw.push(format!("{}:", key));
228229
help_text.push(Spans::from(Span::styled(
229-
format!("{}{}", self.style.unicode.get(Symbol::Blank), desc),
230+
format!("{}{}", self.style.unicode.get(Symbol::Blank), &desc),
230231
self.style.default,
231232
)));
233+
help_text_raw.push(format!(" {}", &desc));
232234
}
233235
kernel_modules.info_scroll_offset = 0;
234236
kernel_modules.command = ModuleCommand::None;
235237
kernel_modules.current_name =
236238
format!("!Help{}", self.style.unicode.get(Symbol::Helmet));
237239
kernel_modules
238240
.current_info
239-
.set(Text::from(help_text), kernel_modules.current_name.clone());
241+
.set(Text::from(help_text), help_text_raw.join("\n"));
240242
}
241243

242244
/**

0 commit comments

Comments
 (0)