From b76d2546e18f35b0bc440d7eed20a512679b30a8 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sat, 14 Jun 2025 07:47:32 +0800 Subject: [PATCH] Fix typos (#2008) Found via `typos --hidden --format brief` --- app.go | 6 +++--- etc/lfcd.nu | 2 +- misc.go | 2 +- nav.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app.go b/app.go index 04fb9f6d..fb326650 100644 --- a/app.go +++ b/app.go @@ -466,14 +466,14 @@ func (app *app) loop() { } app.ui.draw(app.nav) case path := <-app.nav.delChan: - deletePathRecusrive(app.nav.selections, path) + deletePathRecursive(app.nav.selections, path) if len(app.nav.selections) == 0 { app.nav.selectionInd = 0 } - deletePathRecusrive(app.nav.regCache, path) + deletePathRecursive(app.nav.regCache, path) - deletePathRecusrive(app.nav.dirCache, path) + deletePathRecursive(app.nav.dirCache, path) currPath := app.nav.currDir().path if currPath == path || strings.HasPrefix(currPath, path+string(filepath.Separator)) { if wd, err := os.Getwd(); err == nil { diff --git a/etc/lfcd.nu b/etc/lfcd.nu index 5f7bf637..ed481282 100644 --- a/etc/lfcd.nu +++ b/etc/lfcd.nu @@ -1,6 +1,6 @@ # Change working dir in shell to last dir in lf on exit (adapted from ranger). # -# You need to add this to your Nushell Enviroment Config File +# You need to add this to your Nushell Environment Config File # (Execute 'config env' in the nushell to open it). # You may also like to assign a key (Ctrl-O) to this command: diff --git a/misc.go b/misc.go index d93e03cf..11263dce 100644 --- a/misc.go +++ b/misc.go @@ -381,7 +381,7 @@ func makeCollator(localeStr string, opts ...collate.Option) (*collate.Collator, // This function deletes entries from a map if the key is either the given path // or a subpath of it. // This is useful for clearing cached data when a directory is moved or deleted. -func deletePathRecusrive[T any](m map[string]T, path string) { +func deletePathRecursive[T any](m map[string]T, path string) { delete(m, path) prefix := path + string(filepath.Separator) for k := range m { diff --git a/nav.go b/nav.go index fd1a60c9..f2a30a2e 100644 --- a/nav.go +++ b/nav.go @@ -1488,8 +1488,8 @@ func (nav *nav) rename() error { // existed and was deleted. In this case the cache entries should be deleted // before loading newPath to prevent displaying a stale preview. However, // this clears only the current instance of lf, and not any other instances. - deletePathRecusrive(nav.regCache, newPath) - deletePathRecusrive(nav.dirCache, newPath) + deletePathRecursive(nav.regCache, newPath) + deletePathRecursive(nav.dirCache, newPath) dir := nav.loadDir(filepath.Dir(newPath)) if dir.loading {