diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-07-18 15:34:43 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-07-22 17:57:57 -0400 |
commit | b2257cfae7eacc73e47299d90d9a8d479b3e362c (patch) | |
tree | 56b60ad41ce689042ce64c4793eec35100d8c322 /src/options | |
parent | 29bf022218f72157e1921412ae6ede598733b6fb (diff) |
Format files and commits as OSC 8 hyperlinks
Closes #257
Diffstat (limited to 'src/options')
-rw-r--r-- | src/options/set.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/options/set.rs b/src/options/set.rs index 8d52938d..6be35bf6 100644 --- a/src/options/set.rs +++ b/src/options/set.rs @@ -127,6 +127,8 @@ pub fn set_options( file_style, hunk_header_decoration_style, hunk_header_style, + hyperlinks, + hyperlinks_file_link_format, keep_plus_minus_markers, max_line_distance, // Hack: minus-style must come before minus-*emph-style because the latter default @@ -296,6 +298,9 @@ fn gather_features<'a>( if opt.diff_so_fancy { gather_builtin_features_recursively("diff-so-fancy", &mut features, &builtin_features, opt); } + if opt.hyperlinks { + gather_builtin_features_recursively("hyperlinks", &mut features, &builtin_features, opt); + } if opt.line_numbers { gather_builtin_features_recursively("line-numbers", &mut features, &builtin_features, opt); } @@ -523,6 +528,15 @@ fn set_git_config_entries(opt: &mut cli::Opt, git_config: &mut git_config::GitCo } } } + + if let Some(repo) = &git_config.repo { + if let Some(workdir) = repo.workdir() { + opt.git_config_entries.insert( + "delta.__workdir__".to_string(), + GitConfigEntry::Path(workdir.to_path_buf()), + ); + } + } } #[cfg(test)] |