Skip to content

Commit 9191df8

Browse files
committed
test: Adapt findBuffer() to use the buffers AbsPath and resolve symlinks
1 parent 8b3e5ea commit 9191df8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/micro/micro_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"log"
66
"os"
7+
"path/filepath"
78
"testing"
89

910
"github.com/go-errors/errors"
@@ -157,8 +158,10 @@ func openFile(file string) {
157158

158159
func findBuffer(file string) *buffer.Buffer {
159160
var buf *buffer.Buffer
161+
file, _ = filepath.EvalSymlinks(file)
162+
file, _ = filepath.Abs(file)
160163
for _, b := range buffer.OpenBuffers {
161-
if b.Path == file {
164+
if b.AbsPath == file {
162165
buf = b
163166
}
164167
}

0 commit comments

Comments
 (0)