summaryrefslogtreecommitdiff
path: root/.config/fish/functions/_fzf_report_diff_type.fish
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-03-18 16:40:57 -0300
committerRoger Gonzalez <roger@rogs.me>2023-03-18 16:40:57 -0300
commit8600374371f91843064441113f4023cda1730877 (patch)
treebb4677ec186dd5c323f1f010207076b7df285606 /.config/fish/functions/_fzf_report_diff_type.fish
parentc95dd49df12f4f8dc13cf3bdc4dad70a060bd5eb (diff)
General fish fixes and updates
Diffstat (limited to '.config/fish/functions/_fzf_report_diff_type.fish')
-rw-r--r--.config/fish/functions/_fzf_report_diff_type.fish16
1 files changed, 16 insertions, 0 deletions
diff --git a/.config/fish/functions/_fzf_report_diff_type.fish b/.config/fish/functions/_fzf_report_diff_type.fish
new file mode 100644
index 00000000..1edef783
--- /dev/null
+++ b/.config/fish/functions/_fzf_report_diff_type.fish
@@ -0,0 +1,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