1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00

Merge remote-tracking branch 'origin/develop' into update-neovim

This commit is contained in:
Tae Won Ha 2020-02-13 07:27:26 +01:00
commit ed62ede220
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
16 changed files with 100 additions and 67 deletions

View File

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-343</string>
<string>0.32.0</string>
<key>CFBundleVersion</key>
<string>343</string>
<string>344</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>

View File

@ -72,8 +72,8 @@ class MyView: NSView {
cells: self.ugrid.cells[row][0..<10],
attrs: CellAttributes(
fontTrait: [],
foreground: 0,
background: 0xFFFFFF,
foreground: NSColor.textColor.int,
background: NSColor.textBackgroundColor.int,
special: 0xFF0000,
reverse: false
)
@ -82,8 +82,8 @@ class MyView: NSView {
let defaultAttrs = CellAttributes(
fontTrait: [],
foreground: 0,
background: 0xFFFFFF,
foreground: NSColor.textColor.int,
background: NSColor.textBackgroundColor.int,
special: 0xFF0000,
reverse: false
)

View File

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-343</string>
<string>0.32.0</string>
<key>CFBundleVersion</key>
<string>343</string>
<string>344</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>

View File

@ -38,9 +38,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-343</string>
<string>0.32.0</string>
<key>CFBundleVersion</key>
<string>343</string>
<string>344</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>

View File

@ -1148,7 +1148,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 343;
CURRENT_PROJECT_VERSION = 344;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@ -1211,7 +1211,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 343;
CURRENT_PROJECT_VERSION = 344;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@ -1241,7 +1241,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 343;
DYLIB_CURRENT_VERSION = 344;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
FRAMEWORK_VERSION = A;
@ -1263,7 +1263,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 343;
DYLIB_CURRENT_VERSION = 344;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
FRAMEWORK_VERSION = A;

View File

@ -9,24 +9,24 @@ extension NSRange {
static let notFound = NSRange(location: NSNotFound, length: 0)
var inclusiveEndIndex: Int {
return self.location + self.length - 1
}
var inclusiveEndIndex: Int { self.location + self.length - 1 }
}
extension NSColor {
var hex: String {
var int: Int {
if let color = self.usingColorSpace(.sRGB) {
return "#" +
String(format: "%X", Int(color.redComponent * 255)) +
String(format: "%X", Int(color.greenComponent * 255)) +
String(format: "%X", Int(color.blueComponent * 255)) +
String(format: "%X", Int(color.alphaComponent * 255))
let a = Int(color.alphaComponent * 255)
let r = Int(color.redComponent * 255)
let g = Int(color.greenComponent * 255)
let b = Int(color.blueComponent * 255)
return a << 24 | r << 16 | g << 8 | b
} else {
return self.description
return 0
}
}
var hex: String { String(format: "%X", self.int) }
}
extension NSView {

View File

@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-343</string>
<string>0.32.0</string>
<key>CFBundleVersion</key>
<string>343</string>
<string>344</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 Tae Won Ha. All rights reserved.</string>
<key>NSPrincipalClass</key>

View File

@ -134,21 +134,22 @@ final class Typesetter {
return runs.flatMap { $0 }
}
private let log = OSLog(subsystem: Defs.loggerSubsystem,
category: Defs.LoggerCategory.view)
private let ctRunsCache = SimpleCache<NSAttributedString, [CTRun]>(countLimit: 5000)
private let log = OSLog(subsystem: Defs.loggerSubsystem, category: Defs.LoggerCategory.view)
private func ctRuns(from utf16Chars: Array<Unicode.UTF16.CodeUnit>, font: NSFont) -> [CTRun] {
let attrStr = NSAttributedString(
string: String(utf16CodeUnits: utf16Chars, count: utf16Chars.count),
attributes: [.font: font, .ligature: NSNumber(integerLiteral: 1)]
attributes: [.font: font, .ligature: ligatureOption]
)
if let cachedCtRuns = ctRunsCache.object(forKey: attrStr) { return cachedCtRuns }
if let cachedCtRuns = self.ctRunsCache.object(forKey: attrStr) { return cachedCtRuns }
let ctLine = CTLineCreateWithAttributedString(attrStr)
guard let ctRuns = CTLineGetGlyphRuns(ctLine) as? [CTRun] else { return [] }
ctRunsCache.set(object: ctRuns, forKey: attrStr)
self.ctRunsCache.set(object: ctRuns, forKey: attrStr)
return ctRuns
}
@ -276,4 +277,4 @@ final class Typesetter {
}
}
private let ctRunsCache = SimpleCache<NSAttributedString, [CTRun]>(countLimit: 10000)
private let ligatureOption = NSNumber(integerLiteral: 1)

View File

@ -15,8 +15,8 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-343</string>
<string>0.32.0</string>
<key>CFBundleVersion</key>
<string>343</string>
<string>344</string>
</dict>
</plist>

View File

@ -343,7 +343,7 @@ class TypesetterWithoutLigaturesTest: XCTestCase {
let run = runs[0]
expect(run.font).to(equalFont(fira))
expect(run.glyphs).to(equal([133, 1023, 1023, 1152, 133]))
expect(run.glyphs).to(equal([134, 1021, 1021, 1171, 134]))
expect(run.positions).to(equal(
(1..<6).map {
CGPoint(x: offset.x + CGFloat($0) * firaWidth, y: offset.y)
@ -619,7 +619,7 @@ class TypesetterWithLigaturesTest: XCTestCase {
expect(run.font).to(equalFont(fira))
// Ligatures of popular monospace fonts like Fira Code seem to be composed
// of multiple characters with the same advance as other normal characters.
expect(run.glyphs).to(equal([1623, 1623, 1065, 133]))
expect(run.glyphs).to(equal([1742, 1742, 1054, 134]))
expect(run.positions).to(equal(
(0..<4).map {
CGPoint(x: offset.x + CGFloat($0) * firaWidth, y: offset.y)

View File

@ -1427,7 +1427,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 343;
CURRENT_PROJECT_VERSION = 344;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@ -1487,7 +1487,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 343;
CURRENT_PROJECT_VERSION = 344;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;

View File

@ -17,15 +17,20 @@ extension NSColor {
)
}
var hex: String {
guard let color = self.usingColorSpace(.sRGB) else { return self.description }
return "#" +
String(format: "%X", Int(color.redComponent * 255)) +
String(format: "%X", Int(color.greenComponent * 255)) +
String(format: "%X", Int(color.blueComponent * 255)) +
String(format: "%X", Int(color.alphaComponent * 255))
var int: Int {
if let color = self.usingColorSpace(.sRGB) {
let a = Int(color.alphaComponent * 255)
let r = Int(color.redComponent * 255)
let g = Int(color.greenComponent * 255)
let b = Int(color.blueComponent * 255)
return a << 24 | r << 16 | g << 8 | b
} else {
return 0
}
}
var hex: String { String(format: "%X", self.int) }
func brightening(by factor: CGFloat) -> NSColor {
guard let color = self.usingColorSpace(.sRGB) else { return self }

View File

@ -1224,7 +1224,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-343</string>
<string>0.32.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -1241,7 +1241,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>343</string>
<string>344</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>

View File

@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-343</string>
<string>0.32.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>343</string>
<string>344</string>
</dict>
</plist>

View File

@ -7,22 +7,36 @@
<description>Most recent changes with links to updates for VimR.</description>
<language>en</language>
<item>
<title>v0.31.0-337</title>
<title>v0.32.0-344</title>
<description><![CDATA[
<ul>
<li>Improve handling of file system changes for the file browser</li>
<p>We updated the library ShortcutRecorder to the latest version. By doing so, we store the shortcuts in a different format than before. This means that after you launched this version, old versions will not be compatible with the stored shortcuts. To delete the stored shortcuts, you can use <code>defaults delete com.qvacua.VimR.menuitems</code> in Terminal.</p>
<ul>
<li>Show only font family names of monospace fonts.</li>
<li>Set <code>gui_running</code> to <code>true</code> (GH-476).</li>
<li>Improve drawing performance.</li>
<li>Bugfix: The cursor is not drawn when a new window is opened.</li>
<li>Bugfix: Preview in the Appearance preferences is not dark mode compatible.</li>
<li>Bugfix: Shortcut buttons are not dark mode compatible.</li>
<li>Dependencies updates:<ul>
<li>Kentzo/ShortcutRecorder@3.1</li>
<li>httpswift/swifter@1.4.7</li>
<li>eonil/FSEvents@0.1.6</li>
<li>Quick/Nimble@8.0.5</li>
<li>sparkle-project/Sparkle@1.22.0</li>
</ul>
</li>
</ul>
]]></description>
<releaseNotesLink>
https://github.com/qvacua/vimr/releases/tag/v0.31.0-337
https://github.com/qvacua/vimr/releases/tag/v0.32.0-344
</releaseNotesLink>
<pubDate>2020-01-29T18:46:32.955903</pubDate>
<pubDate>2020-02-13T07:21:41.236766</pubDate>
<minimumSystemVersion>10.12.0</minimumSystemVersion>
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.31.0-337/VimR-v0.31.0-337.tar.bz2"
sparkle:version="337"
sparkle:shortVersionString="0.31.0"
sparkle:dsaSignature="MCwCFGUJZ7akEbHT3JcZCICNswi8iJZdAhRofIjp5z72Del7RHv2hvJyZ9b7CQ=="
length="14698478"
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.32.0-344/VimR-v0.32.0-344.tar.bz2"
sparkle:version="344"
sparkle:shortVersionString="0.32.0"
sparkle:dsaSignature="MC0CFCE5p6Ko2mVWpubSEj6LKh6wQAH3AhUAvKcBfpeadJ2Pl1qqYChrWWkpwBY="
length="14813066"
type="application/octet-stream"/>
</item>
</channel>

View File

@ -7,23 +7,36 @@
<description>Most recent changes with links to updates for VimR.</description>
<language>en</language>
<item>
<title>SNAPSHOT-343</title>
<title>v0.32.0-344</title>
<description><![CDATA[
<p>We updated the library ShortcutRecorder to the latest version. By doing so, we store the shortcuts in a different format than before. This means that after you launched this version, old versions will not be compatible with the stored shortcuts. To delete the stored shortcuts, you can use <code>defaults delete com.qvacua.VimR.menuitems</code> in Terminal.</p>
<ul>
<li>Show only font family names of monospace fonts.</li>
<li>Set <code>gui_running</code> to <code>true</code> (GH-476).</li>
<li>Improve drawing performance.</li>
<li>Bugfix: The cursor is not drawn when a new window is opened.</li>
<li>Bugfix: Preview in the Appearance preferences is not dark mode compatible.</li>
<li>Bugfix: Shortcut buttons are not dark mode compatible.</li>
<li>Dependencies updates:<ul>
<li>Kentzo/ShortcutRecorder@3.1</li>
<li>httpswift/swifter@1.4.7</li>
<li>eonil/FSEvents@0.1.6</li>
<li>Quick/Nimble@8.0.5</li>
<li>sparkle-project/Sparkle@1.22.0</li>
</ul>
</li>
</ul>
]]></description>
<releaseNotesLink>
https://github.com/qvacua/vimr/releases/tag/snapshot/343
https://github.com/qvacua/vimr/releases/tag/v0.32.0-344
</releaseNotesLink>
<pubDate>2020-02-10T22:03:06.419277</pubDate>
<pubDate>2020-02-13T07:21:41.236766</pubDate>
<minimumSystemVersion>10.12.0</minimumSystemVersion>
<enclosure url="https://github.com/qvacua/vimr/releases/download/snapshot/343/VimR-SNAPSHOT-343.tar.bz2"
sparkle:version="343"
sparkle:shortVersionString="SNAPSHOT-343"
sparkle:dsaSignature="MC4CFQCjD9HYa2HwA4BNhZWorvrezswcogIVAL73Ot6LiWm/hkGWzJTR7kR/0VpS"
length="14808146"
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.32.0-344/VimR-v0.32.0-344.tar.bz2"
sparkle:version="344"
sparkle:shortVersionString="0.32.0"
sparkle:dsaSignature="MC0CFCE5p6Ko2mVWpubSEj6LKh6wQAH3AhUAvKcBfpeadJ2Pl1qqYChrWWkpwBY="
length="14813066"
type="application/octet-stream"/>
</item>
</channel>