handle symbolic links to directories for previews

Mentioned in #24 and #25.
This commit is contained in:
Gokcehan 2016-10-05 18:36:12 +03:00
parent 1683cdfd47
commit 1cee8b9d9c

12
ui.go
View File

@ -399,11 +399,19 @@ func (ui *UI) loadFile(nav *Nav) {
path := nav.currPath()
if curr.IsDir() {
f, err := os.Stat(path)
if err != nil {
msg := fmt.Sprintf("getting file information: %s", err)
ui.message = msg
log.Print(msg)
return
}
if f.IsDir() {
dir := newDir(path)
dir.load(nav.inds[path], nav.poss[path], nav.height, nav.names[path])
ui.dirprev = dir
} else if curr.Mode().IsRegular() {
} else if f.Mode().IsRegular() {
var reader io.Reader
if len(gOpts.previewer) != 0 {