Refactor Nav API around symlinks handling (mostly) (#33)

* gofmt ui.go

* Refactor Nav API around symlinks handling (mostly)

1. Get both `Lstat` and `Stat` while reading the files. Stat info is
   used by default, but we still can tell it's a link if needed.
2. Remove all other `Stat` calls from different places.
3. Handle hidden files while reading.
4. `currFile` now returns error if there are no files.
5. `currEmpty` and `currPath` not longer necessary, removed.
6. `open` now returns a named error ErrNotDir, where expected.

7. Side effect: Links that point at directories are now sorted among
   "actual" directories.
This commit is contained in:
Karol Woźniak authored and gokcehan committed 2016-10-24 22:18:31 +03:00
1 parent 880615ddd0
commit c9b4389c65
4 files changed
+127 -111

No files matched your search

+2 -4
View File
@@ -76,11 +76,9 @@ func (app *App) handleInp() {
}
func (app *App) exportVars() {
dir := app.nav.currDir()
var envFile string
if len(dir.fi) != 0 {
envFile = app.nav.currPath()
if f, err := app.nav.currFile(); err == nil {
envFile = f.Path
}
marks := app.nav.currMarks()