fix(cd): harden zoxide directory suggestions
This commit is contained in:
+2
-5
@@ -13,11 +13,8 @@ func init() {
|
||||
Description: "change directory",
|
||||
MaxArgs: 0,
|
||||
Generator: func(tokens []string, prefix string, partial string) []spec.Suggestion {
|
||||
// The file generator only reads the current directory, so `cd proj`
|
||||
// comes back empty unless its parent is where you already are --
|
||||
// which is not how cd is typically used. zoxide.extend-cd folds in
|
||||
// the frecency database that `z` already queries, making any
|
||||
// directory zoxide has seen reachable by name from anywhere.
|
||||
// Extend cd with zoxide's frecency database while keeping local
|
||||
// filesystem suggestions first.
|
||||
if config.Get().Zoxide.ExtendCd {
|
||||
return ZoxideGenerator()(tokens, prefix, partial)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user