diff options
Diffstat (limited to 'src/features/line_numbers.rs')
-rw-r--r-- | src/features/line_numbers.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/features/line_numbers.rs b/src/features/line_numbers.rs index f80b02df..88850434 100644 --- a/src/features/line_numbers.rs +++ b/src/features/line_numbers.rs @@ -12,6 +12,7 @@ use crate::features::OptionValueFunction; use crate::format::{self, Align, Placeholder}; use crate::minusplus::*; use crate::style::Style; +use crate::utils; pub fn make_feature() -> Vec<(String, OptionValueFunction)> { builtin_feature!([ @@ -304,9 +305,13 @@ fn format_line_number( let pad = |n| format::pad(n, width, alignment, precision); match (line_number, config.hyperlinks, plus_file) { (None, _, _) => " ".repeat(width), - (Some(n), true, Some(file)) => { - hyperlinks::format_osc8_file_hyperlink(file, line_number, &pad(n), config).to_string() - } + (Some(n), true, Some(file)) => match utils::path::absolute_path(file, config) { + Some(absolute_path) => { + hyperlinks::format_osc8_file_hyperlink(absolute_path, line_number, &pad(n), config) + .to_string() + } + None => file.to_owned(), + }, (Some(n), _, _) => pad(n), } } |