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

Consistent column widths of hard-coded special glyphs and avoid U+FE0F, or allow users to override them #64

Closed
Frederick888 opened this issue Aug 20, 2020 · 5 comments

Comments

@Frederick888
Copy link

Currently U+FE0F, which is the variation selector that enforces some preceding glyphs to be rendered in colour & double column, is used a lot in codes and sometimes hard-coded (system.py and transitions.py). Unfortunately terminal emulators, shells, and even NeoVim, seldom handle them correctly (neovim/neovim#7151, neovim/neovim#12435) and they often cause problems.

So I think we should allow users to override those hard-coded glyphs like how coc.nvim handles this issue: https://github.com/neoclide/coc.nvim/blob/806ce47583d66d0b574a3c993526033971e700cf/autoload/coc.vim#L9

Even better, if we could also unify the glyph column widths in emoji_icons.json without relying on U+FE0E/U+FE0F, more users will able to enjoy emojis without suffering from weird glitches.

PS: Some U+FE0F's are actually redundant in CHADTree's code, e.g. those come after U+231B, U+1F004

$ fd --type=f | while read -r line; do
if [[ -n "$(cat "$line" | uniname 2>/dev/null | rg 00FE0F)" ]]; then
        echo "$line"
        cat "$line" | uniname -p 2>/dev/null | rg -B1 00FE0F
fi
done
artifacts/emoji_icons.json
     2457       2771  01F171   F0 9F 85 B1    🅱      NEGATIVE SQUARED LATIN CAPITAL LETTER B
     2458       2775  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     2491       2813  002699   E2 9A 99       ⚙      GEAR
     2492       2816  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     2600       2941  002615   E2 98 95       ☕      HOT BEVERAGE
     2601       2944  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     2722       3085  00262A   E2 98 AA       ☪      STAR AND CRESCENT
     2723       3088  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     2744       3111  00262A   E2 98 AA       ☪      STAR AND CRESCENT
     2745       3114  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     2817       3197  00262A   E2 98 AA       ☪      STAR AND CRESCENT
     2818       3200  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     3058       3481  002694   E2 9A 94       ⚔      CROSSED SWORDS
     3059       3484  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     4128       4731  002615   E2 98 95       ☕      HOT BEVERAGE
     4129       4734  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     4540       5213  002B07   E2 AC 87       ⬇      DOWNWARDS BLACK ARROW
     4541       5216  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     4561       5238  002B07   E2 AC 87       ⬇      DOWNWARDS BLACK ARROW
     4562       5241  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     4579       5260  002B07   E2 AC 87       ⬇      DOWNWARDS BLACK ARROW
     4580       5263  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     4648       5342  002B07   E2 AC 87       ⬇      DOWNWARDS BLACK ARROW
     4649       5345  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     5106       5879  01F17F   F0 9F 85 BF    🅿      NEGATIVE SQUARED LATIN CAPITAL LETTER P
     5107       5883  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     5433       6262  00269B   E2 9A 9B       ⚛      ATOM SYMBOL
     5434       6265  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     5606       6466  0000AE   C2 AE          ®      REGISTERED SIGN
     5607       6468  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     6216       7181  00262A   E2 98 AA       ☪      STAR AND CRESCENT
     6217       7184  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     6377       7373  01F004   F0 9F 80 84    🀄      MAHJONG TILE RED DRAGON
     6378       7377  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     6463       7476  01F004   F0 9F 80 84    🀄      MAHJONG TILE RED DRAGON
     6464       7480  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     6784       7852  01F004   F0 9F 80 84    🀄      MAHJONG TILE RED DRAGON
     6785       7856  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
rplugin/python3/chadtree/system.py
      500        500  0026A0   E2 9A A0       ⚠      WARNING SIGN
      501        503  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
      779        783  0026A0   E2 9A A0       ⚠      WARNING SIGN
      780        786  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
rplugin/python3/chadtree/transitions.py
     6326       6326  0026A0   E2 9A A0       ⚠      WARNING SIGN
     6327       6329  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
     6533       6537  0026A0   E2 9A A0       ⚠      WARNING SIGN
     6534       6540  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
    10143      10153  00231B   E2 8C 9B       ⌛      HOURGLASS
    10144      10156  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
    15108      15133  00270F   E2 9C 8F       ✏      PENCIL
    15109      15136  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
    15275      15304  0026A0   E2 9A A0       ⚠      WARNING SIGN
    15276      15307  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
    16237      16270  00270F   E2 9C 8F       ✏      PENCIL
    16238      16273  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
    16488      16525  0026A0   E2 9A A0       ⚠      WARNING SIGN
    16489      16528  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
    21470      21514  0026A0   E2 9A A0       ⚠      WARNING SIGN
    21471      21517  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
--
    23073      23121  0026A0   E2 9A A0       ⚠      WARNING SIGN
    23074      23124  00FE0F   EF B8 8F       ️      VARIATION SELECTOR-16
@ms-jpq
Copy link
Owner

ms-jpq commented Aug 20, 2020

good point, i will fix this.

might take a bit of time though, not feeling well recently, got put on some medication that doctor said will make you dizzy for a few days

@Frederick888 Frederick888 changed the title Unify column widths of hard-coded special glyphs and avoid U+FE0F, or allow users to override them Consistent column widths of hard-coded special glyphs and avoid U+FE0F, or allow users to override them Aug 20, 2020
@Frederick888
Copy link
Author

No worries and stay safe, mate!

@krehwell
Copy link

is there any update on this? this is totally needed since my terminal not support symbol or emoticon, so probably there could be any way on how to easily change this just like the nerdtree-git does. like this

@ms-jpq
Copy link
Owner

ms-jpq commented Oct 18, 2020

#84

I will add localization support in the PR above.

setting lang = c will disable all emoticons, otherwise it will default to using LC_ALL or LANG env var with fallback to en

@ms-jpq
Copy link
Owner

ms-jpq commented Jan 5, 2021

#100

will actually add c lang

@ms-jpq ms-jpq closed this as completed Jan 21, 2021
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

No branches or pull requests

3 participants