summaryrefslogtreecommitdiff
path: root/.config/fish/functions/_fzf_report_diff_type.fish
blob: 1edef783dc4ca73f9fac862acab78eb7edbc9344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# helper for _fzf_preview_changed_file
# 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