mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-26 23:36:08 +03:00
Merge remote-tracking branch 'origin/develop' into update-neovim
This commit is contained in:
commit
73ba599b0a
@ -1,10 +1,7 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// DrawerDev
|
||||
//
|
||||
// Created by Tae Won Ha on 25.08.18.
|
||||
// Copyright © 2018 Tae Won Ha. All rights reserved.
|
||||
//
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*/
|
||||
|
||||
import Cocoa
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Created by Tae Won Ha on 25.08.18.
|
||||
// Copyright (c) 2018 Tae Won Ha. All rights reserved.
|
||||
//
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
|
||||
|
@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.26.4</string>
|
||||
<string>0.26.5</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>307</string>
|
||||
<string>308</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Created by Tae Won Ha on 25.08.18.
|
||||
// Copyright (c) 2018 Tae Won Ha. All rights reserved.
|
||||
//
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*/
|
||||
|
||||
import Cocoa
|
||||
|
||||
|
74405
NvimView/DrawerPerf/0.json
Normal file
74405
NvimView/DrawerPerf/0.json
Normal file
File diff suppressed because it is too large
Load Diff
74405
NvimView/DrawerPerf/1.json
Normal file
74405
NvimView/DrawerPerf/1.json
Normal file
File diff suppressed because it is too large
Load Diff
74405
NvimView/DrawerPerf/2.json
Normal file
74405
NvimView/DrawerPerf/2.json
Normal file
File diff suppressed because it is too large
Load Diff
52
NvimView/DrawerPerf/AppDelegate.swift
Normal file
52
NvimView/DrawerPerf/AppDelegate.swift
Normal file
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*/
|
||||
|
||||
import Cocoa
|
||||
import GameKit
|
||||
import os
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
@IBOutlet weak var window: NSWindow!
|
||||
var result = Array<[[FontGlyphRun]]>(repeating: [], count: count)
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
var results = [CFTimeInterval]()
|
||||
let repeatCount = 5
|
||||
for _ in (0..<repeatCount) {
|
||||
let rd = GKRandomDistribution(
|
||||
randomSource: GKMersenneTwisterRandomSource(seed: 129384832),
|
||||
lowestValue: 0,
|
||||
highestValue: repeatCount - 1
|
||||
)
|
||||
let indices = (0..<count).map { i in rd.nextInt() % 3 }
|
||||
|
||||
let time = self.measure {
|
||||
for i in (0..<count) { result[i] = self.perf.render(indices[i]) }
|
||||
}
|
||||
results.append(time)
|
||||
}
|
||||
|
||||
self.log.default(
|
||||
"\(results.reduce(0, +) / Double(results.count))s: \(results)"
|
||||
)
|
||||
|
||||
NSApp.terminate(self)
|
||||
}
|
||||
|
||||
private let perf = PerfTester()
|
||||
|
||||
private let log = OSLog(subsystem: "com.qvacua.DrawerPerf",
|
||||
category: "perf-tester")
|
||||
|
||||
private func measure(_ body: () -> Void) -> CFTimeInterval {
|
||||
let start = CFAbsoluteTimeGetCurrent()
|
||||
body()
|
||||
return CFAbsoluteTimeGetCurrent() - start
|
||||
}
|
||||
}
|
||||
|
||||
private let count = 500
|
@ -0,0 +1,58 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "16x16",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "16x16",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "32x32",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "32x32",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "128x128",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "128x128",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "256x256",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "256x256",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "512x512",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "mac",
|
||||
"size": "512x512",
|
||||
"scale": "2x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
6
NvimView/DrawerPerf/Assets.xcassets/Contents.json
Normal file
6
NvimView/DrawerPerf/Assets.xcassets/Contents.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
692
NvimView/DrawerPerf/Base.lproj/MainMenu.xib
Normal file
692
NvimView/DrawerPerf/Base.lproj/MainMenu.xib
Normal file
@ -0,0 +1,692 @@
|
||||
<?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">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
|
||||
</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">
|
||||
<connections>
|
||||
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="DrawerPerf" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="DrawerPerf" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About DrawerPerf" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
|
||||
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
|
||||
<menuItem title="Services" id="NMo-om-nkz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
|
||||
<menuItem title="Hide DrawerPerf" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit DrawerPerf" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="dMs-cI-mzQ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="File" id="bib-Uj-vzu">
|
||||
<items>
|
||||
<menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
|
||||
<connections>
|
||||
<action selector="newDocument:" target="-1" id="4Si-XN-c54"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
|
||||
<connections>
|
||||
<action selector="openDocument:" target="-1" id="bVn-NM-KNZ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open Recent" id="tXI-mr-wws">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="vNY-rz-j42">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="clearRecentDocuments:" target="-1" id="Daa-9d-B3U"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
|
||||
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="HmO-Ls-i7Q"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
|
||||
<connections>
|
||||
<action selector="saveDocument:" target="-1" id="teZ-XB-qJY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
|
||||
<connections>
|
||||
<action selector="saveDocumentAs:" target="-1" id="mDf-zr-I0C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Revert to Saved" keyEquivalent="r" id="KaW-ft-85H">
|
||||
<connections>
|
||||
<action selector="revertDocumentToSaved:" target="-1" id="iJ3-Pv-kwq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
|
||||
<menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="runPageLayout:" target="-1" id="Din-rz-gC5"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
|
||||
<connections>
|
||||
<action selector="print:" target="-1" id="qaZ-4w-aoO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="5QF-Oa-p0T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="M6e-cu-g7V"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="oIA-Rs-6OD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="YJe-68-I9s"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="G1f-GL-Joy"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="UvS-8e-Qdg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="pa3-QI-u2k">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
|
||||
<menuItem title="Find" id="4EN-yA-p0u">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Find" id="1b7-l0-nxx">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
|
||||
<items>
|
||||
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
|
||||
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="9ic-FL-obx">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
|
||||
<items>
|
||||
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
|
||||
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" id="cwL-P1-jid">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Data Detectors" id="tRr-pd-1PS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Transformations" id="2oI-Rn-ZJC">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
|
||||
<items>
|
||||
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="xrE-MZ-jX0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Format" id="jxT-CU-nIS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Format" id="GEO-Iw-cKr">
|
||||
<items>
|
||||
<menuItem title="Font" id="Gi5-1S-RQB">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
|
||||
<items>
|
||||
<menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
|
||||
<connections>
|
||||
<action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
|
||||
<connections>
|
||||
<action selector="underline:" target="-1" id="FYS-2b-JAY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
|
||||
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
|
||||
<menuItem title="Kern" id="jBQ-r6-VK2">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Kern" id="tlD-Oa-oAM">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="GUa-eO-cwY">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardKerning:" target="-1" id="6dk-9l-Ckg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="cDB-IK-hbR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffKerning:" target="-1" id="U8a-gz-Maa"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Tighten" id="46P-cB-AYj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="tightenKerning:" target="-1" id="hr7-Nz-8ro"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Loosen" id="ogc-rX-tC1">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="loosenKerning:" target="-1" id="8i4-f9-FKE"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Ligatures" id="o6e-r0-MWq">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="agt-UL-0e3">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardLigatures:" target="-1" id="7uR-wd-Dx6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="J7y-lM-qPV">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffLigatures:" target="-1" id="iX2-gA-Ilz"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use All" id="xQD-1f-W4t">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useAllLigatures:" target="-1" id="KcB-kA-TuK"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Baseline" id="OaQ-X3-Vso">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Baseline" id="ijk-EB-dga">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="3Om-Ey-2VK">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unscript:" target="-1" id="0vZ-95-Ywn"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Superscript" id="Rqc-34-cIF">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="superscript:" target="-1" id="3qV-fo-wpU"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Subscript" id="I0S-gh-46l">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="subscript:" target="-1" id="Q6W-4W-IGz"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Raise" id="2h7-ER-AoG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="raiseBaseline:" target="-1" id="4sk-31-7Q9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Lower" id="1tx-W0-xDw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowerBaseline:" target="-1" id="OF1-bc-KW4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
|
||||
<menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
|
||||
<connections>
|
||||
<action selector="orderFrontColorPanel:" target="-1" id="mSX-Xz-DV3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
|
||||
<menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyFont:" target="-1" id="GJO-xA-L4q"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteFont:" target="-1" id="JfD-CL-leO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Text" id="Fal-I4-PZk">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Text" id="d9c-me-L2H">
|
||||
<items>
|
||||
<menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
|
||||
<connections>
|
||||
<action selector="alignLeft:" target="-1" id="zUv-R1-uAa"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
|
||||
<connections>
|
||||
<action selector="alignCenter:" target="-1" id="spX-mk-kcS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Justify" id="J5U-5w-g23">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="alignJustified:" target="-1" id="ljL-7U-jND"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
|
||||
<connections>
|
||||
<action selector="alignRight:" target="-1" id="r48-bG-YeY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
|
||||
<menuItem title="Writing Direction" id="H1b-Si-o9J">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
|
||||
<items>
|
||||
<menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="YGs-j5-SAR">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionNatural:" target="-1" id="qtV-5e-UBP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="Lbh-J2-qVU">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="S0X-9S-QSf"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="jFq-tB-4Kx">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="5fk-qB-AqJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
|
||||
<menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="Nop-cj-93Q">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionNatural:" target="-1" id="lPI-Se-ZHp"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="BgM-ve-c93">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="caW-Bv-w94"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="RB4-Sm-HuC">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="EXD-6r-ZUu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
|
||||
<menuItem title="Show Ruler" id="vLm-3I-IUL">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleRuler:" target="-1" id="FOx-HJ-KwY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyRuler:" target="-1" id="71i-fW-3W2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteRuler:" target="-1" id="cSh-wd-qM2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="H8h-7b-M4v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="View" id="HyV-fh-RgO">
|
||||
<items>
|
||||
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleToolbarShown:" target="-1" id="BXY-wc-z0C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="runToolbarCustomizationPalette:" target="-1" id="pQI-g3-MTW"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="hB3-LF-h0Y"/>
|
||||
<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"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleFullScreen:" target="-1" id="dU3-MA-1Rq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="aUF-d1-5bR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="R4o-n2-Eq4">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
|
||||
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="wpr-3q-Mcd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
||||
<items>
|
||||
<menuItem title="DrawerPerf Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</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"/>
|
||||
<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"/>
|
||||
</view>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
16
NvimView/DrawerPerf/FontTrait.swift
Normal file
16
NvimView/DrawerPerf/FontTrait.swift
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
|
||||
struct FontTrait: OptionSet {
|
||||
|
||||
let rawValue: UInt
|
||||
|
||||
static let italic = FontTrait(rawValue: 1 << 0)
|
||||
static let bold = FontTrait(rawValue: 1 << 1)
|
||||
static let underline = FontTrait(rawValue: 1 << 2)
|
||||
static let undercurl = FontTrait(rawValue: 1 << 3)
|
||||
}
|
32
NvimView/DrawerPerf/Info.plist
Normal file
32
NvimView/DrawerPerf/Info.plist
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.26.5</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>308</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2019 Tae Won Ha. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
151
NvimView/DrawerPerf/PerfTester.swift
Normal file
151
NvimView/DrawerPerf/PerfTester.swift
Normal file
@ -0,0 +1,151 @@
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*
|
||||
* 0.json from: https://github.com/gshslatexintro/An-Introduction-to-LaTeX
|
||||
* 1.json from @telemachus
|
||||
* 2.json from http://generator.lorem-ipsum.info
|
||||
*/
|
||||
|
||||
import Cocoa
|
||||
import GameKit
|
||||
import os
|
||||
|
||||
class PerfTester {
|
||||
|
||||
init() {
|
||||
self.cellSize = FontUtils.cellSize(of: self.font, linespacing: 1.25)
|
||||
|
||||
for name in ["0", "1", "2"] {
|
||||
guard let fileUrl = Bundle(for: PerfTester.self)
|
||||
.url(forResource: name, withExtension: "json")
|
||||
else {
|
||||
preconditionFailure("Could not find \(name).json")
|
||||
}
|
||||
|
||||
let decoder = JSONDecoder()
|
||||
do {
|
||||
let data = try Data(contentsOf: fileUrl)
|
||||
self.ugrids.append(try decoder.decode(UGrid.self, from: data))
|
||||
} catch {
|
||||
preconditionFailure("Couldn't decode UGrid from \(name).json: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
self.initAttrs()
|
||||
}
|
||||
|
||||
func render(_ index: Int) -> [[FontGlyphRun]] {
|
||||
precondition((0...2).contains(index), "Wrong index!")
|
||||
|
||||
let ugrid = self.ugrids[index]
|
||||
let runs = self.runs(index,
|
||||
forRowRange: 0...ugrid.size.height - 1,
|
||||
columnRange: 0...ugrid.size.width - 1)
|
||||
|
||||
return runs.parallelMap(chunkSize: 50) { run in
|
||||
let font = FontUtils.font(
|
||||
adding: run.attrs.fontTrait, to: self.font
|
||||
)
|
||||
|
||||
return self.typesetter.fontGlyphRunsWithLigatures(
|
||||
nvimUtf16Cells: run.cells.map { Array($0.string.utf16) },
|
||||
startColumn: run.cells.startIndex,
|
||||
offset: .zero,
|
||||
font: font,
|
||||
cellWidth: 20)
|
||||
}
|
||||
}
|
||||
|
||||
private var ugrids = [UGrid]()
|
||||
private let cellAttrsCollection = CellAttributesCollection()
|
||||
private let typesetter = Typesetter()
|
||||
private let font = NSFont.userFixedPitchFont(ofSize: 13)!
|
||||
private let cellSize: CGSize
|
||||
|
||||
private func runs(
|
||||
_ index: Int,
|
||||
forRowRange rowRange: CountableClosedRange<Int>,
|
||||
columnRange: CountableClosedRange<Int>
|
||||
) -> [AttributesRun] {
|
||||
precondition(0 <= index && index <= 2, "Wrong index!")
|
||||
|
||||
let ugrid = self.ugrids[index]
|
||||
return rowRange.map { row in
|
||||
ugrid.cells[row][columnRange]
|
||||
.groupedRanges(with: { _, cell in cell.attrId })
|
||||
.compactMap { range in
|
||||
let cells = ugrid.cells[row][range]
|
||||
|
||||
guard let firstCell = cells.first,
|
||||
let attrs = self.cellAttrsCollection.attributes(
|
||||
of: firstCell.attrId
|
||||
)
|
||||
else {
|
||||
// GH-666: FIXME: correct error handling
|
||||
self.log.error("row: \(row), range: \(range): " +
|
||||
"Could not get CellAttributes with ID " +
|
||||
"\(String(describing: cells.first?.attrId))")
|
||||
return nil
|
||||
}
|
||||
|
||||
return AttributesRun(
|
||||
location: CGPoint.zero,
|
||||
cells: ugrid.cells[row][range],
|
||||
attrs: attrs
|
||||
)
|
||||
}
|
||||
}
|
||||
.flatMap { $0 }
|
||||
}
|
||||
|
||||
private let fontTraitRd = GKRandomDistribution(
|
||||
randomSource: randomSource,
|
||||
lowestValue: 0,
|
||||
highestValue: 6
|
||||
)
|
||||
|
||||
private let intColorRd = GKRandomDistribution(
|
||||
randomSource: randomSource,
|
||||
lowestValue: 0,
|
||||
highestValue: 16777215
|
||||
)
|
||||
|
||||
private let attrsRunRd = GKRandomDistribution(
|
||||
randomSource: randomSource,
|
||||
lowestValue: 0,
|
||||
highestValue: 10
|
||||
)
|
||||
|
||||
private let log = OSLog(subsystem: "com.qvacua.DrawerPerf",
|
||||
category: "perf-tester")
|
||||
|
||||
private func initAttrs() {
|
||||
for i in (1..<200) {
|
||||
self.cellAttrsCollection.set(attributes: self.randomCellAttrs(), for: i)
|
||||
}
|
||||
}
|
||||
|
||||
private func randomCellAttrs() -> CellAttributes {
|
||||
return CellAttributes(fontTrait: self.randomFontTrait(),
|
||||
foreground: self.intColorRd.nextInt(),
|
||||
background: self.intColorRd.nextInt(),
|
||||
special: self.intColorRd.nextInt(),
|
||||
reverse: false)
|
||||
}
|
||||
|
||||
private func randomFontTrait() -> FontTrait {
|
||||
switch self.fontTraitRd.nextInt() {
|
||||
case 0: return []
|
||||
case 1: return [.italic]
|
||||
case 2: return [.bold]
|
||||
case 3: return [.underline]
|
||||
case 4: return [.undercurl]
|
||||
case 5: return [.italic, .bold]
|
||||
case 6: return [.bold, .underline]
|
||||
default: return []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private let randomSource = GKMersenneTwisterRandomSource(seed: 95749272934)
|
@ -35,7 +35,6 @@
|
||||
|
||||
#define let __auto_type const
|
||||
#define var __auto_type
|
||||
#define pun_type(t, x) (*((t *) (&(x))))
|
||||
|
||||
|
||||
static NSInteger _default_foreground = 0xFF000000;
|
||||
@ -64,7 +63,7 @@ static uv_cond_t _condition;
|
||||
|
||||
static ServerUiData *_server_ui_data;
|
||||
|
||||
static NSString *_backspace = nil;
|
||||
static NSString *_backspace = @"<BS>";
|
||||
|
||||
static bool _dirty = false;
|
||||
|
||||
@ -74,7 +73,6 @@ static NSInteger _initialHeight = 15;
|
||||
static msgpack_sbuffer flush_sbuffer;
|
||||
static msgpack_packer *flush_packer;
|
||||
|
||||
static dispatch_queue_t rpc_queue;
|
||||
|
||||
#pragma mark Helper functions
|
||||
|
||||
@ -248,8 +246,6 @@ static void server_ui_main(UIBridgeData *bridge, UI *ui) {
|
||||
msgpack_sbuffer_init(&flush_sbuffer);
|
||||
flush_packer = msgpack_packer_new(&flush_sbuffer, msgpack_sbuffer_write);
|
||||
|
||||
rpc_queue = dispatch_queue_create("rpc_queu", NULL);
|
||||
|
||||
Loop loop;
|
||||
loop_init(&loop, NULL);
|
||||
|
||||
@ -559,7 +555,7 @@ void custom_ui_start(void) {
|
||||
}
|
||||
|
||||
void custom_ui_rpcevent_subscribed() {
|
||||
dispatch_async(rpc_queue, ^{
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
[_neovim_server sendMessageWithId:NvimServerMsgIdRpcEventSubscribed
|
||||
data:NULL];
|
||||
});
|
||||
@ -636,7 +632,8 @@ void start_neovim(
|
||||
|
||||
// set $VIMRUNTIME to ${RESOURCE_PATH_OF_XPC_BUNDLE}/runtime
|
||||
let bundlePath = [NSBundle bundleForClass:[NvimServer class]].bundlePath;
|
||||
let resourcesPath = [bundlePath.stringByDeletingLastPathComponent stringByAppendingPathComponent:@"Resources"];
|
||||
let resourcesPath = [bundlePath.stringByDeletingLastPathComponent
|
||||
stringByAppendingPathComponent:@"Resources"];
|
||||
let runtimePath = [resourcesPath stringByAppendingPathComponent:@"runtime"];
|
||||
setenv("VIMRUNTIME", runtimePath.fileSystemRepresentation, true);
|
||||
|
||||
@ -660,8 +657,6 @@ void start_neovim(
|
||||
uv_cond_destroy(&_condition);
|
||||
uv_mutex_destroy(&_mutex);
|
||||
|
||||
_backspace = [[NSString alloc] initWithString:@"<BS>"];
|
||||
|
||||
send_msg_packing(NvimServerMsgIdNvimReady, ^(msgpack_packer *packer) {
|
||||
msgpack_pack_bool(packer, msg_didany > 0);
|
||||
});
|
||||
@ -788,16 +783,6 @@ void neovim_ready_for_rpcevents(void **argv) {
|
||||
|
||||
void neovim_debug1(void **argv) {
|
||||
work_async(argv, ^(NSData *data) {
|
||||
NSLog(@"normal fg: %#08X", normal_fg);
|
||||
NSLog(@"normal bg: %#08X", normal_bg);
|
||||
NSLog(@"normal sp: %#08X", normal_sp);
|
||||
|
||||
for (int i = 0; i < HLF_COUNT; i++) {
|
||||
NSLog(
|
||||
@"%s: %#08X",
|
||||
hlf_names[i],
|
||||
HlAttrsFromAttrCode(highlight_attr[i]).rgb_fg_color
|
||||
);
|
||||
}
|
||||
// noop
|
||||
});
|
||||
}
|
||||
|
@ -9,9 +9,12 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
1929B00C084F8EA5EF0BE6E2 /* NvimView+Geometry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BD896D408673954F4AA2 /* NvimView+Geometry.swift */; };
|
||||
1929B06F50B2585777FFBE48 /* NvimApiCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B002A03693B14B14BE34 /* NvimApiCommons.swift */; };
|
||||
1929B0B1A64AA449F666FCC9 /* 1.json in Resources */ = {isa = PBXBuildFile; fileRef = 1929B8619FD13BC2570CBFB2 /* 1.json */; };
|
||||
1929B14D2EBC34BCFEC78ACB /* CellAttributesCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BB19DD03ECD6ECC35F94 /* CellAttributesCollection.swift */; };
|
||||
1929B1A7CC32FD7D05646B98 /* AttributesRunDrawer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BB7E3430BD3FD88A7698 /* AttributesRunDrawer.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 */; };
|
||||
1929B36C51BCDFCCEE974EA2 /* SwiftCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B9C55A79D97272894F5D /* SwiftCommons.swift */; };
|
||||
1929B3B70C96A78FD63DE737 /* NvimView+Debug.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BDC8F32F4A0D2299B5C5 /* NvimView+Debug.swift */; };
|
||||
1929B40A751BDA2882D4FC94 /* NvimView+Objects.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B22A0CAD417EC3790F02 /* NvimView+Objects.swift */; };
|
||||
@ -28,9 +31,11 @@
|
||||
1929B7D2EB80FEA7BFBC3D2C /* Typesetter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B47330DAD129520A2273 /* Typesetter.swift */; };
|
||||
1929B83EAD32DC419FEC68DB /* CocoaCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B0C89838D8402BB80BFC /* CocoaCommons.swift */; };
|
||||
1929B90E2CFEAADE0CEE1562 /* CursorModeShape.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BA4C89E9FE90065C32F6 /* CursorModeShape.swift */; };
|
||||
1929B922396A4EE7F070299A /* PerfTester.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B114CC85D012D7477D58 /* PerfTester.swift */; };
|
||||
1929B953E76914DA984697DC /* FontUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B96A876229DA394F906E /* FontUtils.swift */; };
|
||||
1929B9A949EE85C27FF66367 /* UGrid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B9D83D7E150F518D49FE /* UGrid.swift */; };
|
||||
1929BA70C221E3C199833B8C /* UiBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B52174EC68D2974B5BAE /* UiBridge.swift */; };
|
||||
1929BA918C7AB8DC411B82D2 /* 0.json in Resources */ = {isa = PBXBuildFile; fileRef = 1929B086022A7A2C99A65A21 /* 0.json */; };
|
||||
1929BAB9A0399206FB7EBC76 /* CellAttributesCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BB19DD03ECD6ECC35F94 /* CellAttributesCollection.swift */; };
|
||||
1929BB552C9D99E9ED938759 /* CellAttributesCollectionTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B0B60CCAA00B08ACAB15 /* CellAttributesCollectionTest.swift */; };
|
||||
1929BC8495028D66F0A7D618 /* AttributesRunDrawer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BB7E3430BD3FD88A7698 /* AttributesRunDrawer.swift */; };
|
||||
@ -77,6 +82,25 @@
|
||||
4BE45C081FD2D4E3005C0A95 /* NvimServer in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B90F04F1FD2AFD3008A39E0 /* NvimServer */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
4BE45C0C1FD2DA49005C0A95 /* runtime in Resources */ = {isa = PBXBuildFile; fileRef = 4BE45C0B1FD2DA49005C0A95 /* runtime */; };
|
||||
4BEBC23A215FD19C007113C4 /* Socket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BEBC239215FD19C007113C4 /* Socket.framework */; };
|
||||
4BF01CCF2235015E00411218 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF01CCE2235015E00411218 /* AppDelegate.swift */; };
|
||||
4BF01CD12235015E00411218 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4BF01CD02235015E00411218 /* Assets.xcassets */; };
|
||||
4BF01CD42235015E00411218 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4BF01CD22235015E00411218 /* MainMenu.xib */; };
|
||||
4BF01CE42235022300411218 /* ColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BDE2C6003A6EDC02129C /* ColorUtils.swift */; };
|
||||
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 */; };
|
||||
4BF01CEC2235022300411218 /* CellAttributesCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BB19DD03ECD6ECC35F94 /* CellAttributesCollection.swift */; };
|
||||
4BF01CED223502A300411218 /* FontTrait.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B2CE622DF2B4D21D0C0E /* FontTrait.swift */; };
|
||||
4BF01CEE223502C100411218 /* CocoaCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B0C89838D8402BB80BFC /* CocoaCommons.swift */; };
|
||||
4BF01CEF223502C100411218 /* OSLogCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B39C7DCDA4E9D5220CD8 /* OSLogCommons.swift */; };
|
||||
4BF01CF0223502CC00411218 /* SwiftCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B9C55A79D97272894F5D /* SwiftCommons.swift */; };
|
||||
4BF01CF1223502D400411218 /* Defs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BF14AE831C6832659B66 /* Defs.swift */; };
|
||||
4BF01CF2223502DB00411218 /* CoreCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BAB9FFE8345228B559EC /* CoreCommons.swift */; };
|
||||
4BF01CF32235030E00411218 /* OSLogCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B39C7DCDA4E9D5220CD8 /* OSLogCommons.swift */; };
|
||||
4BF18510212DCCEA00954FE7 /* NvimView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B90F0041FD2AF59008A39E0 /* NvimView.framework */; };
|
||||
4BF18511212DCCF600954FE7 /* NvimView.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B90F0041FD2AF59008A39E0 /* NvimView.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4BF18512212DCD6E00954FE7 /* RxNeovimApi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B17E548209E3E4100265C1D /* RxNeovimApi.framework */; };
|
||||
@ -171,15 +195,20 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1929B002A03693B14B14BE34 /* NvimApiCommons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NvimApiCommons.swift; sourceTree = "<group>"; };
|
||||
1929B0522C47787B50071806 /* 2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = 2.json; sourceTree = "<group>"; };
|
||||
1929B06A73BE6DAA2679AAA2 /* Runs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Runs.swift; sourceTree = "<group>"; };
|
||||
1929B086022A7A2C99A65A21 /* 0.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = 0.json; sourceTree = "<group>"; };
|
||||
1929B0B60CCAA00B08ACAB15 /* CellAttributesCollectionTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CellAttributesCollectionTest.swift; sourceTree = "<group>"; };
|
||||
1929B0C89838D8402BB80BFC /* CocoaCommons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CocoaCommons.swift; sourceTree = "<group>"; };
|
||||
1929B114CC85D012D7477D58 /* PerfTester.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PerfTester.swift; sourceTree = "<group>"; };
|
||||
1929B22A0CAD417EC3790F02 /* NvimView+Objects.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NvimView+Objects.swift"; sourceTree = "<group>"; };
|
||||
1929B2CE622DF2B4D21D0C0E /* FontTrait.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontTrait.swift; sourceTree = "<group>"; };
|
||||
1929B39C7DCDA4E9D5220CD8 /* OSLogCommons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OSLogCommons.swift; sourceTree = "<group>"; };
|
||||
1929B47330DAD129520A2273 /* Typesetter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Typesetter.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>"; };
|
||||
1929B8619FD13BC2570CBFB2 /* 1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = 1.json; sourceTree = "<group>"; };
|
||||
1929B8E176C11DD61A8DCE95 /* RxSwiftCommons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RxSwiftCommons.swift; sourceTree = "<group>"; };
|
||||
1929B9290D503536FFDA9C49 /* MessagePackCommons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessagePackCommons.swift; sourceTree = "<group>"; };
|
||||
1929B96A876229DA394F906E /* FontUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontUtils.swift; sourceTree = "<group>"; };
|
||||
@ -237,6 +266,11 @@
|
||||
4BD8742F2014C25F0039888E /* NvimAutoCommandEvent.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NvimAutoCommandEvent.generated.swift; sourceTree = "<group>"; };
|
||||
4BE45C0B1FD2DA49005C0A95 /* runtime */ = {isa = PBXFileReference; lastKnownFileType = folder; name = runtime; path = neovim/runtime; sourceTree = "<group>"; };
|
||||
4BEBC239215FD19C007113C4 /* Socket.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Socket.framework; path = ../Carthage/Build/Mac/Socket.framework; sourceTree = "<group>"; };
|
||||
4BF01CCC2235015E00411218 /* DrawerPerf.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DrawerPerf.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4BF01CCE2235015E00411218 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
4BF01CD02235015E00411218 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
4BF01CD32235015E00411218 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
4BF01CD52235015E00411218 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
4BF1852021313EE300954FE7 /* DrawerDev.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DrawerDev.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4BF1852221313EE400954FE7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
4BF1852421313EE500954FE7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
@ -283,6 +317,13 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4BF01CC92235015E00411218 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4BF1851D21313EE300954FE7 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -347,6 +388,7 @@
|
||||
4B90F0501FD2AFD3008A39E0 /* NvimServer */,
|
||||
4B0A1B122129F49500F1E02F /* NvimViewTests */,
|
||||
4BF1852121313EE400954FE7 /* DrawerDev */,
|
||||
4BF01CCD2235015E00411218 /* DrawerPerf */,
|
||||
4B90F0051FD2AF59008A39E0 /* Products */,
|
||||
4B90F06F1FD2B9F1008A39E0 /* Frameworks */,
|
||||
);
|
||||
@ -359,6 +401,7 @@
|
||||
4B90F04F1FD2AFD3008A39E0 /* NvimServer */,
|
||||
4B0A1B112129F49500F1E02F /* NvimViewTests.xctest */,
|
||||
4BF1852021313EE300954FE7 /* DrawerDev.app */,
|
||||
4BF01CCC2235015E00411218 /* DrawerPerf.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@ -425,6 +468,22 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4BF01CCD2235015E00411218 /* DrawerPerf */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4BF01CCE2235015E00411218 /* AppDelegate.swift */,
|
||||
4BF01CD02235015E00411218 /* Assets.xcassets */,
|
||||
4BF01CD22235015E00411218 /* MainMenu.xib */,
|
||||
4BF01CD52235015E00411218 /* Info.plist */,
|
||||
1929B2CE622DF2B4D21D0C0E /* FontTrait.swift */,
|
||||
1929B114CC85D012D7477D58 /* PerfTester.swift */,
|
||||
1929B0522C47787B50071806 /* 2.json */,
|
||||
1929B8619FD13BC2570CBFB2 /* 1.json */,
|
||||
1929B086022A7A2C99A65A21 /* 0.json */,
|
||||
);
|
||||
path = DrawerPerf;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4BF1852121313EE400954FE7 /* DrawerDev */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -512,6 +571,23 @@
|
||||
productReference = 4B90F04F1FD2AFD3008A39E0 /* NvimServer */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
4BF01CCB2235015E00411218 /* DrawerPerf */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 4BF01CD92235015E00411218 /* Build configuration list for PBXNativeTarget "DrawerPerf" */;
|
||||
buildPhases = (
|
||||
4BF01CC82235015E00411218 /* Sources */,
|
||||
4BF01CC92235015E00411218 /* Frameworks */,
|
||||
4BF01CCA2235015E00411218 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = DrawerPerf;
|
||||
productName = DrawerPerf;
|
||||
productReference = 4BF01CCC2235015E00411218 /* DrawerPerf.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
4BF1851F21313EE300954FE7 /* DrawerDev */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 4BF1852D21313EE500954FE7 /* Build configuration list for PBXNativeTarget "DrawerDev" */;
|
||||
@ -535,7 +611,7 @@
|
||||
4B90EFFB1FD2AF59008A39E0 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0940;
|
||||
LastSwiftUpdateCheck = 1010;
|
||||
LastUpgradeCheck = 0930;
|
||||
ORGANIZATIONNAME = "Tae Won Ha";
|
||||
TargetAttributes = {
|
||||
@ -550,6 +626,9 @@
|
||||
4B90F04E1FD2AFD3008A39E0 = {
|
||||
CreatedOnToolsVersion = 9.1;
|
||||
};
|
||||
4BF01CCB2235015E00411218 = {
|
||||
CreatedOnToolsVersion = 10.1;
|
||||
};
|
||||
4BF1851F21313EE300954FE7 = {
|
||||
CreatedOnToolsVersion = 9.4.1;
|
||||
};
|
||||
@ -572,6 +651,7 @@
|
||||
4B90F04E1FD2AFD3008A39E0 /* NvimServer */,
|
||||
4B0A1B102129F49500F1E02F /* NvimViewTests */,
|
||||
4BF1851F21313EE300954FE7 /* DrawerDev */,
|
||||
4BF01CCB2235015E00411218 /* DrawerPerf */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@ -592,6 +672,18 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4BF01CCA2235015E00411218 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4BF01CD12235015E00411218 /* Assets.xcassets in Resources */,
|
||||
4BF01CD42235015E00411218 /* MainMenu.xib in Resources */,
|
||||
1929B326D5117A670105C209 /* 2.json in Resources */,
|
||||
1929B0B1A64AA449F666FCC9 /* 1.json in Resources */,
|
||||
1929BA918C7AB8DC411B82D2 /* 0.json in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4BF1851E21313EE300954FE7 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -705,6 +797,31 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4BF01CC82235015E00411218 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4BF01CF2223502DB00411218 /* CoreCommons.swift in Sources */,
|
||||
4BF01CF1223502D400411218 /* Defs.swift in Sources */,
|
||||
4BF01CF0223502CC00411218 /* SwiftCommons.swift in Sources */,
|
||||
4BF01CEE223502C100411218 /* CocoaCommons.swift in Sources */,
|
||||
4BF01CEF223502C100411218 /* OSLogCommons.swift in Sources */,
|
||||
4BF01CED223502A300411218 /* FontTrait.swift in Sources */,
|
||||
4BF01CE42235022300411218 /* ColorUtils.swift in Sources */,
|
||||
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 */,
|
||||
4BF01CEC2235022300411218 /* CellAttributesCollection.swift in Sources */,
|
||||
4BF01CCF2235015E00411218 /* AppDelegate.swift in Sources */,
|
||||
1929B1A7CC32FD7D05646B98 /* AttributesRunDrawer.swift in Sources */,
|
||||
1929B922396A4EE7F070299A /* PerfTester.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4BF1851C21313EE300954FE7 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@ -746,6 +863,14 @@
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
4BF01CD22235015E00411218 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
4BF01CD32235015E00411218 /* Base */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4BF1852621313EE500954FE7 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
@ -815,7 +940,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 307;
|
||||
CURRENT_PROJECT_VERSION = 308;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@ -877,7 +1002,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 307;
|
||||
CURRENT_PROJECT_VERSION = 308;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@ -906,7 +1031,7 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 307;
|
||||
DYLIB_CURRENT_VERSION = 308;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
|
||||
FRAMEWORK_VERSION = A;
|
||||
@ -928,7 +1053,7 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 307;
|
||||
DYLIB_CURRENT_VERSION = 308;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
|
||||
FRAMEWORK_VERSION = A;
|
||||
@ -1019,6 +1144,39 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
4BF01CD72235015E00411218 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
INFOPLIST_FILE = DrawerPerf/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.qvacua.DrawerPerf;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
4BF01CD82235015E00411218 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
INFOPLIST_FILE = DrawerPerf/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.qvacua.DrawerPerf;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
4BF1852B21313EE500954FE7 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@ -1088,6 +1246,15 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
4BF01CD92235015E00411218 /* Build configuration list for PBXNativeTarget "DrawerPerf" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
4BF01CD72235015E00411218 /* Debug */,
|
||||
4BF01CD82235015E00411218 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
4BF1852D21313EE500954FE7 /* Build configuration list for PBXNativeTarget "DrawerDev" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.3">
|
||||
<BuildAction>
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForRunning = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "4BF01CCB2235015E00411218"
|
||||
BuildableName = "DrawerPerf.app"
|
||||
BlueprintName = "DrawerPerf"
|
||||
ReferencedContainer = "container:NvimView.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<LaunchAction
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "4BF01CCB2235015E00411218"
|
||||
BuildableName = "DrawerPerf.app"
|
||||
BlueprintName = "DrawerPerf"
|
||||
ReferencedContainer = "container:NvimView.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<LocationScenarioReference
|
||||
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
|
||||
referenceType = "1">
|
||||
</LocationScenarioReference>
|
||||
</LaunchAction>
|
||||
</Scheme>
|
@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.7">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "4BF01CCB2235015E00411218"
|
||||
BuildableName = "DrawerPerf.app"
|
||||
BlueprintName = "DrawerPerf"
|
||||
ReferencedContainer = "container:NvimView.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "4BF01CCB2235015E00411218"
|
||||
BuildableName = "DrawerPerf.app"
|
||||
BlueprintName = "DrawerPerf"
|
||||
ReferencedContainer = "container:NvimView.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
<LocationScenarioReference
|
||||
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
|
||||
referenceType = "1">
|
||||
</LocationScenarioReference>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "4BF01CCB2235015E00411218"
|
||||
BuildableName = "DrawerPerf.app"
|
||||
BlueprintName = "DrawerPerf"
|
||||
ReferencedContainer = "container:NvimView.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
@ -15,9 +15,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.26.4</string>
|
||||
<string>0.26.5</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>307</string>
|
||||
<string>308</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2017 Tae Won Ha. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
@ -7,11 +7,15 @@ import Cocoa
|
||||
|
||||
extension NvimView {
|
||||
|
||||
override public func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation {
|
||||
override public func draggingEntered(
|
||||
_ sender: NSDraggingInfo
|
||||
) -> NSDragOperation {
|
||||
return isFile(sender: sender) ? .copy : NSDragOperation()
|
||||
}
|
||||
|
||||
override public func draggingUpdated(_ sender: NSDraggingInfo) -> NSDragOperation {
|
||||
override public func draggingUpdated(
|
||||
_ sender: NSDraggingInfo
|
||||
) -> NSDragOperation {
|
||||
return isFile(sender: sender) ? .copy : NSDragOperation()
|
||||
}
|
||||
|
||||
@ -20,16 +24,15 @@ extension NvimView {
|
||||
return false
|
||||
}
|
||||
|
||||
guard let paths = sender.draggingPasteboard.propertyList(
|
||||
forType: NSPasteboard.PasteboardType(String(kUTTypeFileURL))
|
||||
) as? [String] else {
|
||||
return false
|
||||
}
|
||||
guard let urls = sender.draggingPasteboard
|
||||
.readObjects(forClasses: [NSURL.self]) as? [URL] else { return false }
|
||||
|
||||
self.open(urls: paths.map { URL(fileURLWithPath: $0) })
|
||||
self.open(urls: urls)
|
||||
.subscribeOn(self.scheduler)
|
||||
.subscribe(onError: { error in
|
||||
self.eventsSubject.onNext(.apiError(msg: "\(paths) could not be opened.", cause: error))
|
||||
self.eventsSubject.onNext(
|
||||
.apiError(msg: "\(urls) could not be opened.", cause: error)
|
||||
)
|
||||
})
|
||||
.disposed(by: self.disposeBag)
|
||||
|
||||
@ -38,5 +41,7 @@ extension NvimView {
|
||||
}
|
||||
|
||||
private func isFile(sender: NSDraggingInfo) -> Bool {
|
||||
return (sender.draggingPasteboard.types?.contains(NSPasteboard.PasteboardType(String(kUTTypeFileURL)))) ?? false
|
||||
return (sender.draggingPasteboard.types?.contains(
|
||||
NSPasteboard.PasteboardType(String(kUTTypeFileURL))
|
||||
)) ?? false
|
||||
}
|
||||
|
@ -337,9 +337,9 @@ public class NvimView: NSView,
|
||||
}
|
||||
|
||||
@IBAction public func debug1(_ sender: Any?) {
|
||||
self.log.debug("DEBUG 1 - Start")
|
||||
// noop
|
||||
self.log.debug("DEBUG 1 - End")
|
||||
#if DEBUG
|
||||
do { try self.ugrid.dump() } catch { self.log.error("Could not dump UGrid: \(error)") }
|
||||
#endif
|
||||
}
|
||||
|
||||
// MARK: - Internal
|
||||
|
@ -22,10 +22,12 @@ extension PrimitiveSequence where Element == Never, TraitType == CompletableTrai
|
||||
|
||||
let disposable = self.subscribe(onCompleted: {
|
||||
onCompleted?()
|
||||
condition.lock()
|
||||
trigger = true
|
||||
broadcast(condition)
|
||||
}, onError: { error in
|
||||
onError?(error)
|
||||
condition.lock()
|
||||
trigger = true
|
||||
err = error
|
||||
broadcast(condition)
|
||||
@ -57,9 +59,11 @@ extension PrimitiveSequence where TraitType == SingleTrait {
|
||||
|
||||
let disposable = self.subscribe(onSuccess: { result in
|
||||
value = result
|
||||
condition.lock()
|
||||
trigger = true
|
||||
broadcast(condition)
|
||||
}, onError: { error in
|
||||
condition.lock()
|
||||
trigger = true
|
||||
broadcast(condition)
|
||||
})
|
||||
@ -83,7 +87,6 @@ extension PrimitiveSequence where TraitType == SingleTrait {
|
||||
}
|
||||
|
||||
private func broadcast(_ condition: NSCondition) {
|
||||
condition.lock()
|
||||
defer { condition.unlock() }
|
||||
condition.broadcast()
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import os
|
||||
|
||||
final class SimpleCache<K: Hashable, V> {
|
||||
|
||||
|
@ -149,8 +149,8 @@ final class Typesetter {
|
||||
return runs.flatMap { $0 }
|
||||
}
|
||||
|
||||
private let logger = OSLog(subsystem: Defs.loggerSubsystem,
|
||||
category: Defs.LoggerCategory.view)
|
||||
private let log = OSLog(subsystem: Defs.loggerSubsystem,
|
||||
category: Defs.LoggerCategory.view)
|
||||
|
||||
private func ctRuns(
|
||||
from utf16Chars: Array<Unicode.UTF16.CodeUnit>,
|
||||
|
@ -6,7 +6,7 @@
|
||||
import Foundation
|
||||
import os
|
||||
|
||||
struct UCell {
|
||||
struct UCell: Codable {
|
||||
|
||||
var string: String
|
||||
var attrId: Int
|
||||
@ -20,7 +20,7 @@ struct UCell {
|
||||
}
|
||||
}
|
||||
|
||||
final class UGrid: CustomStringConvertible {
|
||||
final class UGrid: CustomStringConvertible, Codable {
|
||||
|
||||
private(set) var cursorPosition = Position.zero
|
||||
|
||||
@ -28,6 +28,45 @@ final class UGrid: CustomStringConvertible {
|
||||
|
||||
private(set) var cells: [[UCell]] = []
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
|
||||
case width
|
||||
case height
|
||||
case cells
|
||||
}
|
||||
|
||||
init() {
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
let width = try values.decode(Int.self, forKey: .width)
|
||||
let height = try values.decode(Int.self, forKey: .height)
|
||||
self.size = Size(width: width, height: height)
|
||||
|
||||
self.cells = try values.decode([[UCell]].self, forKey: .cells)
|
||||
}
|
||||
|
||||
func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
try container.encode(self.size.width, forKey: .width)
|
||||
try container.encode(self.size.height, forKey: .height)
|
||||
|
||||
try container.encode(self.cells, forKey: .cells)
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
func dump() throws {
|
||||
let encoder = JSONEncoder()
|
||||
encoder.outputFormatting = .prettyPrinted
|
||||
|
||||
let data = try encoder.encode(self)
|
||||
try data.write(to: URL(fileURLWithPath: "/tmp/ugrid.dump.json"))
|
||||
}
|
||||
#endif
|
||||
|
||||
var description: String {
|
||||
let result = "UGrid.flatCharIndex:\n" + self.cells.reduce("") { result, row in
|
||||
return result + "(\(row[0].flatCharIndex ... row[self.size.width - 1].flatCharIndex)), "
|
||||
|
@ -15,8 +15,8 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.26.4</string>
|
||||
<string>0.26.5</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>307</string>
|
||||
<string>308</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -3,7 +3,7 @@ VimR — Neovim Refined
|
||||
|
||||
![App Icon](https://raw.github.com/qvacua/vimr/master/resources/vimr-app-icon.png)
|
||||
|
||||
[Download](https://github.com/qvacua/vimr/releases) • <http://vimr.org>
|
||||
[Download](https://github.com/qvacua/vimr/releases) • [Documentation](https://github.com/qvacua/vimr/wiki) • <http://vimr.org>
|
||||
|
||||
[![Bountysource](https://www.bountysource.com/badge/team?team_id=933&style=raised)](https://www.bountysource.com/teams/vimr?utm_source=VimR%20%E2%80%94%20Vim%20Refined&utm_medium=shield&utm_campaign=raised) [![Chat at https://gitter.im/vimr/vimr](https://badges.gitter.im/vimr/vimr.svg)](https://gitter.im/vimr/vimr?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Stories in Ready](https://badge.waffle.io/qvacua/vimr.svg?label=ready&title=Ready)](http://waffle.io/qvacua/vimr)
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
1929B04CE8ECBD75CBBB0991 /* StringCommonsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B5D45C9792BBE76B8AFF /* StringCommonsTest.swift */; };
|
||||
1929B05B9D664052EC2D23EF /* FileOutlineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BCE3E156C06EDF1F2806 /* FileOutlineView.swift */; };
|
||||
1929B08C6230B9C5AB72DAF1 /* Pref128ToCurrentConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B5046239709E33516F5C /* Pref128ToCurrentConverter.swift */; };
|
||||
1929B0C7150100A84FBDB8BF /* ShortcutItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BF230875DED6CD7AB3EB /* ShortcutItem.swift */; };
|
||||
1929B0E0C3BC59F52713D5A2 /* FoundationCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B9AF20D7BD6E5C975128 /* FoundationCommons.swift */; };
|
||||
1929B0F599D1F62C7BE53D2C /* HttpServerMiddleware.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B1DC584C89C477E83FA2 /* HttpServerMiddleware.swift */; };
|
||||
@ -116,6 +115,7 @@
|
||||
4B64239A1D8EFE3000FC78C8 /* WorkspaceTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6423991D8EFE3000FC78C8 /* WorkspaceTool.swift */; };
|
||||
4B6A70941D60E04200E12030 /* AppKitCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A70931D60E04200E12030 /* AppKitCommons.swift */; };
|
||||
4B6A70961D6100E300E12030 /* SwiftCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A70951D6100E300E12030 /* SwiftCommons.swift */; };
|
||||
4B6DFB3A22366D140066BB43 /* OSLogCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BE867BD8F0ED0246CC94 /* OSLogCommons.swift */; };
|
||||
4B9433DC20B95EC6005807BA /* MacVim-bsh.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4B9433A120B95EC1005807BA /* MacVim-bsh.icns */; };
|
||||
4B9433DD20B95EC6005807BA /* MacVim-generic.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4B9433A220B95EC1005807BA /* MacVim-generic.icns */; };
|
||||
4B9433DE20B95EC6005807BA /* MacVim-dylan.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4B9433A320B95EC1005807BA /* MacVim-dylan.icns */; };
|
||||
@ -317,7 +317,6 @@
|
||||
1929B365A6434354B568B04F /* FileMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileMonitor.swift; sourceTree = "<group>"; };
|
||||
1929B457B9D0FA4D21F3751E /* UiRootReducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UiRootReducer.swift; sourceTree = "<group>"; };
|
||||
1929B49E6924847AD085C8C9 /* PrefWindowReducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrefWindowReducer.swift; sourceTree = "<group>"; };
|
||||
1929B5046239709E33516F5C /* Pref128ToCurrentConverter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pref128ToCurrentConverter.swift; sourceTree = "<group>"; };
|
||||
1929B56C8ED31834BA9D8543 /* FileItemUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileItemUtils.swift; sourceTree = "<group>"; };
|
||||
1929B5D45C9792BBE76B8AFF /* StringCommonsTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringCommonsTest.swift; sourceTree = "<group>"; };
|
||||
1929B617C229B19DB3E987B8 /* PreviewMiddleware.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreviewMiddleware.swift; sourceTree = "<group>"; };
|
||||
@ -922,7 +921,6 @@
|
||||
1929BADEB143008EFA6F3318 /* NetUtils.h */,
|
||||
1929B6AD3396160AA2C46919 /* Debouncer.swift */,
|
||||
1929B8EF9A9F5ACC175452BD /* PreviewUtils.swift */,
|
||||
1929B5046239709E33516F5C /* Pref128ToCurrentConverter.swift */,
|
||||
1929B56C8ED31834BA9D8543 /* FileItemUtils.swift */,
|
||||
1929B8241CDE58F7AAF89AE4 /* PrefUtils.swift */,
|
||||
);
|
||||
@ -1176,7 +1174,6 @@
|
||||
1929B990A143763A56CFCED0 /* PrefMiddleware.swift in Sources */,
|
||||
1929BA76A1D97D8226F7CFB1 /* Debouncer.swift in Sources */,
|
||||
1929B71610FF1DC6E459BA49 /* PreviewUtils.swift in Sources */,
|
||||
1929B08C6230B9C5AB72DAF1 /* Pref128ToCurrentConverter.swift in Sources */,
|
||||
1929B94083273D4B321AD848 /* FileItemUtils.swift in Sources */,
|
||||
1929BFDE22D155F7C4B19E96 /* HtmlPreviewTool.swift in Sources */,
|
||||
1929B4B00D7BB191A9A6532D /* HtmlPreviewToolReducer.swift in Sources */,
|
||||
@ -1211,6 +1208,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4B6DFB3A22366D140066BB43 /* OSLogCommons.swift in Sources */,
|
||||
4B96FB3B1EBBC56F00E4E164 /* FileItemIgnorePattern.swift in Sources */,
|
||||
4B96FB3C1EBBC56F00E4E164 /* FileUtils.swift in Sources */,
|
||||
4B96FB3D1EBBC56F00E4E164 /* Matcher.swift in Sources */,
|
||||
@ -1330,7 +1328,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 307;
|
||||
CURRENT_PROJECT_VERSION = 308;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@ -1388,7 +1386,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 307;
|
||||
CURRENT_PROJECT_VERSION = 308;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
@ -45,11 +45,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
|
||||
initialAppState = state
|
||||
} else {
|
||||
if let oldDict = UserDefaults.standard.value(forKey: PrefMiddleware.lastCompatibleVersion) as? [String: Any] {
|
||||
initialAppState = Pref128ToCurrentConverter.appState(from: oldDict)
|
||||
} else {
|
||||
initialAppState = .default
|
||||
}
|
||||
initialAppState = .default
|
||||
}
|
||||
|
||||
initialAppState.mainWindowTemplate.htmlPreview.server = Marked(
|
||||
|
@ -164,7 +164,13 @@ class FileOutlineView: NSOutlineView,
|
||||
}
|
||||
|
||||
func unbindTreeController() {
|
||||
// Forbid addition and removal now.
|
||||
// See comment in FileOutlineView.handleRemoval.
|
||||
self.treeController.isEditable = false
|
||||
|
||||
self.treeController.unbind(.contentArray)
|
||||
self.unbind(.content)
|
||||
self.unbind(.selectionIndexPaths)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
@ -260,6 +266,9 @@ class FileOutlineView: NSOutlineView,
|
||||
private func handleAddition(
|
||||
changeTreeNode: NSTreeNode, newChildUrls: Set<URL>
|
||||
) {
|
||||
// See comment in FileOutlineView.handleRemoval.
|
||||
guard self.treeController.isEditable else { return }
|
||||
|
||||
let existingUrls = changeTreeNode.children?
|
||||
.compactMap { $0.node?.url } ?? []
|
||||
let newNodes = newChildUrls
|
||||
@ -275,6 +284,13 @@ class FileOutlineView: NSOutlineView,
|
||||
private func handleRemoval(
|
||||
changeTreeNode: NSTreeNode, newChildUrls: Set<URL>
|
||||
) {
|
||||
// FileOutlineView is deinit'ed a bit after Neovim is closed.
|
||||
// If Neovim deletes for example a temporary file, then handleRemoval is
|
||||
// called after the self.content is frozen. Thus, we make the controller
|
||||
// not editable when unbinding, see FileOutlineView.unbindTreeController,
|
||||
// and check here before modifying.
|
||||
guard self.treeController.isEditable else { return }
|
||||
|
||||
let indexPathsToRemove =
|
||||
changeTreeNode.children?
|
||||
.filter { child in
|
||||
@ -283,6 +299,15 @@ class FileOutlineView: NSOutlineView,
|
||||
}
|
||||
.map { $0.indexPath } ?? []
|
||||
|
||||
changeTreeNode.children?
|
||||
.filter { child in
|
||||
guard let url = child.node?.url else { return true }
|
||||
return newChildUrls.contains(url) == false
|
||||
}
|
||||
.forEach { treeNode in
|
||||
self.log.default(treeNode.node)
|
||||
}
|
||||
|
||||
self.treeController.removeObjects(
|
||||
atArrangedObjectIndexPaths: indexPathsToRemove
|
||||
)
|
||||
@ -317,6 +342,9 @@ class FileOutlineView: NSOutlineView,
|
||||
}
|
||||
|
||||
private func reloadRoot() {
|
||||
// See comment in FileOutlineView.handleRemoval.
|
||||
guard self.treeController.isEditable else { return }
|
||||
|
||||
let children = self.childNodes(for: self.root)
|
||||
|
||||
self.root.children = children
|
||||
|
@ -1224,7 +1224,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.26.4</string>
|
||||
<string>0.26.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@ -1241,7 +1241,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>307</string>
|
||||
<string>308</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.productivity</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
@ -74,6 +74,10 @@ class Matcher {
|
||||
if pchars[pidx] == tchar {
|
||||
result += 1
|
||||
pidx = pchars.index(after: pidx)
|
||||
|
||||
if pidx == pchars.endIndex {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,599 +0,0 @@
|
||||
/**
|
||||
* Tae Won Ha - http://taewon.de - @hataewon
|
||||
* See LICENSE
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
|
||||
class Pref128ToCurrentConverter {
|
||||
|
||||
static func appState(from oldDict: [String: Any]) -> AppState {
|
||||
guard let prefData = PrefData(dict: oldDict) else {
|
||||
return .default
|
||||
}
|
||||
|
||||
var appState = AppState.default
|
||||
|
||||
appState.openNewMainWindowOnLaunch = prefData.general.openNewWindowWhenLaunching
|
||||
appState.openNewMainWindowOnReactivation = prefData.general.openNewWindowOnReactivation
|
||||
|
||||
appState.useSnapshotUpdate = prefData.advanced.useSnapshotUpdateChannel
|
||||
|
||||
appState.openQuickly.ignorePatterns = prefData.general.ignorePatterns
|
||||
|
||||
appState.mainWindowTemplate.useInteractiveZsh = prefData.advanced.useInteractiveZsh
|
||||
appState.mainWindowTemplate.isAllToolsVisible = prefData.mainWindow.isAllToolsVisible
|
||||
appState.mainWindowTemplate.isToolButtonsVisible = prefData.mainWindow.isAllToolsVisible
|
||||
|
||||
appState.mainWindowTemplate.appearance.font = prefData.appearance.editorFont
|
||||
appState.mainWindowTemplate.appearance.usesLigatures = prefData.appearance.editorUsesLigatures
|
||||
appState.mainWindowTemplate.appearance.linespacing = prefData.appearance.editorLinespacing
|
||||
|
||||
let toolPrefData = prefData.mainWindow.toolPrefDatas
|
||||
|
||||
guard let fileBrowserData = toolPrefData.first(where: { $0.identifier == .fileBrowser }) else {
|
||||
return .default
|
||||
}
|
||||
|
||||
appState.mainWindowTemplate.tools[.fileBrowser] = WorkspaceToolState(location: fileBrowserData.location,
|
||||
dimension: fileBrowserData.dimension,
|
||||
open: fileBrowserData.isVisible)
|
||||
appState.mainWindowTemplate.fileBrowserShowHidden = (fileBrowserData.toolData as! FileBrowserData).isShowHidden
|
||||
|
||||
|
||||
guard let previewData = toolPrefData.first(where: { $0.identifier == .preview }) else {
|
||||
return .default
|
||||
}
|
||||
|
||||
guard let markdownData = (previewData.toolData as? PreviewComponent.PrefData)?
|
||||
.rendererDatas[MarkdownRenderer.identifier] as? MarkdownRenderer.PrefData
|
||||
else {
|
||||
return .default
|
||||
}
|
||||
|
||||
appState.mainWindowTemplate.tools[.preview] = WorkspaceToolState(location: previewData.location,
|
||||
dimension: previewData.dimension,
|
||||
open: previewData.isVisible)
|
||||
appState.mainWindowTemplate.previewTool.isReverseSearchAutomatically = markdownData.isReverseSearchAutomatically
|
||||
appState.mainWindowTemplate.previewTool.isForwardSearchAutomatically = markdownData.isForwardSearchAutomatically
|
||||
appState.mainWindowTemplate.previewTool.isRefreshOnWrite = markdownData.isRefreshOnWrite
|
||||
|
||||
guard let openedFilesData = toolPrefData.first(where: { $0.identifier == .bufferList }) else {
|
||||
return .default
|
||||
}
|
||||
|
||||
appState.mainWindowTemplate.tools[.buffersList] = WorkspaceToolState(location: openedFilesData.location,
|
||||
dimension: openedFilesData.dimension,
|
||||
open: openedFilesData.isVisible)
|
||||
|
||||
return appState
|
||||
}
|
||||
}
|
||||
|
||||
private protocol StandardPrefData {
|
||||
|
||||
init?(dict: [String: Any])
|
||||
|
||||
func dict() -> [String: Any]
|
||||
}
|
||||
|
||||
private struct EmptyPrefData: StandardPrefData {
|
||||
|
||||
static let `default` = EmptyPrefData()
|
||||
|
||||
init() {}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
self.init()
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [:]
|
||||
}
|
||||
}
|
||||
|
||||
private struct PrefData: StandardPrefData {
|
||||
|
||||
private static let general = "general"
|
||||
private static let appearance = "appearance"
|
||||
private static let advanced = "advanced"
|
||||
private static let mainWindow = "mainWindow"
|
||||
|
||||
static let `default` = PrefData(general: .default, appearance: .default, advanced: .default, mainWindow: .default)
|
||||
|
||||
var general: GeneralPrefData
|
||||
var appearance: AppearancePrefData
|
||||
var advanced: AdvancedPrefData
|
||||
|
||||
var mainWindow: MainWindowPrefData
|
||||
|
||||
init(general: GeneralPrefData,
|
||||
appearance: AppearancePrefData,
|
||||
advanced: AdvancedPrefData,
|
||||
mainWindow: MainWindowPrefData) {
|
||||
self.general = general
|
||||
self.appearance = appearance
|
||||
self.advanced = advanced
|
||||
self.mainWindow = mainWindow
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
guard let generalDict: [String: Any] = PrefUtils.value(from: dict, for: PrefData.general),
|
||||
let appearanceDict: [String: Any] = PrefUtils.value(from: dict, for: PrefData.appearance),
|
||||
let advancedDict: [String: Any] = PrefUtils.value(from: dict, for: PrefData.advanced),
|
||||
let mainWindowDict: [String: Any] = PrefUtils.value(from: dict, for: PrefData.mainWindow)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let general = GeneralPrefData(dict: generalDict),
|
||||
let appearance = AppearancePrefData(dict: appearanceDict),
|
||||
let advanced = AdvancedPrefData(dict: advancedDict),
|
||||
let mainWindow = MainWindowPrefData(dict: mainWindowDict)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.init(general: general, appearance: appearance, advanced: advanced, mainWindow: mainWindow)
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
PrefData.general: self.general.dict(),
|
||||
PrefData.appearance: self.appearance.dict(),
|
||||
PrefData.advanced: self.advanced.dict(),
|
||||
PrefData.mainWindow: self.mainWindow.dict(),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
private struct GeneralPrefData: Equatable, StandardPrefData {
|
||||
|
||||
private static let openNewWindowWhenLaunching = "open-new-window-when-launching"
|
||||
private static let openNewWindowOnReactivation = "open-new-window-on-reactivation"
|
||||
private static let ignorePatterns = "ignore-patterns"
|
||||
|
||||
private static let defaultIgnorePatterns = Set(
|
||||
[ "*/.git", "*.o", "*.d", "*.dia" ].map(FileItemIgnorePattern.init)
|
||||
)
|
||||
|
||||
static func ==(left: GeneralPrefData, right: GeneralPrefData) -> Bool {
|
||||
return left.openNewWindowWhenLaunching == right.openNewWindowWhenLaunching
|
||||
&& left.openNewWindowOnReactivation == right.openNewWindowOnReactivation
|
||||
&& left.ignorePatterns == right.ignorePatterns
|
||||
}
|
||||
|
||||
static let `default` = GeneralPrefData(openNewWindowWhenLaunching: true,
|
||||
openNewWindowOnReactivation: true,
|
||||
ignorePatterns: GeneralPrefData.defaultIgnorePatterns)
|
||||
|
||||
var openNewWindowWhenLaunching: Bool
|
||||
var openNewWindowOnReactivation: Bool
|
||||
var ignorePatterns: Set<FileItemIgnorePattern>
|
||||
|
||||
init(openNewWindowWhenLaunching: Bool,
|
||||
openNewWindowOnReactivation: Bool,
|
||||
ignorePatterns: Set<FileItemIgnorePattern>)
|
||||
{
|
||||
self.openNewWindowWhenLaunching = openNewWindowWhenLaunching
|
||||
self.openNewWindowOnReactivation = openNewWindowOnReactivation
|
||||
self.ignorePatterns = ignorePatterns
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
guard let openNewWinWhenLaunching = PrefUtils.bool(from: dict, for: GeneralPrefData.openNewWindowWhenLaunching),
|
||||
let openNewWinOnReactivation = PrefUtils.bool(from: dict, for: GeneralPrefData.openNewWindowOnReactivation),
|
||||
let ignorePatternsStr = dict[GeneralPrefData.ignorePatterns] as? String
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.init(openNewWindowWhenLaunching: openNewWinWhenLaunching,
|
||||
openNewWindowOnReactivation: openNewWinOnReactivation,
|
||||
ignorePatterns: PrefUtils.ignorePatterns(fromString: ignorePatternsStr))
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
GeneralPrefData.openNewWindowWhenLaunching: self.openNewWindowWhenLaunching,
|
||||
GeneralPrefData.openNewWindowOnReactivation: self.openNewWindowOnReactivation,
|
||||
GeneralPrefData.ignorePatterns: PrefUtils.ignorePatternString(fromSet: self.ignorePatterns),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
private struct AppearancePrefData: Equatable, StandardPrefData {
|
||||
|
||||
private static let editorFontName = "editor-font-name"
|
||||
private static let editorFontSize = "editor-font-size"
|
||||
private static let editorLinespacing = "editor-linespacing"
|
||||
private static let editorUsesLigatures = "editor-uses-ligatures"
|
||||
|
||||
static func ==(left: AppearancePrefData, right: AppearancePrefData) -> Bool {
|
||||
return left.editorUsesLigatures == right.editorUsesLigatures
|
||||
&& left.editorFont.isEqual(to: right.editorFont)
|
||||
&& left.editorLinespacing == right.editorLinespacing
|
||||
}
|
||||
|
||||
static let `default` = AppearancePrefData(editorFont: NvimView.defaultFont,
|
||||
editorLinespacing: NvimView.defaultLinespacing,
|
||||
editorUsesLigatures: false)
|
||||
|
||||
var editorFont: NSFont
|
||||
var editorLinespacing: CGFloat
|
||||
var editorUsesLigatures: Bool
|
||||
|
||||
init(editorFont: NSFont, editorLinespacing: CGFloat, editorUsesLigatures: Bool) {
|
||||
self.editorFont = editorFont
|
||||
self.editorLinespacing = editorLinespacing
|
||||
self.editorUsesLigatures = editorUsesLigatures
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
guard let editorFontName = dict[AppearancePrefData.editorFontName] as? String,
|
||||
let fEditorFontSize = PrefUtils.float(from: dict, for: AppearancePrefData.editorFontSize),
|
||||
let fEditorLinespacing = PrefUtils.float(from: dict, for: AppearancePrefData.editorLinespacing),
|
||||
let editorUsesLigatures = PrefUtils.bool(from: dict, for: AppearancePrefData.editorUsesLigatures)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.init(editorFont: PrefUtils.saneFont(editorFontName, fontSize: CGFloat(fEditorFontSize)),
|
||||
editorLinespacing: CGFloat(fEditorLinespacing),
|
||||
editorUsesLigatures: editorUsesLigatures)
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
AppearancePrefData.editorFontName: self.editorFont.fontName,
|
||||
AppearancePrefData.editorFontSize: Float(self.editorFont.pointSize),
|
||||
AppearancePrefData.editorLinespacing: Float(self.editorLinespacing),
|
||||
AppearancePrefData.editorUsesLigatures: self.editorUsesLigatures,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
private struct AdvancedPrefData: Equatable, StandardPrefData {
|
||||
|
||||
private static let useSnapshotUpdateChannel = "use-snapshot-update-channel"
|
||||
private static let useInteractiveZsh = "use-interactive-zsh"
|
||||
|
||||
static func ==(left: AdvancedPrefData, right: AdvancedPrefData) -> Bool {
|
||||
return left.useSnapshotUpdateChannel == right.useSnapshotUpdateChannel
|
||||
&& left.useInteractiveZsh == right.useInteractiveZsh
|
||||
}
|
||||
|
||||
static let `default` = AdvancedPrefData(useSnapshotUpdateChannel: false, useInteractiveZsh: false)
|
||||
|
||||
let useSnapshotUpdateChannel: Bool
|
||||
let useInteractiveZsh: Bool
|
||||
|
||||
init(useSnapshotUpdateChannel: Bool, useInteractiveZsh: Bool) {
|
||||
self.useSnapshotUpdateChannel = useSnapshotUpdateChannel
|
||||
self.useInteractiveZsh = useInteractiveZsh
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
guard let useSnapshot = PrefUtils.bool(from: dict, for: AdvancedPrefData.useSnapshotUpdateChannel),
|
||||
let useInteractiveZsh = PrefUtils.bool(from: dict, for: AdvancedPrefData.useInteractiveZsh)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.init(useSnapshotUpdateChannel: useSnapshot, useInteractiveZsh: useInteractiveZsh)
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
AdvancedPrefData.useSnapshotUpdateChannel: self.useSnapshotUpdateChannel,
|
||||
AdvancedPrefData.useInteractiveZsh: self.useInteractiveZsh,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
private enum ToolIdentifier: String {
|
||||
|
||||
case fileBrowser = "com.qvacua.vimr.tool.file-browser"
|
||||
case bufferList = "com.qvacua.vimr.tool.buffer-list"
|
||||
case preview = "com.qvacua.vimr.tool.preview"
|
||||
|
||||
static let all = [ fileBrowser, bufferList, preview ]
|
||||
}
|
||||
|
||||
private struct MainWindowPrefData: StandardPrefData {
|
||||
|
||||
private static let isAllToolsVisible = "is-all-tools-visible"
|
||||
private static let isToolButtonsVisible = "is-tool-buttons-visible"
|
||||
private static let toolPrefDatas = "tool-pref-datas"
|
||||
|
||||
static let `default` = MainWindowPrefData(isAllToolsVisible: true,
|
||||
isToolButtonsVisible: true,
|
||||
toolPrefDatas: [
|
||||
ToolPrefData.defaults[.fileBrowser]!,
|
||||
ToolPrefData.defaults[.bufferList]!,
|
||||
ToolPrefData.defaults[.preview]!,
|
||||
])
|
||||
|
||||
var isAllToolsVisible: Bool
|
||||
var isToolButtonsVisible: Bool
|
||||
var toolPrefDatas: [ToolPrefData]
|
||||
|
||||
init(isAllToolsVisible: Bool, isToolButtonsVisible: Bool, toolPrefDatas: [ToolPrefData]) {
|
||||
self.isAllToolsVisible = isAllToolsVisible
|
||||
self.isToolButtonsVisible = isToolButtonsVisible
|
||||
self.toolPrefDatas = toolPrefDatas
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
|
||||
guard let isAllToolsVisible = PrefUtils.bool(from: dict, for: MainWindowPrefData.isAllToolsVisible),
|
||||
let isToolButtonsVisible = PrefUtils.bool(from: dict, for: MainWindowPrefData.isToolButtonsVisible),
|
||||
let toolDataDicts = dict[MainWindowPrefData.toolPrefDatas] as? [[String: Any]]
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Add default tool pref data for missing identifiers.
|
||||
let toolDatas = toolDataDicts.compactMap { ToolPrefData(dict: $0) }
|
||||
let missingToolDatas = Set(ToolIdentifier.all)
|
||||
.subtracting(toolDatas.map { $0.identifier })
|
||||
.compactMap { ToolPrefData.defaults[$0] }
|
||||
|
||||
self.init(isAllToolsVisible: isAllToolsVisible,
|
||||
isToolButtonsVisible: isToolButtonsVisible,
|
||||
toolPrefDatas: [toolDatas, missingToolDatas].flatMap { $0 })
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
MainWindowPrefData.isAllToolsVisible: self.isAllToolsVisible,
|
||||
MainWindowPrefData.isToolButtonsVisible: self.isToolButtonsVisible,
|
||||
MainWindowPrefData.toolPrefDatas: self.toolPrefDatas.map { $0.dict() },
|
||||
]
|
||||
}
|
||||
|
||||
func toolPrefData(for identifier: ToolIdentifier) -> ToolPrefData {
|
||||
guard let data = self.toolPrefDatas.first(where: { $0.identifier == identifier }) else {
|
||||
preconditionFailure("[ERROR] No tool for \(identifier) found!")
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
private struct ToolPrefData: StandardPrefData {
|
||||
|
||||
private static let identifier = "identifier"
|
||||
private static let location = "location"
|
||||
private static let isVisible = "is-visible"
|
||||
private static let dimension = "dimension"
|
||||
private static let toolData = "tool-data"
|
||||
|
||||
static let defaults: [ToolIdentifier: ToolPrefData] = [
|
||||
.fileBrowser: ToolPrefData(identifier: .fileBrowser,
|
||||
location: .left,
|
||||
isVisible: true,
|
||||
dimension: 200,
|
||||
toolData: FileBrowserData.default),
|
||||
.bufferList: ToolPrefData(identifier: .bufferList,
|
||||
location: .left,
|
||||
isVisible: false,
|
||||
dimension: 200,
|
||||
toolData: EmptyPrefData.default),
|
||||
.preview: ToolPrefData(identifier: .preview,
|
||||
location: .right,
|
||||
isVisible: false,
|
||||
dimension: 300,
|
||||
toolData: PreviewComponent.PrefData.default),
|
||||
]
|
||||
|
||||
var identifier: ToolIdentifier
|
||||
var location: WorkspaceBarLocation
|
||||
var isVisible: Bool
|
||||
var dimension: CGFloat
|
||||
var toolData: StandardPrefData
|
||||
|
||||
init(identifier: ToolIdentifier,
|
||||
location: WorkspaceBarLocation,
|
||||
isVisible: Bool,
|
||||
dimension: CGFloat,
|
||||
toolData: StandardPrefData = EmptyPrefData.default) {
|
||||
self.identifier = identifier
|
||||
self.location = location
|
||||
self.isVisible = isVisible
|
||||
self.dimension = dimension
|
||||
self.toolData = toolData
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
ToolPrefData.identifier: self.identifier.rawValue,
|
||||
ToolPrefData.location: self.location.rawValue,
|
||||
ToolPrefData.isVisible: self.isVisible,
|
||||
ToolPrefData.dimension: Float(self.dimension),
|
||||
ToolPrefData.toolData: self.toolData.dict()
|
||||
]
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
guard let identifierRawValue = dict[ToolPrefData.identifier] as? String,
|
||||
let locationRawValue = dict[ToolPrefData.location] as? String,
|
||||
let isVisible = PrefUtils.bool(from: dict, for: ToolPrefData.isVisible),
|
||||
let fDimension = PrefUtils.float(from: dict, for: ToolPrefData.dimension),
|
||||
let toolDataDict = PrefUtils.dict(from: dict, for: ToolPrefData.toolData)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let identifier = ToolIdentifier(rawValue: identifierRawValue),
|
||||
let location = WorkspaceBarLocation(rawValue: locationRawValue)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let toolData: StandardPrefData
|
||||
switch identifier {
|
||||
case .fileBrowser:
|
||||
toolData = FileBrowserData(dict: toolDataDict) ?? FileBrowserData.default
|
||||
case .preview:
|
||||
toolData = PreviewComponent.PrefData(dict: toolDataDict) ?? PreviewComponent.PrefData.default
|
||||
default:
|
||||
toolData = EmptyPrefData.default
|
||||
}
|
||||
|
||||
self.init(identifier: identifier,
|
||||
location: location,
|
||||
isVisible: isVisible,
|
||||
dimension: CGFloat(fDimension),
|
||||
toolData: toolData)
|
||||
}
|
||||
}
|
||||
|
||||
private class PreviewComponent {
|
||||
|
||||
struct PrefData: StandardPrefData {
|
||||
|
||||
private static let rendererDatas = "renderer-datas"
|
||||
|
||||
private static let rendererPrefDataFns = [
|
||||
MarkdownRenderer.identifier: MarkdownRenderer.prefData,
|
||||
]
|
||||
|
||||
private static let rendererDefaultPrefDatas = [
|
||||
MarkdownRenderer.identifier: MarkdownRenderer.PrefData.default,
|
||||
]
|
||||
|
||||
static let `default` = PrefData(rendererDatas: PrefData.rendererDefaultPrefDatas)
|
||||
|
||||
var rendererDatas: [String: StandardPrefData]
|
||||
|
||||
init(rendererDatas: [String: StandardPrefData]) {
|
||||
self.rendererDatas = rendererDatas
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
guard let rendererDataDict = dict[PrefData.rendererDatas] as? [String: [String: Any]] else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let storedRendererDatas: [(String, StandardPrefData)] = rendererDataDict.compactMap { (identifier, dict) in
|
||||
guard let prefDataFn = PrefData.rendererPrefDataFns[identifier] else {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let prefData = prefDataFn(dict) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return (identifier, prefData)
|
||||
}
|
||||
|
||||
let missingRendererDatas: [(String, StandardPrefData)] = Set(PrefData.rendererDefaultPrefDatas.keys)
|
||||
.subtracting(storedRendererDatas.map { $0.0 })
|
||||
.compactMap { identifier in
|
||||
guard let data = PrefData.rendererDefaultPrefDatas[identifier] else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return (identifier, data)
|
||||
}
|
||||
|
||||
self.init(rendererDatas: tuplesToDict([storedRendererDatas, missingRendererDatas].flatMap { $0 }))
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
PrefData.rendererDatas: self.rendererDatas.mapToDict { (key, value) in (key, value.dict()) }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class MarkdownRenderer {
|
||||
|
||||
static let identifier = "com.qvacua.vimr.tool.preview.markdown"
|
||||
|
||||
static func prefData(from dict: [String: Any]) -> StandardPrefData? {
|
||||
return PrefData(dict: dict)
|
||||
}
|
||||
|
||||
struct PrefData: StandardPrefData {
|
||||
|
||||
private static let identifier = "identifier"
|
||||
private static let isForwardSearchAutomatically = "is-forward-search-automatically"
|
||||
private static let isReverseSearchAutomatically = "is-reverse-search-automatically"
|
||||
private static let isRefreshOnWrite = "is-refresh-on-write"
|
||||
|
||||
static let `default` = PrefData(isForwardSearchAutomatically: false,
|
||||
isReverseSearchAutomatically: false,
|
||||
isRefreshOnWrite: true)
|
||||
|
||||
var isForwardSearchAutomatically: Bool
|
||||
var isReverseSearchAutomatically: Bool
|
||||
var isRefreshOnWrite: Bool
|
||||
|
||||
init(isForwardSearchAutomatically: Bool, isReverseSearchAutomatically: Bool, isRefreshOnWrite: Bool) {
|
||||
self.isForwardSearchAutomatically = isForwardSearchAutomatically
|
||||
self.isReverseSearchAutomatically = isReverseSearchAutomatically
|
||||
self.isRefreshOnWrite = isRefreshOnWrite
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
guard PrefUtils.string(from: dict, for: PrefData.identifier) == MarkdownRenderer.identifier else {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let isForward = PrefUtils.bool(from: dict, for: PrefData.isForwardSearchAutomatically) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let isReverse = PrefUtils.bool(from: dict, for: PrefData.isReverseSearchAutomatically) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let isRefreshOnWrite = PrefUtils.bool(from: dict, for: PrefData.isRefreshOnWrite) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.init(isForwardSearchAutomatically: isForward,
|
||||
isReverseSearchAutomatically: isReverse,
|
||||
isRefreshOnWrite: isRefreshOnWrite)
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
PrefData.identifier: MarkdownRenderer.identifier,
|
||||
PrefData.isForwardSearchAutomatically: self.isForwardSearchAutomatically,
|
||||
PrefData.isReverseSearchAutomatically: self.isReverseSearchAutomatically,
|
||||
PrefData.isRefreshOnWrite: self.isRefreshOnWrite,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct FileBrowserData: StandardPrefData {
|
||||
|
||||
private static let isShowHidden = "is-show-hidden"
|
||||
|
||||
static let `default` = FileBrowserData(isShowHidden: false)
|
||||
|
||||
var isShowHidden: Bool
|
||||
|
||||
init(isShowHidden: Bool) {
|
||||
self.isShowHidden = isShowHidden
|
||||
}
|
||||
|
||||
init?(dict: [String: Any]) {
|
||||
guard let isShowHidden = PrefUtils.bool(from: dict, for: FileBrowserData.isShowHidden) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.init(isShowHidden: isShowHidden)
|
||||
}
|
||||
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
FileBrowserData.isShowHidden: self.isShowHidden
|
||||
]
|
||||
}
|
||||
}
|
@ -12,7 +12,6 @@ class PrefMiddleware: MiddlewareType {
|
||||
typealias ActionType = AnyAction
|
||||
|
||||
static let compatibleVersion = "168"
|
||||
static let lastCompatibleVersion = "128"
|
||||
|
||||
let mainWindow = MainWindowMiddleware()
|
||||
|
||||
|
@ -35,9 +35,11 @@ extension PrimitiveSequence where Element == Never, TraitType == CompletableTrai
|
||||
defer { condition.unlock() }
|
||||
|
||||
let disposable = self.subscribe(onCompleted: {
|
||||
condition.lock()
|
||||
trigger = true
|
||||
broadcast(condition)
|
||||
}, onError: { error in
|
||||
condition.lock()
|
||||
trigger = true
|
||||
err = error
|
||||
broadcast(condition)
|
||||
@ -76,9 +78,11 @@ extension PrimitiveSequence where TraitType == SingleTrait {
|
||||
|
||||
let disposable = self.subscribe(onSuccess: { result in
|
||||
value = result
|
||||
condition.lock()
|
||||
trigger = true
|
||||
broadcast(condition)
|
||||
}, onError: { error in
|
||||
condition.lock()
|
||||
trigger = true
|
||||
broadcast(condition)
|
||||
})
|
||||
@ -91,7 +95,6 @@ extension PrimitiveSequence where TraitType == SingleTrait {
|
||||
}
|
||||
|
||||
private func broadcast(_ condition: NSCondition) {
|
||||
condition.lock()
|
||||
defer { condition.unlock() }
|
||||
condition.broadcast()
|
||||
}
|
||||
|
@ -15,10 +15,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.26.4</string>
|
||||
<string>0.26.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>307</string>
|
||||
<string>308</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
24
appcast.xml
24
appcast.xml
@ -7,27 +7,23 @@
|
||||
<description>Most recent changes with links to updates for VimR.</description>
|
||||
<language>en</language>
|
||||
<item>
|
||||
<title>v0.26.4-307</title>
|
||||
<title>v0.26.5-308</title>
|
||||
<description><![CDATA[
|
||||
<ul>
|
||||
<li>GH-709: Bugfix: Some Unicode characters were broken when ligatures are turned off.</li>
|
||||
<li>Dependencies updates:<ul>
|
||||
<li>ReactiveX/RxSwift@4.4.2</li>
|
||||
<li>Quick/nimble@8.0.1</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>GH-458: Bugfix: Opening files by drag-n-dropping on VimR window does not work.</li>
|
||||
<li>Bugfix: Crashes when some files are deleted in the <code>cwd</code> when closing.</li>
|
||||
</ul>
|
||||
]]></description>
|
||||
<releaseNotesLink>
|
||||
https://github.com/qvacua/vimr/releases/tag/v0.26.4-307
|
||||
https://github.com/qvacua/vimr/releases/tag/v0.26.5-308
|
||||
</releaseNotesLink>
|
||||
<pubDate>2019-03-11T08:47:11.815092</pubDate>
|
||||
<pubDate>2019-03-13T14:41:04.565089</pubDate>
|
||||
<minimumSystemVersion>10.10.0</minimumSystemVersion>
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.26.4-307/VimR-v0.26.4-307.tar.bz2"
|
||||
sparkle:version="307"
|
||||
sparkle:shortVersionString="0.26.4"
|
||||
sparkle:dsaSignature="MC4CFQDPFAkM7rKGHzg120syVP8w6N0yywIVAOZPK2SlVunrzhoQymfMzftreKGP"
|
||||
length="15169685"
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.26.5-308/VimR-v0.26.5-308.tar.bz2"
|
||||
sparkle:version="308"
|
||||
sparkle:shortVersionString="0.26.5"
|
||||
sparkle:dsaSignature="MC4CFQDzAWzLrqSHYnYgwfI56k/9tnG62AIVAJ2Z5uzlPv/f2VFXZdnnyLNHtCYf"
|
||||
length="15118587"
|
||||
type="application/octet-stream"/>
|
||||
</item>
|
||||
</channel>
|
||||
|
@ -7,27 +7,23 @@
|
||||
<description>Most recent changes with links to updates for VimR.</description>
|
||||
<language>en</language>
|
||||
<item>
|
||||
<title>v0.26.4-307</title>
|
||||
<title>v0.26.5-308</title>
|
||||
<description><![CDATA[
|
||||
<ul>
|
||||
<li>GH-709: Bugfix: Some Unicode characters were broken when ligatures are turned off.</li>
|
||||
<li>Dependencies updates:<ul>
|
||||
<li>ReactiveX/RxSwift@4.4.2</li>
|
||||
<li>Quick/nimble@8.0.1</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>GH-458: Bugfix: Opening files by drag-n-dropping on VimR window does not work.</li>
|
||||
<li>Bugfix: Crashes when some files are deleted in the <code>cwd</code> when closing.</li>
|
||||
</ul>
|
||||
]]></description>
|
||||
<releaseNotesLink>
|
||||
https://github.com/qvacua/vimr/releases/tag/v0.26.4-307
|
||||
https://github.com/qvacua/vimr/releases/tag/v0.26.5-308
|
||||
</releaseNotesLink>
|
||||
<pubDate>2019-03-11T08:47:11.815092</pubDate>
|
||||
<pubDate>2019-03-13T14:41:04.565089</pubDate>
|
||||
<minimumSystemVersion>10.10.0</minimumSystemVersion>
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.26.4-307/VimR-v0.26.4-307.tar.bz2"
|
||||
sparkle:version="307"
|
||||
sparkle:shortVersionString="0.26.4"
|
||||
sparkle:dsaSignature="MC4CFQDPFAkM7rKGHzg120syVP8w6N0yywIVAOZPK2SlVunrzhoQymfMzftreKGP"
|
||||
length="15169685"
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.26.5-308/VimR-v0.26.5-308.tar.bz2"
|
||||
sparkle:version="308"
|
||||
sparkle:shortVersionString="0.26.5"
|
||||
sparkle:dsaSignature="MC4CFQDzAWzLrqSHYnYgwfI56k/9tnG62AIVAJ2Z5uzlPv/f2VFXZdnnyLNHtCYf"
|
||||
length="15118587"
|
||||
type="application/octet-stream"/>
|
||||
</item>
|
||||
</channel>
|
||||
|
@ -2,7 +2,12 @@
|
||||
|
||||
* ...
|
||||
|
||||
# 0.26.4-???
|
||||
# 0.26.5-308
|
||||
|
||||
* GH-458: Bugfix: Opening files by drag-n-dropping on VimR window does not work.
|
||||
* Bugfix: Crashes when some files are deleted in the `cwd` when closing.
|
||||
|
||||
# 0.26.4-307
|
||||
|
||||
* GH-709: Bugfix: Some Unicode characters were broken when ligatures are turned off.
|
||||
* Dependencies updates:
|
||||
|
Loading…
Reference in New Issue
Block a user