diff --git a/main.go b/main.go index 7d988794..6ec297cb 100644 --- a/main.go +++ b/main.go @@ -349,7 +349,11 @@ Options: if term.IsTerminal(int(os.Stdout.Fd())) { lines := strings.Split(resp, "\n") for i := range lines { - lines[i] = sanitizeName(lines[i]) + cells := strings.Split(lines[i], "\t") + for j := range cells { + cells[j] = sanitizeName(cells[j]) + } + lines[i] = strings.Join(cells, "\t") } resp = strings.Join(lines, "\n") } diff --git a/ui.go b/ui.go index 6e4c2d0e..d9be1b30 100644 --- a/ui.go +++ b/ui.go @@ -1299,6 +1299,9 @@ func listJumps(jumps []string, ind int) string { fmt.Fprintln(t, " jump\tpath") // print jumps in order of most recent, Vim uses the opposite order for i, path := range slices.Backward(jumps) { + if strings.ContainsAny(path, "\n\r\t") { + continue + } switch { case i < ind: fmt.Fprintf(t, " %*d\t%s\n", maxlength, ind-i, path) @@ -1352,7 +1355,7 @@ func listFilesInCurrDir(nav *nav) string { b := new(strings.Builder) for _, file := range dir.files { - if strings.ContainsAny(file.path, "\n\r") { + if strings.ContainsAny(file.path, "\n\r\t") { continue } fmt.Fprintln(b, file.path)