From 3cff6f58947113ba3a101bd15ad94a23595d4e6d Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 22 Jan 2017 13:44:22 +0100 Subject: [PATCH 1/7] Update release notes and credits.rtf --- VimR/Base.lproj/Credits.rtf | 5 +++++ resources/release-notes.md | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/VimR/Base.lproj/Credits.rtf b/VimR/Base.lproj/Credits.rtf index 3d283c7f..d634a6f2 100644 --- a/VimR/Base.lproj/Credits.rtf +++ b/VimR/Base.lproj/Credits.rtf @@ -82,6 +82,11 @@ By: \b0 {\field{\*\fldinst{HYPERLINK "https://github.com/indragiek/CocoaMarkdown"}}{\fldrslt https://github.com/indragiek/CocoaMarkdown}}\ \ + +\b Swifter\ + +\b0 {\field{\*\fldinst{HYPERLINK "https://github.com/httpswift/swifter"}}{\fldrslt https://github.com/httpswift/swifter}}\ +\ \b github-markdown-css\ diff --git a/resources/release-notes.md b/resources/release-notes.md index 9a3cade9..749dc45d 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -1,3 +1,7 @@ +# 0.13.0-164 + +* GH-339: Add a simple markdown previewer. + # 0.12.6-162 * GH-382: Bugfix: Sometimes the working directory is not set correctly when using the command line tool `vimr`. From 284e06027c49c9a4c69c997cb6c4159a96a742cd Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 22 Jan 2017 13:45:49 +0100 Subject: [PATCH 2/7] GH-339 Remove unnec' logs --- VimR/MarkdownRenderer.swift | 3 --- 1 file changed, 3 deletions(-) diff --git a/VimR/MarkdownRenderer.swift b/VimR/MarkdownRenderer.swift index de74cb7f..4ca2f1df 100644 --- a/VimR/MarkdownRenderer.swift +++ b/VimR/MarkdownRenderer.swift @@ -172,9 +172,6 @@ class MarkdownRenderer: NSObject, Flow, PreviewRenderer { let menuItems: [NSMenuItem]? init(source: Observable, scrollSource: Observable, httpServer: HttpServer, initialData: PrefData) { - NSLog("\(#function) \(uuid)") - NSLog("\(#function) \(self.tempDir)") - guard let templateUrl = Bundle.main.url(forResource: "template", withExtension: "html", subdirectory: "markdown") From 3f5c2fbe8e7cdb28ca15b84b883b96e18df01a2a Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 22 Jan 2017 13:55:58 +0100 Subject: [PATCH 3/7] Bump version: v0.13.0-164 --- OutlineViewTest/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/OutlineViewTest/Info.plist b/OutlineViewTest/Info.plist index 43b22bd6..88dd8dec 100644 --- a/OutlineViewTest/Info.plist +++ b/OutlineViewTest/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-163 + 0.13.0 CFBundleVersion - 163 + 164 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/SwiftNeoVim/Info.plist b/SwiftNeoVim/Info.plist index 36741a64..858f3dd7 100644 --- a/SwiftNeoVim/Info.plist +++ b/SwiftNeoVim/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - SNAPSHOT-163 + 0.13.0 CFBundleSignature ???? CFBundleVersion - 163 + 164 NSHumanReadableCopyright Copyright © 2016 Tae Won Ha. All rights reserved. NSPrincipalClass diff --git a/SwiftNeoVimTests/Info.plist b/SwiftNeoVimTests/Info.plist index aed5f69f..ac83a605 100644 --- a/SwiftNeoVimTests/Info.plist +++ b/SwiftNeoVimTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - SNAPSHOT-163 + 0.13.0 CFBundleSignature ???? CFBundleVersion - 163 + 164 diff --git a/VimR-Workspace-Demo/Info.plist b/VimR-Workspace-Demo/Info.plist index a413f4d8..e72ea912 100644 --- a/VimR-Workspace-Demo/Info.plist +++ b/VimR-Workspace-Demo/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-163 + 0.13.0 CFBundleSignature ???? CFBundleVersion - 163 + 164 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/VimR.xcodeproj/project.pbxproj b/VimR.xcodeproj/project.pbxproj index 4d5e1978..0b62d1b4 100644 --- a/VimR.xcodeproj/project.pbxproj +++ b/VimR.xcodeproj/project.pbxproj @@ -1427,7 +1427,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 163; + DYLIB_CURRENT_VERSION = 164; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1451,7 +1451,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 163; + DYLIB_CURRENT_VERSION = 164; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1643,7 +1643,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 163; + CURRENT_PROJECT_VERSION = 164; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1693,7 +1693,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 163; + CURRENT_PROJECT_VERSION = 164; 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 23a9260f..f3aa852f 100644 --- a/VimR/Info.plist +++ b/VimR/Info.plist @@ -36,7 +36,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-163 + 0.13.0 CFBundleSignature ???? CFBundleURLTypes @@ -53,7 +53,7 @@ CFBundleVersion - 163 + 164 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/VimRTests/Info.plist b/VimRTests/Info.plist index aed5f69f..ac83a605 100644 --- a/VimRTests/Info.plist +++ b/VimRTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - SNAPSHOT-163 + 0.13.0 CFBundleSignature ???? CFBundleVersion - 163 + 164 From 8204d935e4fb46d44ea0d3d000d0e36be49100e7 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 22 Jan 2017 13:58:21 +0100 Subject: [PATCH 4/7] Bump appcast to v0.13.0-164 --- appcast.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/appcast.xml b/appcast.xml index eca61160..5d395341 100644 --- a/appcast.xml +++ b/appcast.xml @@ -7,22 +7,22 @@ Most recent changes with links to updates for VimR. en - v0.12.6-162 + v0.13.0-164 -
  • GH-382: Bugfix: Sometimes the working directory is not set correctly when using the command line tool vimr.
  • +
  • GH-339: Add a simple markdown previewer.
  • ]]>
    - https://github.com/qvacua/vimr/releases/tag/v0.12.6-162 + https://github.com/qvacua/vimr/releases/tag/v0.13.0-164 - 2017-01-10T18:14:29.004786 + 2017-01-22T13:58:21.099701 10.10.0 -
    From 72eb7a42c083695df605258c0026159ee4722f9e Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Mon, 23 Jan 2017 19:20:49 +0100 Subject: [PATCH 5/7] Make pinch zooming fast on retina displays --- SwiftNeoVim/NeoVimView.swift | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/SwiftNeoVim/NeoVimView.swift b/SwiftNeoVim/NeoVimView.swift index 5cffe5f2..5047c86d 100644 --- a/SwiftNeoVim/NeoVimView.swift +++ b/SwiftNeoVim/NeoVimView.swift @@ -154,7 +154,7 @@ public class NeoVimView: NSView, NeoVimUiBridgeProtocol, NSUserInterfaceValidati fileprivate var isCurrentlyPinching = false fileprivate var pinchTargetScale = CGFloat(1) - fileprivate var pinchImage = NSImage() + fileprivate var pinchBitmap: NSBitmapImageRep? fileprivate var currentlyResizing = false fileprivate var currentEmoji = "😎" @@ -451,10 +451,21 @@ extension NeoVimView { let context = NSGraphicsContext.current()!.cgContext if self.isCurrentlyPinching { + let interpolationQuality = context.interpolationQuality + context.interpolationQuality = .none + let boundsSize = self.bounds.size let targetSize = CGSize(width: boundsSize.width * self.pinchTargetScale, height: boundsSize.height * self.pinchTargetScale) - self.pinchImage.draw(in: CGRect(origin: self.bounds.origin, size: targetSize)) + self.pinchBitmap?.draw(in: CGRect(origin: self.bounds.origin, size: targetSize), + from: CGRect.zero, + operation: .sourceOver, + fraction: 1, + respectFlipped: true, + hints: nil) + + context.interpolationQuality = interpolationQuality + return } @@ -1015,8 +1026,7 @@ extension NeoVimView { case NSEventPhase.began: let pinchImageRep = self.bitmapImageRepForCachingDisplay(in: self.bounds)! self.cacheDisplay(in: self.bounds, to: pinchImageRep) - self.pinchImage = NSImage() - self.pinchImage.addRepresentation(pinchImageRep) + self.pinchBitmap = pinchImageRep self.isCurrentlyPinching = true self.needsDisplay = true From a6165af3fa2a3dd109decfda013dd15a5a479f13 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Mon, 23 Jan 2017 19:33:54 +0100 Subject: [PATCH 6/7] Guard against non-existing file when markdown previewing --- VimR/MarkdownRenderer.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VimR/MarkdownRenderer.swift b/VimR/MarkdownRenderer.swift index 4ca2f1df..c4f8bb6e 100644 --- a/VimR/MarkdownRenderer.swift +++ b/VimR/MarkdownRenderer.swift @@ -269,6 +269,10 @@ class MarkdownRenderer: NSObject, Flow, PreviewRenderer { return nil } + guard FileUtils.fileExists(at: url) else { + return nil + } + return url default: From 580eba933216386cd9bd04633f7f2b50df8e583d Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Mon, 23 Jan 2017 19:35:27 +0100 Subject: [PATCH 7/7] 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 749dc45d..1672cc3c 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -1,3 +1,8 @@ +# next + +* Make pinch-zooming fast (enough) on Retina-displays. +* Make markdown previewing more robust against non-existing file. + # 0.13.0-164 * GH-339: Add a simple markdown previewer.