From a17ee9bca53bf425a548add999d3f22eb0da225d Mon Sep 17 00:00:00 2001 From: Ezequiel Rosas Date: Fri, 4 Aug 2017 21:13:35 -0500 Subject: [PATCH 1/9] Normalize output text before rendering --- SwiftNeoVim/NeoVimView+Draw.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SwiftNeoVim/NeoVimView+Draw.swift b/SwiftNeoVim/NeoVimView+Draw.swift index c0cc78ae..51d22210 100644 --- a/SwiftNeoVim/NeoVimView+Draw.swift +++ b/SwiftNeoVim/NeoVimView+Draw.swift @@ -67,7 +67,7 @@ extension NeoVimView { let glyphPositions = positions.map { CGPoint(x: $0.x, y: $0.y + offset) } self.drawer.draw( - string, + string.precomposedStringWithCanonicalMapping, positions: UnsafeMutablePointer(mutating: glyphPositions), positionsCount: positions.count, highlightAttrs: rowFrag.attrs, context: context From 97ff2c76623f02743a180650c31346d184d7396f Mon Sep 17 00:00:00 2001 From: Ezequiel Rosas Date: Fri, 4 Aug 2017 23:40:35 -0500 Subject: [PATCH 2/9] Chop drawn string into uniform segments of either surrogate pairs o simple unichars --- SwiftNeoVim/TextDrawer.m | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/SwiftNeoVim/TextDrawer.m b/SwiftNeoVim/TextDrawer.m index d0b6300c..c26f2e2a 100644 --- a/SwiftNeoVim/TextDrawer.m +++ b/SwiftNeoVim/TextDrawer.m @@ -184,7 +184,38 @@ static CGColorRef color_for(NSInteger value) { CTFontRef fontWithTraits = [self fontWithTrait:fontTrait]; CGContextSetFillColorWithColor(context, color_for(foreground)); - recurseDraw(unichars, glyphs, positions, unilength, context, fontWithTraits, _fontLookupCache, _usesLigatures); + CGGlyph *g = glyphs; + CGPoint *p = positions; + const UniChar *b = unichars; + const UniChar *bStart = unichars; + const UniChar *bEnd = unichars + unilength; + UniCharCount choppedLength; + bool wide; + bool pWide = NO; + + while (b < bEnd) { + wide = CFStringIsSurrogateHighCharacter(*b) || CFStringIsSurrogateLowCharacter(*b); + if ((b > unichars) && (wide != pWide)) { + choppedLength = b - bStart; + NSString *logged = [NSString stringWithCharacters:bStart length:choppedLength]; +// NSLog(@"C(%d,%p..%p)[%@]", pWide, bStart, b, logged); +// recurseDraw(bStart, glyphs, p, choppedLength, context, fontWithTraits, _fontLookupCache, _usesLigatures); + UniCharCount step = pWide ? choppedLength / 2 : choppedLength; + p += step; + g += step; + bStart = b; + } + + pWide = wide; + b++; + } + if (bStart < bEnd) { + choppedLength = b - bStart; +// NSString *logged = [NSString stringWithCharacters:bStart length:choppedLength]; +// NSLog(@"T(%d,%p..%p)[%@]", pWide, bStart, b, logged); + recurseDraw(bStart, glyphs, p, choppedLength, context, fontWithTraits, _fontLookupCache, _usesLigatures); + } +// NSLog(@"S(-,%p..%p)[%@]", unichars, unichars + unilength, string); CFRelease(fontWithTraits); free(glyphs); From 563072f098fdd8ae383d2a7079917ed0315e8e3a Mon Sep 17 00:00:00 2001 From: Ezequiel Rosas Date: Fri, 4 Aug 2017 23:58:24 -0500 Subject: [PATCH 3/9] Chop drawn string into uniform segments of either surrogate pairs o simple unichars --- SwiftNeoVim/TextDrawer.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SwiftNeoVim/TextDrawer.m b/SwiftNeoVim/TextDrawer.m index c26f2e2a..b9f5fe5a 100644 --- a/SwiftNeoVim/TextDrawer.m +++ b/SwiftNeoVim/TextDrawer.m @@ -197,9 +197,9 @@ static CGColorRef color_for(NSInteger value) { wide = CFStringIsSurrogateHighCharacter(*b) || CFStringIsSurrogateLowCharacter(*b); if ((b > unichars) && (wide != pWide)) { choppedLength = b - bStart; - NSString *logged = [NSString stringWithCharacters:bStart length:choppedLength]; +// NSString *logged = [NSString stringWithCharacters:bStart length:choppedLength]; // NSLog(@"C(%d,%p..%p)[%@]", pWide, bStart, b, logged); -// recurseDraw(bStart, glyphs, p, choppedLength, context, fontWithTraits, _fontLookupCache, _usesLigatures); + recurseDraw(bStart, glyphs, p, choppedLength, context, fontWithTraits, _fontLookupCache, _usesLigatures); UniCharCount step = pWide ? choppedLength / 2 : choppedLength; p += step; g += step; From cebcf9333b7e66b2ea2d678c6c060dbd36b7074e Mon Sep 17 00:00:00 2001 From: Ezequiel Rosas Date: Sun, 6 Aug 2017 16:47:33 -0500 Subject: [PATCH 4/9] Move normalization to UIBridge before saving to grid --- SwiftNeoVim/NeoVimView+Draw.swift | 2 +- SwiftNeoVim/NeoVimView+UiBridge.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SwiftNeoVim/NeoVimView+Draw.swift b/SwiftNeoVim/NeoVimView+Draw.swift index 51d22210..c0cc78ae 100644 --- a/SwiftNeoVim/NeoVimView+Draw.swift +++ b/SwiftNeoVim/NeoVimView+Draw.swift @@ -67,7 +67,7 @@ extension NeoVimView { let glyphPositions = positions.map { CGPoint(x: $0.x, y: $0.y + offset) } self.drawer.draw( - string.precomposedStringWithCanonicalMapping, + string, positions: UnsafeMutablePointer(mutating: glyphPositions), positionsCount: positions.count, highlightAttrs: rowFrag.attrs, context: context diff --git a/SwiftNeoVim/NeoVimView+UiBridge.swift b/SwiftNeoVim/NeoVimView+UiBridge.swift index bb91ccfd..067530a0 100644 --- a/SwiftNeoVim/NeoVimView+UiBridge.swift +++ b/SwiftNeoVim/NeoVimView+UiBridge.swift @@ -92,7 +92,7 @@ extension NeoVimView { let curPos = self.grid.position // self.bridgeLogger.debug("\(curPos) -> \(string)") - self.grid.put(string) + self.grid.put(string.precomposedStringWithCanonicalMapping) if self.usesLigatures { if string == " " { From a10a006cd4a8b284302961505f1dcd3d3bee91ef Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Wed, 16 Aug 2017 22:42:32 +0200 Subject: [PATCH 5/9] Update deps --- Cartfile | 6 +-- Cartfile.private | 2 +- Cartfile.resolved | 8 ++-- VimR/markdown/github-markdown.css | 78 ++++++++++++++----------------- 4 files changed, 43 insertions(+), 51 deletions(-) diff --git a/Cartfile b/Cartfile index 765967ea..c8bfea8b 100644 --- a/Cartfile +++ b/Cartfile @@ -1,8 +1,8 @@ -github "ReactiveX/RxSwift" "3.5.0" +github "ReactiveX/RxSwift" "3.6.1" github "PureLayout/PureLayout" == 3.0.2 github "eonil/FileSystemEvents" "master" -github "sparkle-project/Sparkle" == 1.17.0 +github "sparkle-project/Sparkle" == 1.18.1 github "qvacua/CocoaFontAwesome" "master" github "qvacua/CocoaMarkdown" "master" -github "sindresorhus/github-markdown-css" == 2.6.0 +github "sindresorhus/github-markdown-css" == 2.8.0 github "httpswift/swifter" == 1.3.3 diff --git a/Cartfile.private b/Cartfile.private index 9c4a9dab..82d5620c 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1 +1 @@ -github "Quick/Nimble" == 7.0.0 +github "Quick/Nimble" == 7.0.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index 5bb84222..10317e30 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,9 +1,9 @@ github "PureLayout/PureLayout" "v3.0.2" -github "Quick/Nimble" "v7.0.0" -github "ReactiveX/RxSwift" "3.5.0" +github "Quick/Nimble" "v7.0.1" +github "ReactiveX/RxSwift" "3.6.1" github "eonil/FileSystemEvents" "85a089104af37f04a6bf7f2d07d7a93cac0b4fe1" github "httpswift/swifter" "1.3.3" github "qvacua/CocoaFontAwesome" "71865fc2c0275ebc5c8601edc23290e85aca9979" github "qvacua/CocoaMarkdown" "5d1c1e3dd74486dfc358c9cc3ddd7e993842113d" -github "sindresorhus/github-markdown-css" "v2.6.0" -github "sparkle-project/Sparkle" "1.17.0" +github "sindresorhus/github-markdown-css" "v2.8.0" +github "sparkle-project/Sparkle" "1.18.1" diff --git a/VimR/markdown/github-markdown.css b/VimR/markdown/github-markdown.css index ed8ab9e4..57c63c7f 100644 --- a/VimR/markdown/github-markdown.css +++ b/VimR/markdown/github-markdown.css @@ -8,37 +8,37 @@ -webkit-text-size-adjust: 100%; line-height: 1.5; color: #24292e; - font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: 1.5; word-wrap: break-word; } .markdown-body .pl-c { - color: #969896; + color: #6a737d; } .markdown-body .pl-c1, .markdown-body .pl-s .pl-v { - color: #0086b3; + color: #005cc5; } .markdown-body .pl-e, .markdown-body .pl-en { - color: #795da3; + color: #6f42c1; } .markdown-body .pl-smi, .markdown-body .pl-s .pl-s1 { - color: #333; + color: #24292e; } .markdown-body .pl-ent { - color: #63a35c; + color: #22863a; } .markdown-body .pl-k { - color: #a71d5d; + color: #d73a49; } .markdown-body .pl-s, @@ -48,26 +48,26 @@ .markdown-body .pl-sr .pl-cce, .markdown-body .pl-sr .pl-sre, .markdown-body .pl-sr .pl-sra { - color: #183691; + color: #032f62; } .markdown-body .pl-v, .markdown-body .pl-smw { - color: #ed6a43; + color: #e36209; } .markdown-body .pl-bu { - color: #b52a1d; + color: #b31d28; } .markdown-body .pl-ii { - color: #f8f8f8; - background-color: #b52a1d; + color: #fafbfc; + background-color: #b31d28; } .markdown-body .pl-c2 { - color: #f8f8f8; - background-color: #b52a1d; + color: #fafbfc; + background-color: #d73a49; } .markdown-body .pl-c2::before { @@ -76,74 +76,66 @@ .markdown-body .pl-sr .pl-cce { font-weight: bold; - color: #63a35c; + color: #22863a; } .markdown-body .pl-ml { - color: #693a17; + color: #735c0f; } .markdown-body .pl-mh, .markdown-body .pl-mh .pl-en, .markdown-body .pl-ms { font-weight: bold; - color: #1d3e81; -} - -.markdown-body .pl-mq { - color: #008080; + color: #005cc5; } .markdown-body .pl-mi { font-style: italic; - color: #333; + color: #24292e; } .markdown-body .pl-mb { font-weight: bold; - color: #333; + color: #24292e; } .markdown-body .pl-md { - color: #bd2c00; - background-color: #ffecec; + color: #b31d28; + background-color: #ffeef0; } .markdown-body .pl-mi1 { - color: #55a532; - background-color: #eaffea; + color: #22863a; + background-color: #f0fff4; } .markdown-body .pl-mc { - color: #ef9700; - background-color: #ffe3b4; + color: #e36209; + background-color: #ffebda; } .markdown-body .pl-mi2 { - color: #d8d8d8; - background-color: #808080; + color: #f6f8fa; + background-color: #005cc5; } .markdown-body .pl-mdr { font-weight: bold; - color: #795da3; -} - -.markdown-body .pl-mo { - color: #1d3e81; + color: #6f42c1; } .markdown-body .pl-ba { - color: #595e62; + color: #586069; } .markdown-body .pl-sg { - color: #c0c0c0; + color: #959da5; } .markdown-body .pl-corl { text-decoration: underline; - color: #183691; + color: #032f62; } .markdown-body .octicon { @@ -677,11 +669,11 @@ line-height: 10px; color: #444d56; vertical-align: middle; - background-color: #fcfcfc; - border: solid 1px #c6cbd1; - border-bottom-color: #959da5; + background-color: #fafbfc; + border: solid 1px #d1d5da; + border-bottom-color: #c6cbd1; border-radius: 3px; - box-shadow: inset 0 -1px 0 #959da5; + box-shadow: inset 0 -1px 0 #c6cbd1; } .markdown-body :checked+.radio-label { From e657ba6fd97de2712e9259a938282110a2d90868 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Wed, 16 Aug 2017 22:54:34 +0200 Subject: [PATCH 6/9] Update release notes --- resources/release-notes.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/release-notes.md b/resources/release-notes.md index e3b7350e..1f74dfa9 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -2,6 +2,11 @@ * GH-492: Improve `Control` key handling: e.g. `Ctrl-6` works now. (thanks @nhtzr for the PR) * ... +* Dependencies updates: + - ReactiveX/RxSwift@3.6.1 + - sparkle-project/Sparkle@1.18.1 + - sindresorhus/github-markdown-css@2.8.0 + - Quick/Nimble@7.0.1 # 0.18.0-217 From 68456f64e79aaa97ddf984055263339002003497 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Thu, 17 Aug 2017 08:51:58 +0200 Subject: [PATCH 7/9] Updatee release notes --- resources/release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/release-notes.md b/resources/release-notes.md index 1f74dfa9..9b12f062 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -1,7 +1,7 @@ # next * GH-492: Improve `Control` key handling: e.g. `Ctrl-6` works now. (thanks @nhtzr for the PR) -* ... +* GH-482, GH-283 Improve Emoji + CJK + Greek text rendering. (thanks @nhtzr for the PR) * Dependencies updates: - ReactiveX/RxSwift@3.6.1 - sparkle-project/Sparkle@1.18.1 From 0ba3d95df09a281426612e602d75a9fa07ccf36b Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Thu, 17 Aug 2017 08:57:09 +0200 Subject: [PATCH 8/9] Bump version: snapshot/219 --- MacNeovim/Info.plist | 4 ++-- SwiftNeoVim/Info.plist | 4 ++-- SwiftNeoVimTests/Info.plist | 4 ++-- VimR-Workspace-Demo/Info.plist | 4 ++-- VimR.xcodeproj/project.pbxproj | 8 ++++---- VimR/Info.plist | 4 ++-- VimRTests/Info.plist | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/MacNeovim/Info.plist b/MacNeovim/Info.plist index 7de8046f..1479dfe8 100644 --- a/MacNeovim/Info.plist +++ b/MacNeovim/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-218 + SNAPSHOT-219 CFBundleVersion - 218 + 219 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/SwiftNeoVim/Info.plist b/SwiftNeoVim/Info.plist index e3bdb8af..f70804ff 100644 --- a/SwiftNeoVim/Info.plist +++ b/SwiftNeoVim/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - SNAPSHOT-218 + SNAPSHOT-219 CFBundleSignature ???? CFBundleVersion - 218 + 219 NSHumanReadableCopyright Copyright © 2016 Tae Won Ha. All rights reserved. NSPrincipalClass diff --git a/SwiftNeoVimTests/Info.plist b/SwiftNeoVimTests/Info.plist index 75284d63..966642be 100644 --- a/SwiftNeoVimTests/Info.plist +++ b/SwiftNeoVimTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - SNAPSHOT-218 + SNAPSHOT-219 CFBundleSignature ???? CFBundleVersion - 218 + 219 diff --git a/VimR-Workspace-Demo/Info.plist b/VimR-Workspace-Demo/Info.plist index 1c35c871..1a4859f7 100644 --- a/VimR-Workspace-Demo/Info.plist +++ b/VimR-Workspace-Demo/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-218 + SNAPSHOT-219 CFBundleSignature ???? CFBundleVersion - 218 + 219 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/VimR.xcodeproj/project.pbxproj b/VimR.xcodeproj/project.pbxproj index 01a62d34..bdc6c9aa 100644 --- a/VimR.xcodeproj/project.pbxproj +++ b/VimR.xcodeproj/project.pbxproj @@ -1803,7 +1803,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 218; + DYLIB_CURRENT_VERSION = 219; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1828,7 +1828,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 218; + DYLIB_CURRENT_VERSION = 219; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -2065,7 +2065,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 218; + CURRENT_PROJECT_VERSION = 219; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -2115,7 +2115,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 218; + CURRENT_PROJECT_VERSION = 219; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/VimR/Info.plist b/VimR/Info.plist index fd282149..662663be 100644 --- a/VimR/Info.plist +++ b/VimR/Info.plist @@ -32,7 +32,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-218 + SNAPSHOT-219 CFBundleSignature ???? CFBundleURLTypes @@ -49,7 +49,7 @@ CFBundleVersion - 218 + 219 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/VimRTests/Info.plist b/VimRTests/Info.plist index 75284d63..966642be 100644 --- a/VimRTests/Info.plist +++ b/VimRTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - SNAPSHOT-218 + SNAPSHOT-219 CFBundleSignature ???? CFBundleVersion - 218 + 219 From dad380384c312a68b9ef12dc35a85b2170edd66a Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Thu, 17 Aug 2017 08:59:02 +0200 Subject: [PATCH 9/9] Bump appcast(s) to SNAPSHOT-219 --- appcast_snapshot.xml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/appcast_snapshot.xml b/appcast_snapshot.xml index e0949aab..3057b23f 100644 --- a/appcast_snapshot.xml +++ b/appcast_snapshot.xml @@ -7,22 +7,30 @@ Most recent changes with links to updates for VimR. en - SNAPSHOT-218 + SNAPSHOT-219
  • GH-492: Improve Control key handling: e.g. Ctrl-6 works now. (thanks @nhtzr for the PR)
  • +
  • GH-482, GH-283 Improve Emoji + CJK + Greek text rendering. (thanks @nhtzr for the PR)
  • +
  • Dependencies updates:
      +
    • ReactiveX/RxSwift@3.6.1
    • +
    • sparkle-project/Sparkle@1.18.1
    • +
    • sindresorhus/github-markdown-css@2.8.0
    • +
    • Quick/Nimble@7.0.1
    • +
    +
  • ]]>
    - https://github.com/qvacua/vimr/releases/tag/snapshot/218 + https://github.com/qvacua/vimr/releases/tag/snapshot/219 - 2017-08-16T17:50:59.561679 + 2017-08-17T08:59:02.471009 10.10.0 -