Support Emoji #38

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
Contributor

splhack commented Oct 25, 2013

  • Added 'E' option into guioptions. 'E' option enables to render Emoji characters using 'Apple Color Emoji' font in MacVim. 'E' option is not set in default, so it doesn't change the current behaviour of MacVim.
  • Changed the range of double wide characters for Emoji. From U+1F000 to U+1FFFD. Ref. http://en.wikipedia.org/wiki/Emoji

zhaocai commented Oct 25, 2013

tried it. very nice 👍

Owner

b4winckler commented Oct 26, 2013

Thanks, this looks interesting!

You seem to also fix some rendering problems with surrogate pairs -- is that right?

Otherwise, why exactly does so many lines of code need to change? I don't know anything about the intricacies of supporting Emoji, but my naive thought was that all that should be needed is another font. Would you mind explaining it to me?

The thing that makes me hesitate is that this patch touches the Vim code, and more importantly that it adds an option (the E flag in guioptions). This makes me think that the patch should first be submitted to mainline Vim. Have you tried getting any feedback from Bram on this?

Oh, and by the way, I just pushed a commit that messes around with MMCoreTextRenderer.m so unfortunately this patch will not apply at the moment. Sorry about that.

zhaocai commented Nov 1, 2013

@splhack can you update the patch? thanks :)

@splhack splhack Support Emoji
+ Changed the range of double wide characters for Emoji. From U+1F000 to U+1FFFD. Ref. http://en.wikipedia.org/wiki/Emoji
+ Using 'Apple Color Emoji' font for rendering emoji with NSFontDescriptor -fontDescriptorByAddingAttributes:
+ Fixed rendering for Surrogate pair chars, CTFontGetGlyphsForCharacters returns 0 for Surrogate high char glyphs
22df85c
Contributor

splhack commented Nov 26, 2013

updated. got rid of 'E' guioptions(i had added it for keeping the current rendering font API because I was too worried about changing the rendering font API so far).

  • Changed the range of double wide characters for Emoji. From U+1F000 to U+1FFFD. Ref. http://en.wikipedia.org/wiki/Emoji
  • Using 'Apple Color Emoji' font for rendering emoji with NSFontDescriptor -fontDescriptorByAddingAttributes:
  • Fixed rendering for Surrogate pair chars, CTFontGetGlyphsForCharacters returns 0 for Surrogate high char glyphs

bwiggs commented Dec 19, 2013

+1

amadeus commented Dec 30, 2013

This patch currently has a bunch of merge conflicts, I think mostly around Mavericks changes. Anyway this can get fixed up to work on the latest?

Contributor

splhack commented Jan 2, 2014

@amadeus Have you tried the latest my patch? I already updated my patch for the latest master branch.

amadeus commented Jan 2, 2014

@splhack Is there a place where the patch is hosted? I've been attempting to apply from this PR branch.

Contributor

splhack commented Jan 2, 2014

@amadeus github. https://gist.github.com/piscisaureus/3342247

git checkout -f master
git merge origin/pr/38

amadeus commented Jan 2, 2014

That worked, thanks!

afh commented Jan 29, 2014

👍

amadeus commented Jan 31, 2014

Noticing some emoji don't seem to work:

example

Contributor

splhack commented Jan 31, 2014

How about the additional patch?

diff --git a/src/mbyte.c b/src/mbyte.c
index f4ce198..2ed8d75 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -1243,7 +1243,10 @@ utf_char2cells(c)
    {0x1100, 0x115f},
    {0x11a3, 0x11a7},
    {0x11fa, 0x11ff},
-   {0x2329, 0x232a},
+   {0x2300, 0x23ff},
+   {0x2700, 0x27bf},
+   {0x2b00, 0x2bff},
+   {0x2e00, 0x2e7f},
    {0x2e80, 0x2e99},
    {0x2e9b, 0x2ef3},
    {0x2f00, 0x2fd5},

amadeus commented Jan 31, 2014

Yup, that seemed to fix those particular emoji.

jm3 commented May 12, 2014

Would be great to see this PR make it in :)

skalnik commented Jun 26, 2014

Yes please! 👍

lsloan commented Mar 20, 2015

:shipit: Can't wait to see this in a MacVim release.

kfix commented Mar 21, 2015

I hate pile-on comments, but its ~50 whole lines of code, finely aged in a PR cellar for 2 years, so ...
:shipit: 👍 :neckbeard: 💥
VimR uses MacVim too.

Hello everyone. This repo is no longer actively maintained. The repo you're looking for is macvim-dev/macvim. See also this discussion and the Google code project page (which now links to the new repo).

kfix commented Mar 24, 2015

Thanks @iferguson90.
So, in your opinion, should this be sent to vim-dev@? Or vim-mac@? Or vim-multibyte@? They all seem applicable!

I guess the mbyte.c bit should be upstreamed to Vim mainline, and then the Cocoa bits can be put to macvim. hopefully 🍀 vim.org will choose to move their code from Hg@google to git$FOO this year, so this might become easier.

@splhack splhack pushed a commit to splhack/macvim that referenced this pull request Jul 7, 2015

@douglasdrumond douglasdrumond Merge pull request #38 from jpetrie/fix-warnings
Fix additional deprecation warnings.
4e52b08

kentcdodds referenced this pull request in macvim-dev/macvim Aug 17, 2015

Closed

Support Emoji #65

bendoh commented Sep 17, 2015

+1 – It's been a while since we've seen some action on this!

kfix commented Sep 18, 2015

https://github.com/vim/vim is taking pull requests now.

splhack closed this Oct 9, 2015

splhack deleted the splhack:macvim/feat/emoji branch Oct 9, 2015

@amadeus amadeus added a commit to amadeus/macvim that referenced this pull request Oct 13, 2015

@brammool @amadeus brammool + amadeus patch 7.4.893
Problem:    C indenting is wrong below a "case (foo):" because it is
            recognized as a C++ base class construct.  Issue #38.
Solution:   Check for the case keyword.
ba3c31e

@splhack splhack pushed a commit to splhack/macvim that referenced this pull request Oct 16, 2015

@brammool brammool patch 7.4.893
Problem:    C indenting is wrong below a "case (foo):" because it is
            recognized as a C++ base class construct.  Issue #38.
Solution:   Check for the case keyword.
d1b15de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment