From bf05b246a93dc5bce3ea9186bb9a2a87cc6acec0 Mon Sep 17 00:00:00 2001 From: Auca Coyan Date: Mon, 27 Jan 2025 00:02:00 -0300 Subject: [PATCH 1/2] :sparkles: unsort the completions in `git checkout` --- custom-completions/git/git-completions.nu | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/custom-completions/git/git-completions.nu b/custom-completions/git/git-completions.nu index f0f74c61..d80d5246 100644 --- a/custom-completions/git/git-completions.nu +++ b/custom-completions/git/git-completions.nu @@ -53,7 +53,7 @@ def "nu-complete git switch" [] { } def "nu-complete git checkout" [] { - (nu-complete git local branches) + let table_of_checkouts = (nu-complete git local branches) | parse "{value}" | insert description "local branch" | append (nu-complete git remote branches nonlocal without prefix @@ -64,7 +64,15 @@ def "nu-complete git checkout" [] { | insert description "remote branch") | append (nu-complete git files | where description != "Untracked" | select value | insert description "git file") | append (nu-complete git commits all) - | append (nu-complete git files | where description != "Untracked" | select value) + + return { + options: { + case_sensitive: false, + completion_algorithm: prefix, + sort: false, + }, + completions: $table_of_checkouts + } } # Arguments to `git rebase --onto ` @@ -125,7 +133,7 @@ def "nu-complete git files" [] { def "nu-complete git built-in-refs" [] { [HEAD FETCH_HEAD ORIG_HEAD] } - +# def "nu-complete git refs" [] { nu-complete git local branches | parse "{value}" From 6c8311a121c5e391e124fa6ef344c91f0f0f9cae Mon Sep 17 00:00:00 2001 From: Auca Coyan Date: Mon, 27 Jan 2025 00:11:47 -0300 Subject: [PATCH 2/2] :pencil2: delete unused comment --- custom-completions/git/git-completions.nu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-completions/git/git-completions.nu b/custom-completions/git/git-completions.nu index d80d5246..a933206a 100644 --- a/custom-completions/git/git-completions.nu +++ b/custom-completions/git/git-completions.nu @@ -133,7 +133,7 @@ def "nu-complete git files" [] { def "nu-complete git built-in-refs" [] { [HEAD FETCH_HEAD ORIG_HEAD] } -# + def "nu-complete git refs" [] { nu-complete git local branches | parse "{value}"