Skip to content

Commit 7f3a036

Browse files
committed
use relative paths for rendering fileneames
1 parent 291f99e commit 7f3a036

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/render/function.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ pub fn render(
161161
}
162162
}
163163

164+
let relative_path = path.strip_prefix(&dir_content.parent_dir).unwrap();
164165
if display_to_be_processed_file {
165-
let relative_path = path.strip_prefix(&dir_content.parent_dir).unwrap();
166166
progress.info(format!("{relative_path:?}"))
167167
}
168168
let out = chunk::process(
169-
&path,
169+
&relative_path,
170170
content,
171171
&mut img,
172172
|line| highlighter.highlight_line(line, ss),
@@ -244,13 +244,12 @@ pub fn render(
244244
// create an image that fits one column
245245
let mut img = RgbImage::new(column_width * char_width, img_height);
246246

247+
let relative_path = path.strip_prefix(&dir_content.parent_dir).unwrap();
247248
if display_to_be_processed_file {
248-
let relative_path =
249-
path.strip_prefix(&dir_content.parent_dir).unwrap();
250249
progress.info(format!("{relative_path:?}"))
251250
}
252251
let out = chunk::process(
253-
&path,
252+
&relative_path,
254253
content,
255254
&mut img,
256255
|line| highlighter.highlight_line(line, ss),

0 commit comments

Comments
 (0)