Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions custom-completions/git/git-completions.nu
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ def "nu-complete git files" [path?: string] {
| first 300 # limit the number of data for performance
| each { |$it|
if $it starts-with "1 " {
$it | parse --regex "1 (?P<short_status>\\S+) (?:\\S+\\s?){6} (?P<value>\\S+)"
$it | parse --regex "1 (?P<short_status>\\S+) (?:\\S+\\s?){6} (?P<value>.+)"
} else if $it starts-with "2 " {
$it | parse --regex "2 (?P<short_status>\\S+) (?:\\S+\\s?){6} (?P<value>\\S+)"
$it | parse --regex "2 (?P<short_status>\\S+) (?:\\S+\\s?){6} (?P<value>.+)"
} else if $it starts-with "u " {
$it | parse --regex "u (?P<short_status>\\S+) (?:\\S+\\s?){8} (?P<value>\\S+)"
$it | parse --regex "u (?P<short_status>\\S+) (?:\\S+\\s?){8} (?P<value>.+)"
} else if $it starts-with "? " {
$it | parse --regex "(?P<short_status>.{1}) (?P<value>.+)"
} else {
Expand All @@ -251,6 +251,7 @@ def "nu-complete git files" [path?: string] {
}
| flatten
| where $it.short_status in $relevant_statuses
| update value { |row| if ($row.value | str contains " ") { $"`($row.value)`" } else { $row.value } }
| insert "description" { |e| $short_status_descriptions | get $e.short_status}
}

Expand Down
Loading