Skip to content

Commit d1a6a23

Browse files
committedFeb 20, 2025·
Support path splitting on Windows as well
By using `filepath` instead of `path`. `filepath` should work on Windows. Fixes #269.
1 parent dab437c commit d1a6a23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎m/reader.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"fmt"
88
"io"
99
"os"
10-
"path"
10+
"path/filepath"
1111
"runtime/debug"
1212
"strings"
1313
"sync"
@@ -641,7 +641,7 @@ func highlightFromMemory(reader *Reader, formatter chroma.Formatter, options Rea
641641
func (reader *Reader) createStatusUnlocked(lastLine linenumbers.LineNumber) string {
642642
prefix := ""
643643
if reader.name != nil {
644-
prefix = path.Base(*reader.name) + ": "
644+
prefix = filepath.Base(*reader.name) + ": "
645645
}
646646

647647
if len(reader.lines) == 0 {

0 commit comments

Comments
 (0)
Please sign in to comment.