-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search Git Status] use box drawing chars for diff type header (#291)
Make the header box for Git staged/unstaged/merged/etc. look nicer. Old: +--------+ | Staged | +--------+ New: โญโโโโโโโโโฎ โ Staged โ โฐโโโโโโโโโฏ
- Loading branch information
Showing
4 changed files
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
# helper for _fzf_preview_changed_file | ||
# prints out something like | ||
# +--------+ | ||
# | Staged | | ||
# +--------+ | ||
# โญโโโโโโโโโฎ | ||
# โ Staged โ | ||
# โฐโโโโโโโโโฏ | ||
function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header meant to preface a git patch." | ||
# number of "-" to draw is the length of the string to box + 2 for padding | ||
set repeat_count (math 2 + (string length $diff_type)) | ||
set horizontal_border +(string repeat --count $repeat_count -)+ | ||
set line (string repeat --count $repeat_count โ) | ||
set top_border โญ$lineโฎ | ||
set btm_border โฐ$lineโฏ | ||
|
||
set_color yellow | ||
echo $horizontal_border | ||
echo "| $diff_type |" | ||
echo $horizontal_border | ||
echo $top_border | ||
echo "โ $diff_type โ" | ||
echo $btm_border | ||
set_color normal | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
mock git diff "echo \$argv" | ||
set output (_fzf_preview_changed_file " D out.log") | ||
|
||
contains "| Unstaged |" $output && not contains "| Staged |" $output | ||
contains "โ Unstaged โ" $output && not contains "โ Staged โ" $output | ||
@test "only shows unstaged changes if file was only deleted in working tree" $status -eq 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
mock git diff "echo \$argv" | ||
set output (_fzf_preview_changed_file "UU out.log") | ||
|
||
@test "shows merge conflicts as unmerged" $output[2] = "| Unmerged |" | ||
@test "shows merge conflicts as unmerged" $output[2] = "โ Unmerged โ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
mock git diff "echo \$argv" | ||
set output (_fzf_preview_changed_file "MM dir/file.txt") | ||
|
||
contains "| Unstaged |" $output && contains "| Staged |" $output | ||
contains "โ Unstaged โ" $output && contains "โ Staged โ" $output | ||
@test "shows staged and unstaged changes if the file is modified in both places" $status -eq 0 |