mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-23 19:21:53 +03:00
Cache CTRuns differently
This commit is contained in:
parent
ca15e8ba82
commit
5d4b8fbfd1
@ -5,9 +5,13 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct FontTrait: OptionSet {
|
||||
public struct FontTrait: OptionSet {
|
||||
|
||||
let rawValue: UInt
|
||||
public let rawValue: UInt
|
||||
|
||||
public init(rawValue: UInt) {
|
||||
self.rawValue = rawValue
|
||||
}
|
||||
|
||||
static let italic = FontTrait(rawValue: 1 << 0)
|
||||
static let bold = FontTrait(rawValue: 1 << 1)
|
||||
|
@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11134" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
@ -10,8 +12,8 @@
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSApplication"/>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider="target">
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="DrawerPerf" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
|
||||
</connections>
|
||||
@ -627,7 +629,7 @@
|
||||
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleSourceList:" target="-1" id="iwa-gc-5KM"/>
|
||||
<action selector="toggleSidebar:" target="-1" id="iwa-gc-5KM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
|
||||
@ -677,12 +679,13 @@
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
<point key="canvasLocation" x="-273" y="154"/>
|
||||
</menu>
|
||||
<window title="DrawerPerf" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="335" y="390" width="480" height="360"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
|
||||
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
|
@ -5,9 +5,13 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct FontTrait: OptionSet {
|
||||
public struct FontTrait: OptionSet {
|
||||
|
||||
let rawValue: UInt
|
||||
public let rawValue: UInt
|
||||
|
||||
public init(rawValue: UInt) {
|
||||
self.rawValue = rawValue
|
||||
}
|
||||
|
||||
static let italic = FontTrait(rawValue: 1 << 0)
|
||||
static let bold = FontTrait(rawValue: 1 << 1)
|
||||
|
@ -15,6 +15,7 @@
|
||||
1929B13ACA836714CD801F41 /* ConditionVariable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B4CC2D4AF391223461A2 /* ConditionVariable.swift */; };
|
||||
1929B14D2EBC34BCFEC78ACB /* CellAttributesCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BB19DD03ECD6ECC35F94 /* CellAttributesCollection.swift */; };
|
||||
1929B1A7CC32FD7D05646B98 /* AttributesRunDrawer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BB7E3430BD3FD88A7698 /* AttributesRunDrawer.swift */; };
|
||||
1929B21A36207DF558518597 /* FifoCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BA35C7CA9FEA9FFA3A51 /* FifoCache.swift */; };
|
||||
1929B2DB631E6EB5C3452B68 /* MyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BAF033A398BFBC2A7890 /* MyView.swift */; };
|
||||
1929B2E9F089A9E2800B67F2 /* NimbleCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BF88DE64FC62AFFCBC84 /* NimbleCommons.swift */; };
|
||||
1929B326D5117A670105C209 /* 2.json in Resources */ = {isa = PBXBuildFile; fileRef = 1929B0522C47787B50071806 /* 2.json */; };
|
||||
@ -28,7 +29,6 @@
|
||||
1929B4632DE08273F990806F /* Runs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B06A73BE6DAA2679AAA2 /* Runs.swift */; };
|
||||
1929B4C729F3713A6BBEAEC9 /* OSLogCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B39C7DCDA4E9D5220CD8 /* OSLogCommons.swift */; };
|
||||
1929B5C5DB438B66EC131EDE /* Defs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BF14AE831C6832659B66 /* Defs.swift */; };
|
||||
1929B6776A1D11409335FAAB /* SimpleCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B60D1775A75D7C0F6721 /* SimpleCache.swift */; };
|
||||
1929B70D3BA20F66CAFF08C8 /* CoreCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BAB9FFE8345228B559EC /* CoreCommons.swift */; };
|
||||
1929B738A3677586230704F7 /* MessagePackCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B9290D503536FFDA9C49 /* MessagePackCommons.swift */; };
|
||||
1929B74691D92B9F369787E5 /* ColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BDE2C6003A6EDC02129C /* ColorUtils.swift */; };
|
||||
@ -115,7 +115,6 @@
|
||||
4BF01CE52235022300411218 /* FontUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B96A876229DA394F906E /* FontUtils.swift */; };
|
||||
4BF01CE62235022300411218 /* CellAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BE45756C88F8B43804D2 /* CellAttributes.swift */; };
|
||||
4BF01CE72235022300411218 /* UGrid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B9D83D7E150F518D49FE /* UGrid.swift */; };
|
||||
4BF01CE82235022300411218 /* SimpleCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B60D1775A75D7C0F6721 /* SimpleCache.swift */; };
|
||||
4BF01CE92235022300411218 /* Runs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B06A73BE6DAA2679AAA2 /* Runs.swift */; };
|
||||
4BF01CEA2235022300411218 /* Typesetter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B47330DAD129520A2273 /* Typesetter.swift */; };
|
||||
4BF01CEB2235022300411218 /* Geometry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B73455764E42DACF6BB8 /* Geometry.swift */; };
|
||||
@ -140,10 +139,16 @@
|
||||
4BF18533213142FA00954FE7 /* CellAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BE45756C88F8B43804D2 /* CellAttributes.swift */; };
|
||||
4BF18534213142FA00954FE7 /* UGrid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B9D83D7E150F518D49FE /* UGrid.swift */; };
|
||||
4BF18535213142FA00954FE7 /* AttributesRunDrawer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BB7E3430BD3FD88A7698 /* AttributesRunDrawer.swift */; };
|
||||
4BF18536213142FA00954FE7 /* SimpleCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B60D1775A75D7C0F6721 /* SimpleCache.swift */; };
|
||||
4BF18537213142FA00954FE7 /* Runs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B06A73BE6DAA2679AAA2 /* Runs.swift */; };
|
||||
4BF18538213142FA00954FE7 /* Typesetter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B47330DAD129520A2273 /* Typesetter.swift */; };
|
||||
4BF18C5D1FD2EEE400DF95D1 /* NvimView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF18C5C1FD2EEE400DF95D1 /* NvimView.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4BF4FD7724169FD60025ACC4 /* FifoCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BA35C7CA9FEA9FFA3A51 /* FifoCache.swift */; };
|
||||
4BF4FD782416A0180025ACC4 /* MessagePack.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BB1F5CA209740E900EC394A /* MessagePack.framework */; };
|
||||
4BF4FD792416A0180025ACC4 /* MessagePack.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BB1F5CA209740E900EC394A /* MessagePack.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4BF4FD7B2416A03B0025ACC4 /* MessagePack.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BB1F5CA209740E900EC394A /* MessagePack.framework */; };
|
||||
4BF4FD7C2416A03B0025ACC4 /* MessagePack.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BB1F5CA209740E900EC394A /* MessagePack.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4BF4FD7E2416A06D0025ACC4 /* FifoCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BA35C7CA9FEA9FFA3A51 /* FifoCache.swift */; };
|
||||
4BF4FD802416A18E0025ACC4 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BF4FD7F2416A18E0025ACC4 /* GameKit.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -229,6 +234,28 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4BF4FD7A2416A0180025ACC4 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
4BF4FD792416A0180025ACC4 /* MessagePack.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4BF4FD7D2416A03B0025ACC4 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
4BF4FD7C2416A03B0025ACC4 /* MessagePack.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -248,7 +275,6 @@
|
||||
1929B47330DAD129520A2273 /* Typesetter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Typesetter.swift; sourceTree = "<group>"; };
|
||||
1929B4CC2D4AF391223461A2 /* ConditionVariable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConditionVariable.swift; sourceTree = "<group>"; };
|
||||
1929B52174EC68D2974B5BAE /* UiBridge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UiBridge.swift; sourceTree = "<group>"; };
|
||||
1929B60D1775A75D7C0F6721 /* SimpleCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleCache.swift; sourceTree = "<group>"; };
|
||||
1929B73455764E42DACF6BB8 /* Geometry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Geometry.swift; sourceTree = "<group>"; };
|
||||
1929B7398AD1DE525FA53E38 /* server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = server.c; sourceTree = "<group>"; };
|
||||
1929B8619FD13BC2570CBFB2 /* 1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = 1.json; sourceTree = "<group>"; };
|
||||
@ -257,6 +283,7 @@
|
||||
1929B9C55A79D97272894F5D /* SwiftCommons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftCommons.swift; sourceTree = "<group>"; };
|
||||
1929B9D7F040B8B9E2F038DF /* FontTrait.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontTrait.swift; sourceTree = "<group>"; };
|
||||
1929B9D83D7E150F518D49FE /* UGrid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGrid.swift; sourceTree = "<group>"; };
|
||||
1929BA35C7CA9FEA9FFA3A51 /* FifoCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FifoCache.swift; sourceTree = "<group>"; };
|
||||
1929BAB0B8BA4E6CDF5C56F3 /* NvimView+Types.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NvimView+Types.swift"; sourceTree = "<group>"; };
|
||||
1929BAB9FFE8345228B559EC /* CoreCommons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreCommons.swift; sourceTree = "<group>"; };
|
||||
1929BAF033A398BFBC2A7890 /* MyView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyView.swift; sourceTree = "<group>"; };
|
||||
@ -332,6 +359,7 @@
|
||||
4BF1852921313EE500954FE7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
4BF18C5A1FD2E72D00DF95D1 /* nvim */ = {isa = PBXFileReference; lastKnownFileType = folder; name = nvim; path = neovim/src/nvim; sourceTree = "<group>"; };
|
||||
4BF18C5C1FD2EEE400DF95D1 /* NvimView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NvimView.h; sourceTree = "<group>"; };
|
||||
4BF4FD7F2416A18E0025ACC4 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -381,6 +409,8 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4BF4FD802416A18E0025ACC4 /* GameKit.framework in Frameworks */,
|
||||
4BF4FD7B2416A03B0025ACC4 /* MessagePack.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -388,6 +418,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4BF4FD782416A0180025ACC4 /* MessagePack.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -415,7 +446,6 @@
|
||||
1929BE45756C88F8B43804D2 /* CellAttributes.swift */,
|
||||
1929B9D83D7E150F518D49FE /* UGrid.swift */,
|
||||
1929BB7E3430BD3FD88A7698 /* AttributesRunDrawer.swift */,
|
||||
1929B60D1775A75D7C0F6721 /* SimpleCache.swift */,
|
||||
1929B06A73BE6DAA2679AAA2 /* Runs.swift */,
|
||||
1929B47330DAD129520A2273 /* Typesetter.swift */,
|
||||
1929B73455764E42DACF6BB8 /* Geometry.swift */,
|
||||
@ -526,6 +556,7 @@
|
||||
1929BAB0B8BA4E6CDF5C56F3 /* NvimView+Types.swift */,
|
||||
1929B4CC2D4AF391223461A2 /* ConditionVariable.swift */,
|
||||
1929B03EB461210D48D47510 /* NvimCursorModeShape.generated.swift */,
|
||||
1929BA35C7CA9FEA9FFA3A51 /* FifoCache.swift */,
|
||||
);
|
||||
path = NvimView;
|
||||
sourceTree = "<group>";
|
||||
@ -549,6 +580,7 @@
|
||||
4B90F06F1FD2B9F1008A39E0 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4BF4FD7F2416A18E0025ACC4 /* GameKit.framework */,
|
||||
4B022603224AAE770052362B /* PureLayout.framework */,
|
||||
4B379CCC2248CFB6004B89B4 /* CoreFoundation.framework */,
|
||||
4BEBC239215FD19C007113C4 /* Socket.framework */,
|
||||
@ -689,6 +721,7 @@
|
||||
4BF01CC82235015E00411218 /* Sources */,
|
||||
4BF01CC92235015E00411218 /* Frameworks */,
|
||||
4BF01CCA2235015E00411218 /* Resources */,
|
||||
4BF4FD7D2416A03B0025ACC4 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -706,6 +739,7 @@
|
||||
4BF1851C21313EE300954FE7 /* Sources */,
|
||||
4BF1851D21313EE300954FE7 /* Frameworks */,
|
||||
4BF1851E21313EE300954FE7 /* Resources */,
|
||||
4BF4FD7A2416A0180025ACC4 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -914,7 +948,6 @@
|
||||
1929B9A949EE85C27FF66367 /* UGrid.swift in Sources */,
|
||||
4BB1EFB2224B71ED00A5CD5A /* RxNeovimApi.generated.swift in Sources */,
|
||||
1929BC8495028D66F0A7D618 /* AttributesRunDrawer.swift in Sources */,
|
||||
1929B6776A1D11409335FAAB /* SimpleCache.swift in Sources */,
|
||||
1929B4632DE08273F990806F /* Runs.swift in Sources */,
|
||||
1929B7D2EB80FEA7BFBC3D2C /* Typesetter.swift in Sources */,
|
||||
1929BDD254F59FC0F5B800E7 /* Geometry.swift in Sources */,
|
||||
@ -935,6 +968,7 @@
|
||||
1929BA25DA32AE80C527BB2A /* NvimView+Types.swift in Sources */,
|
||||
1929B13ACA836714CD801F41 /* ConditionVariable.swift in Sources */,
|
||||
1929B3D4281D2E30A9603368 /* NvimCursorModeShape.generated.swift in Sources */,
|
||||
1929B21A36207DF558518597 /* FifoCache.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -952,6 +986,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4BF4FD7E2416A06D0025ACC4 /* FifoCache.swift in Sources */,
|
||||
4BF01CF2223502DB00411218 /* CoreCommons.swift in Sources */,
|
||||
4BF01CF1223502D400411218 /* Defs.swift in Sources */,
|
||||
4BF01CF0223502CC00411218 /* SwiftCommons.swift in Sources */,
|
||||
@ -962,7 +997,6 @@
|
||||
4BF01CE52235022300411218 /* FontUtils.swift in Sources */,
|
||||
4BF01CE62235022300411218 /* CellAttributes.swift in Sources */,
|
||||
4BF01CE72235022300411218 /* UGrid.swift in Sources */,
|
||||
4BF01CE82235022300411218 /* SimpleCache.swift in Sources */,
|
||||
4BF01CE92235022300411218 /* Runs.swift in Sources */,
|
||||
4BF01CEA2235022300411218 /* Typesetter.swift in Sources */,
|
||||
4BF01CEB2235022300411218 /* Geometry.swift in Sources */,
|
||||
@ -977,6 +1011,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4BF4FD7724169FD60025ACC4 /* FifoCache.swift in Sources */,
|
||||
4B6DFB39223592B90066BB43 /* OSLogCommons.swift in Sources */,
|
||||
4B21ED53213D4AEC009FD017 /* CocoaCommons.swift in Sources */,
|
||||
4BF18531213142F900954FE7 /* ColorUtils.swift in Sources */,
|
||||
@ -984,7 +1019,6 @@
|
||||
4BF18533213142FA00954FE7 /* CellAttributes.swift in Sources */,
|
||||
4BF18534213142FA00954FE7 /* UGrid.swift in Sources */,
|
||||
4BF18535213142FA00954FE7 /* AttributesRunDrawer.swift in Sources */,
|
||||
4BF18536213142FA00954FE7 /* SimpleCache.swift in Sources */,
|
||||
4BF18537213142FA00954FE7 /* Runs.swift in Sources */,
|
||||
4BF18538213142FA00954FE7 /* Typesetter.swift in Sources */,
|
||||
4BF1852321313EE400954FE7 /* AppDelegate.swift in Sources */,
|
||||
@ -1366,6 +1400,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
|
||||
INFOPLIST_FILE = DrawerPerf/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
@ -1382,6 +1417,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
|
||||
INFOPLIST_FILE = DrawerPerf/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MTL_FAST_MATH = YES;
|
||||
|
@ -158,19 +158,23 @@ final class AttributesRunDrawer {
|
||||
private func fontGlyphRuns(from attrsRun: AttributesRun, offset: CGPoint) -> [FontGlyphRun] {
|
||||
let font = FontUtils.font(adding: attrsRun.attrs.fontTrait, to: self.font)
|
||||
|
||||
let typesetFunction = self.usesLigatures
|
||||
? self.typesetter.fontGlyphRunsWithLigatures
|
||||
: self.typesetter.fontGlyphRunsWithoutLigatures
|
||||
|
||||
let fontGlyphRuns = typesetFunction(
|
||||
attrsRun.cells.map { Array($0.string.utf16) },
|
||||
attrsRun.cells.startIndex,
|
||||
CGPoint(x: offset.x, y: attrsRun.location.y + self.baselineOffset),
|
||||
font,
|
||||
self.cellSize.width
|
||||
)
|
||||
|
||||
return fontGlyphRuns
|
||||
if self.usesLigatures {
|
||||
return self.typesetter.fontGlyphRunsWithLigatures(
|
||||
nvimUtf16Cells: attrsRun.cells.map { Array($0.string.utf16) },
|
||||
startColumn: attrsRun.cells.startIndex,
|
||||
offset: CGPoint(x: offset.x, y: attrsRun.location.y + self.baselineOffset),
|
||||
font: font,
|
||||
cellWidth: self.cellSize.width
|
||||
)
|
||||
} else {
|
||||
return self.typesetter.fontGlyphRunsWithoutLigatures(
|
||||
nvimUtf16Cells: attrsRun.cells.map { Array($0.string.utf16) },
|
||||
startColumn: attrsRun.cells.startIndex,
|
||||
offset: CGPoint(x: offset.x, y: attrsRun.location.y + self.baselineOffset),
|
||||
font: font,
|
||||
cellWidth: self.cellSize.width
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private func updateFontMetrics() {
|
||||
|
@ -5,39 +5,30 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
private let colorCache = SimpleCache<Int, NSColor>(countLimit: 500)
|
||||
private let cgColorCache = SimpleCache<Int, CGColor>(countLimit: 500)
|
||||
|
||||
final class ColorUtils {
|
||||
|
||||
/// ARGB
|
||||
static func cgColorIgnoringAlpha(_ rgb: Int) -> CGColor {
|
||||
if let color = cgColorCache.object(forKey: rgb) {
|
||||
return color
|
||||
}
|
||||
if let color = cgColorCache.valueForKey(rgb) { return color }
|
||||
|
||||
let color = self.colorIgnoringAlpha(rgb).cgColor
|
||||
cgColorCache.set(object: color, forKey: rgb)
|
||||
cgColorCache.set(color, forKey: rgb)
|
||||
|
||||
return color
|
||||
}
|
||||
|
||||
static func cgColorIgnoringAlpha(_ rgb: Int32) -> CGColor {
|
||||
if let color = cgColorCache.object(forKey: Int(rgb)) {
|
||||
return color
|
||||
}
|
||||
if let color = cgColorCache.valueForKey(Int(rgb)) { return color }
|
||||
|
||||
let color = self.colorIgnoringAlpha(Int(rgb)).cgColor
|
||||
cgColorCache.set(object: color, forKey: Int(rgb))
|
||||
cgColorCache.set(color, forKey: Int(rgb))
|
||||
|
||||
return color
|
||||
}
|
||||
|
||||
/// ARGB
|
||||
static func colorIgnoringAlpha(_ rgb: Int) -> NSColor {
|
||||
if let color = colorCache.object(forKey: rgb) {
|
||||
return color
|
||||
}
|
||||
if let color = colorCache.valueForKey(rgb) { return color }
|
||||
|
||||
// @formatter:off
|
||||
let red = ((rgb >> 16) & 0xFF).cgf / 255.0;
|
||||
@ -46,8 +37,11 @@ final class ColorUtils {
|
||||
// @formatter:on
|
||||
|
||||
let color = NSColor(srgbRed: red, green: green, blue: blue, alpha: 1.0)
|
||||
colorCache.set(object: color, forKey: rgb)
|
||||
colorCache.set(color, forKey: rgb)
|
||||
|
||||
return color
|
||||
}
|
||||
}
|
||||
|
||||
private let colorCache = FifoCache<Int, NSColor>(count: 500)
|
||||
private let cgColorCache = FifoCache<Int, CGColor>(count: 500)
|
||||
|
59
NvimView/NvimView/FifoCache.swift
Normal file
59
NvimView/NvimView/FifoCache.swift
Normal file
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
|
||||
final class FifoCache<Key: Hashable, Value> {
|
||||
|
||||
init(count: Int) {
|
||||
self.count = count
|
||||
self.keyWriteIndex = 0
|
||||
self.keys = Array(repeating: nil, count: count)
|
||||
self.storage = Dictionary(minimumCapacity: count)
|
||||
}
|
||||
|
||||
func set(_ value: Value, forKey key: Key) {
|
||||
self.lock.lock()
|
||||
defer { self.lock.unlock() }
|
||||
|
||||
self.keyWriteIndex = (self.keyWriteIndex + 1) % self.count
|
||||
|
||||
if let keyToDel = self.keys[self.keyWriteIndex] { self.storage.removeValue(forKey: keyToDel) }
|
||||
|
||||
self.keys[self.keyWriteIndex] = key
|
||||
self.storage[key] = value
|
||||
}
|
||||
|
||||
func valueForKey(_ key: Key) -> Value? { self.lock.withLock { self.storage[key] } }
|
||||
|
||||
private let count: Int
|
||||
private var keys: Array<Key?>
|
||||
private var keyWriteIndex: Int
|
||||
private var storage: Dictionary<Key, Value>
|
||||
|
||||
private let lock = Lock()
|
||||
}
|
||||
|
||||
fileprivate final class Lock {
|
||||
|
||||
init() { pthread_mutex_init(self.mutex, nil) }
|
||||
|
||||
deinit {
|
||||
pthread_mutex_destroy(self.mutex)
|
||||
self.mutex.deallocate()
|
||||
}
|
||||
|
||||
func lock() { pthread_mutex_lock(self.mutex) }
|
||||
|
||||
func unlock() { pthread_mutex_unlock(self.mutex) }
|
||||
|
||||
func withLock<T>(_ body: () -> T) -> T {
|
||||
self.lock()
|
||||
defer { self.unlock() }
|
||||
return body()
|
||||
}
|
||||
|
||||
private let mutex = UnsafeMutablePointer<pthread_mutex_t>.allocate(capacity: 1)
|
||||
}
|
@ -24,7 +24,7 @@ extension FontTrait: Hashable {
|
||||
final class FontUtils {
|
||||
|
||||
static func cellSize(of font: NSFont, linespacing: CGFloat, characterspacing: CGFloat) -> CGSize {
|
||||
if let cached = cellSizeWithDefaultLinespacingCache.object(forKey: font) {
|
||||
if let cached = cellSizeWithDefaultLinespacingCache.valueForKey(font) {
|
||||
return CGSize(
|
||||
width: characterspacing * cached.width,
|
||||
height: ceil(linespacing * cached.height)
|
||||
@ -41,13 +41,8 @@ final class FontUtils {
|
||||
let descent = CTFontGetDescent(font)
|
||||
let leading = CTFontGetLeading(font)
|
||||
|
||||
let cellSizeToCache = CGSize(
|
||||
width: advancement.width,
|
||||
height: ceil(ascent + descent + leading)
|
||||
)
|
||||
cellSizeWithDefaultLinespacingCache.set(
|
||||
object: cellSizeToCache, forKey: font
|
||||
)
|
||||
let cellSizeToCache = CGSize(width: advancement.width, height: ceil(ascent + descent + leading))
|
||||
cellSizeWithDefaultLinespacingCache.set(cellSizeToCache, forKey: font)
|
||||
|
||||
let cellSize = CGSize(
|
||||
width: characterspacing * advancement.width,
|
||||
@ -58,24 +53,16 @@ final class FontUtils {
|
||||
}
|
||||
|
||||
static func font(adding trait: FontTrait, to font: NSFont) -> NSFont {
|
||||
if trait.isEmpty {
|
||||
return font
|
||||
}
|
||||
if trait.isEmpty { return font }
|
||||
|
||||
let sizedFontTrait = SizedFontTrait(trait: trait, size: font.pointSize)
|
||||
|
||||
if let cachedFont = fontCache.object(forKey: sizedFontTrait) {
|
||||
return cachedFont
|
||||
}
|
||||
if let cachedFont = fontCache.valueForKey(sizedFontTrait) { return cachedFont }
|
||||
|
||||
var ctFontTrait: CTFontSymbolicTraits = []
|
||||
if trait.contains(.bold) {
|
||||
ctFontTrait.insert(.boldTrait)
|
||||
}
|
||||
if trait.contains(.bold) { ctFontTrait.insert(.boldTrait) }
|
||||
|
||||
if trait.contains(.italic) {
|
||||
ctFontTrait.insert(.italicTrait)
|
||||
}
|
||||
if trait.contains(.italic) { ctFontTrait.insert(.italicTrait) }
|
||||
|
||||
guard let ctFont = CTFontCreateCopyWithSymbolicTraits(
|
||||
font, 0.0, nil, ctFontTrait, ctFontTrait
|
||||
@ -83,10 +70,10 @@ final class FontUtils {
|
||||
return font
|
||||
}
|
||||
|
||||
fontCache.set(object: ctFont, forKey: sizedFontTrait)
|
||||
fontCache.set(ctFont, forKey: sizedFontTrait)
|
||||
return ctFont
|
||||
}
|
||||
}
|
||||
|
||||
private let fontCache = SimpleCache<SizedFontTrait, NSFont>(countLimit: 100)
|
||||
private let cellSizeWithDefaultLinespacingCache = SimpleCache<NSFont, CGSize>(countLimit: 100)
|
||||
private let fontCache = FifoCache<SizedFontTrait, NSFont>(count: 100)
|
||||
private let cellSizeWithDefaultLinespacingCache = FifoCache<NSFont, CGSize>(count: 100)
|
||||
|
@ -1,60 +0,0 @@
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import os
|
||||
|
||||
final class SimpleCache<K: Hashable, V> {
|
||||
|
||||
init(countLimit: Int? = nil) {
|
||||
if let limit = countLimit {
|
||||
self.cache.countLimit = limit
|
||||
}
|
||||
}
|
||||
|
||||
func object(forKey key: K) -> V? {
|
||||
return self.cache.object(forKey: KeyBox(key))?.value
|
||||
}
|
||||
|
||||
func set(object: V, forKey key: K) {
|
||||
self.cache.setObject(ValueBox(object), forKey: KeyBox(key))
|
||||
}
|
||||
|
||||
func removeObject(forKey key: K) {
|
||||
cache.removeObject(forKey: KeyBox(key))
|
||||
}
|
||||
|
||||
func removeAllObjects() {
|
||||
cache.removeAllObjects()
|
||||
}
|
||||
|
||||
private let cache = NSCache<KeyBox<K>, ValueBox<V>>()
|
||||
|
||||
private class ValueBox<T> {
|
||||
|
||||
fileprivate let value: T
|
||||
|
||||
fileprivate init(_ value: T) {
|
||||
self.value = value
|
||||
}
|
||||
}
|
||||
|
||||
private class KeyBox<K: Hashable>: NSObject {
|
||||
|
||||
fileprivate let key: K
|
||||
|
||||
fileprivate init(_ key: K) {
|
||||
self.key = key
|
||||
}
|
||||
|
||||
override var hash: Int {
|
||||
return key.hashValue
|
||||
}
|
||||
|
||||
override func isEqual(_ object: Any?) -> Bool {
|
||||
return self.key == (object as? KeyBox<K>)?.key
|
||||
}
|
||||
}
|
||||
}
|
@ -134,32 +134,26 @@ final class Typesetter {
|
||||
return runs.flatMap { $0 }
|
||||
}
|
||||
|
||||
|
||||
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] {
|
||||
if let ctRunsAndFont = self.ctRunsCache.valueForKey(utf16Chars),
|
||||
font == ctRunsAndFont.font { return ctRunsAndFont.ctRuns }
|
||||
|
||||
let attrStr = NSAttributedString(
|
||||
string: String(utf16CodeUnits: utf16Chars, count: utf16Chars.count),
|
||||
attributes: [.font: font, .ligature: ligatureOption]
|
||||
)
|
||||
|
||||
if let cachedCtRuns = self.ctRunsCache.object(forKey: attrStr) { return cachedCtRuns }
|
||||
|
||||
let ctLine = CTLineCreateWithAttributedString(attrStr)
|
||||
guard let ctRuns = CTLineGetGlyphRuns(ctLine) as? [CTRun] else { return [] }
|
||||
|
||||
self.ctRunsCache.set(object: ctRuns, forKey: attrStr)
|
||||
self.ctRunsCache.set(
|
||||
CtRunsAndFont(ctRuns: ctRuns, font: font),
|
||||
forKey: utf16Chars
|
||||
)
|
||||
|
||||
return ctRuns
|
||||
}
|
||||
|
||||
private struct NvimUtf16CellsRun {
|
||||
|
||||
var startColumn: Int
|
||||
var nvimUtf16Cells: [[Unicode.UTF16.CodeUnit]]
|
||||
var isSimple: Bool
|
||||
}
|
||||
|
||||
private func groupSimpleAndNonSimpleChars(
|
||||
nvimUtf16Cells: [[Unicode.UTF16.CodeUnit]],
|
||||
font: NSFont
|
||||
@ -257,24 +251,42 @@ final class Typesetter {
|
||||
}
|
||||
|
||||
private func utf16Chars(from nvimUtf16Cells: [[Unicode.UTF16.CodeUnit]]) -> Array<UInt16> {
|
||||
return nvimUtf16Cells.withUnsafeBufferPointer { pointer -> [UInt16] in
|
||||
var count = 0
|
||||
for i in 0..<pointer.count { count = count + pointer[i].count }
|
||||
nvimUtf16Cells.withUnsafeBufferPointer { pointer -> [UInt16] in
|
||||
let count = pointer.reduce(0) { acc, elem in acc + elem.count }
|
||||
|
||||
var result = Array(repeating: Unicode.UTF16.CodeUnit(), count: count)
|
||||
var i = 0
|
||||
for k in 0..<pointer.count {
|
||||
let element = pointer[k]
|
||||
if element.isEmpty { continue }
|
||||
return Array<Unicode.UTF16.CodeUnit>(
|
||||
unsafeUninitializedCapacity: count
|
||||
) { resultPtr, initCount in
|
||||
var i = 0
|
||||
for k in 0..<pointer.count {
|
||||
let element = pointer[k]
|
||||
if element.isEmpty { continue }
|
||||
|
||||
for j in 0..<element.count { result[i + j] = element[j] }
|
||||
for j in 0..<element.count { resultPtr[i + j] = element[j] }
|
||||
|
||||
i = i + element.count
|
||||
i = i + element.count
|
||||
}
|
||||
initCount = count
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
private let ctRunsCache = FifoCache<Array<Unicode.UTF16.CodeUnit>, CtRunsAndFont>(count: 5000)
|
||||
|
||||
private let log = OSLog(subsystem: Defs.loggerSubsystem, category: Defs.LoggerCategory.view)
|
||||
|
||||
private struct CtRunsAndFont {
|
||||
|
||||
var ctRuns: [CTRun]
|
||||
var font: NSFont
|
||||
}
|
||||
|
||||
private struct NvimUtf16CellsRun {
|
||||
|
||||
var startColumn: Int
|
||||
var nvimUtf16Cells: [[Unicode.UTF16.CodeUnit]]
|
||||
var isSimple: Bool
|
||||
}
|
||||
}
|
||||
|
||||
private let ligatureOption = NSNumber(integerLiteral: 1)
|
||||
|
@ -20,7 +20,11 @@ extension PrimitiveSequence where Element == Never, Trait == CompletableTrait {
|
||||
|
||||
func andThen(using body: () -> Completable) -> Completable { self.andThen(body()) }
|
||||
|
||||
func wait(onCompleted: (() -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil) throws {
|
||||
func wait(
|
||||
timeout: TimeInterval = 5,
|
||||
onCompleted: (() -> Void)? = nil,
|
||||
onError: ((Swift.Error) -> Void)? = nil
|
||||
) throws {
|
||||
var trigger = false
|
||||
var err: Swift.Error? = nil
|
||||
|
||||
@ -46,7 +50,11 @@ extension PrimitiveSequence where Element == Never, Trait == CompletableTrait {
|
||||
condition.broadcast()
|
||||
})
|
||||
|
||||
while !trigger { condition.wait(until: Date(timeIntervalSinceNow: 5)) }
|
||||
while !trigger {
|
||||
condition.wait(until: Date(timeIntervalSinceNow: timeout))
|
||||
trigger = true
|
||||
}
|
||||
|
||||
disposable.dispose()
|
||||
|
||||
if let e = err { throw e }
|
||||
@ -68,7 +76,7 @@ extension PrimitiveSequence where Trait == SingleTrait {
|
||||
.ignoreElements()
|
||||
}
|
||||
|
||||
func syncValue() -> Element? {
|
||||
func syncValue(timeout: TimeInterval = 5) -> Element? {
|
||||
var trigger = false
|
||||
var value: Element?
|
||||
|
||||
@ -91,7 +99,11 @@ extension PrimitiveSequence where Trait == SingleTrait {
|
||||
condition.broadcast()
|
||||
})
|
||||
|
||||
while !trigger { condition.wait(until: Date(timeIntervalSinceNow: 5)) }
|
||||
while !trigger {
|
||||
condition.wait(until: Date(timeIntervalSinceNow: timeout))
|
||||
trigger = true
|
||||
}
|
||||
|
||||
disposable.dispose()
|
||||
|
||||
return value
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Next
|
||||
|
||||
GH-775: Use the colors of the selected color scheme for the markdown preview.
|
||||
|
||||
* GH-775: Use the colors of the selected color scheme for the markdown preview.
|
||||
* Improve drawing performance.
|
||||
* Dependencies updates:
|
||||
- ggreer/the_silver_searcher@a509a81
|
||||
- sparkle-project/Sparkle@1.23.0
|
||||
|
Loading…
Reference in New Issue
Block a user