fix: avoid passing .git directories to on-load (#2382)
* fix: avoid passing `.git` directories to `on-load` * docs: update `CHANGELOG.md`
This commit is contained in:
1 parent
3a0b538d8b
commit
4b8281ea86
2 files changed
+11
-4
No files matched your search
@@ -414,11 +414,17 @@ func (app *app) loop() {
|
||||
|
||||
app.watchDir(d)
|
||||
|
||||
paths := []string{}
|
||||
for _, file := range d.allFiles {
|
||||
paths = append(paths, file.path)
|
||||
// Avoid flickering UI and multiple, unnecessary `on-load` calls
|
||||
// triggered by Git commands executed inside the users `on-load`
|
||||
// command (often used to add git symbols using `addcustominfo`).
|
||||
// TODO: Should `watch` also ignore `.git` directories?
|
||||
if filepath.Base(d.path) != ".git" {
|
||||
paths := make([]string, len(d.allFiles))
|
||||
for i, file := range d.allFiles {
|
||||
paths[i] = file.path
|
||||
}
|
||||
onLoad(app, paths)
|
||||
}
|
||||
onLoad(app, paths)
|
||||
|
||||
if d.path == app.nav.currDir().path {
|
||||
app.nav.preload()
|
||||
|
||||
Reference in new issue
Block a user