-
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.
Put a border around the diff type header created using ASCII art to make it stand out more. Pass --no-prefix to git diff to slightly shorten the diff header.
- Loading branch information
Showing
4 changed files
with
21 additions
and
7 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
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,6 +1,16 @@ | ||
# helper for _fzf_preview_changed_file | ||
function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header." | ||
set_color --underline yellow | ||
echo -e === $diff_type ===\n | ||
# prints out something like | ||
# +--------+ | ||
# | 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_color yellow | ||
echo $horizontal_border | ||
echo "| $diff_type |" | ||
echo $horizontal_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
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