Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Search Git Status] use box drawing chars for staged/unstaged header #291

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

yogan
Copy link
Contributor

@yogan yogan commented Jan 24, 2023

This makes the little header box for Git staged/unstaged/merged/etc. look a bit nicer.

Old:

+--------+
| Staged |
+--------+

New:

╭────────╮
│ Staged │
╰────────╯

It does not look perfect on GitHub web, but works in a terminal with a proper font:
image

We could make this optional (add some $_fzf_fish_use_unicode_box variable), but fzf itself is
also using those box drawing characters by default, so I guess pretty much everyone using fzf.fish
should be fine with it.

@yogan yogan force-pushed the git-diff-unicode-box branch from dee8150 to 50c754c Compare January 24, 2023 10:07
@yogan yogan force-pushed the git-diff-unicode-box branch from 50c754c to 82d16a3 Compare January 24, 2023 10:10
@PatrickF1
Copy link
Owner

PatrickF1 commented Jan 24, 2023

Hi Frank, thanks for the PR. This is a great idea!

  1. How do you know fzf also uses these box chars already? Are they the ones used in the fzf window border?
  2. How do you type the box characters on the keyboard?

@PatrickF1
Copy link
Owner

Hmm I forgot that it seems we are already using these chars here https://github.com/PatrickF1/fzf.fish/blob/main/functions/_fzf_search_history.fish#L11

@yogan
Copy link
Contributor Author

yogan commented Jan 25, 2023

Hi Patrick! Yes, I have used the same characters that fzf does, and that's also how I "typed" them: by copy/paste from a fzf output. :-)
There are ways to type extended Unicode characters by some key combinations, but that depends on the OS, so I can't really give a clear answer for that. I usually just look them up when I need them. Wikipedia has a nice overview for example: https://en.wikipedia.org/wiki/Box-drawing_character

Those are the ones that I have used:

$ echo '╭─╮│╰─╯' | unicode-inspect.pl
╭       U256d # BOX DRAWINGS LIGHT ARC DOWN AND RIGHT
─       U2500 # BOX DRAWINGS LIGHT HORIZONTAL
╮       U256e # BOX DRAWINGS LIGHT ARC DOWN AND LEFT
│       U2502 # BOX DRAWINGS LIGHT VERTICAL
╰       U2570 # BOX DRAWINGS LIGHT ARC UP AND RIGHT
─       U2500 # BOX DRAWINGS LIGHT HORIZONTAL
╯       U256f # BOX DRAWINGS LIGHT ARC UP AND LEFT

@PatrickF1 PatrickF1 merged commit 63c8f8e into PatrickF1:main Jan 25, 2023
@yogan yogan deleted the git-diff-unicode-box branch January 26, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants