Skip to content

Commit 5c35546

Browse files
committed
File link in the list? No problem :D
1 parent d1571d1 commit 5c35546

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/list/state.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ use std::{
1010
io::{self, StdoutLock, Write},
1111
};
1212

13-
use crate::{app_state::AppState, exercise::Exercise, term::progress_bar, MAX_EXERCISE_NAME_LEN};
13+
use crate::{
14+
app_state::AppState,
15+
exercise::Exercise,
16+
term::{progress_bar, terminal_file_link},
17+
MAX_EXERCISE_NAME_LEN,
18+
};
1419

1520
const MAX_SCROLL_PADDING: usize = 5;
1621
// +1 for column padding.
@@ -190,7 +195,7 @@ impl<'a> ListState<'a> {
190195
stdout.write_all(exercise.name.as_bytes())?;
191196
stdout.write_all(&SPACE[..self.name_col_width + 2 - exercise.name.len()])?;
192197

193-
stdout.write_all(exercise.path.as_bytes())?;
198+
terminal_file_link(stdout, exercise.path, Color::Blue)?;
194199

195200
next_ln_overwrite(stdout)?;
196201
stdout.queue(ResetColor)?;

0 commit comments

Comments
 (0)