]> git.rmz.io Git - dotfiles.git/commitdiff
zsh/prompt: handle intend-to-add status properly
authorSamir Benmendil <me@rmz.io>
Tue, 7 Dec 2021 13:47:33 +0000 (13:47 +0000)
committerSamir Benmendil <me@rmz.io>
Thu, 9 Dec 2021 14:20:10 +0000 (14:20 +0000)
It used to make the markers for the files dissappear entirely, with this
change the files that are added with `--intend-to-add` are marked as
both added(+) and modified(*).

zsh/lib/prompt.zsh

index a1be82b931f4c2207fad384b7dc63c7246471977..56d702b67f4e9b278fbd420263e6205baaa25068 100644 (file)
@@ -62,6 +62,7 @@ git_prompt_status() {
       [[ "$line" == 2\ R[.MTD]\ * ]]      && (( renamed++ ))
 
       # work tree
+      [[ "$line" == 1\ [.MARCT]A\ * ]]    && (( added++ , modified++ ))  # intend-to-add
       [[ "$line" == 1\ [.MARCT]M\ * ]]    && (( modified++ ))
       [[ "$line" == 1\ [.MARCT]D\ * ]]    && (( deleted_wt++ ))
       [[ "$line" == \?\ * ]]              && (( untracked++ ))