Skip to content

Commit

Permalink
[Search Git Status] use box drawing chars for staged/unstaged header
Browse files Browse the repository at this point in the history
  • Loading branch information
yogan committed Jan 24, 2023
1 parent 039a86d commit dee8150
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions functions/_fzf_report_diff_type.fish
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

0 comments on commit dee8150

Please sign in to comment.