mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-21 07:34:18 +02:00
fix: correct abs to rel path conversion (#683)
This commit is contained in:
parent
51fa19b8b4
commit
f689c90084
1 changed files with 3 additions and 2 deletions
5
ui/ui.go
5
ui/ui.go
|
|
@ -425,8 +425,9 @@ func localFileToMarkdown(cwd string, res gitcha.SearchResult) *markdown {
|
|||
}
|
||||
|
||||
func stripAbsolutePath(fullPath, cwd string) string {
|
||||
path, _ := filepath.Rel(cwd, fullPath)
|
||||
return path
|
||||
fp, _ := filepath.EvalSymlinks(fullPath)
|
||||
cp, _ := filepath.EvalSymlinks(cwd)
|
||||
return strings.ReplaceAll(fp, cp+string(os.PathSeparator), "")
|
||||
}
|
||||
|
||||
// Lightweight version of reflow's indent function.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue