mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-24 03:25:03 +03:00
Merge branch '544-swift4' into develop
This commit is contained in:
commit
5d4c5bb903
@ -1,5 +1,5 @@
|
||||
language: objective-c
|
||||
osx_image: xcode8.3
|
||||
osx_image: xcode9
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
|
@ -23,8 +23,9 @@ extension NSColor {
|
||||
extension CGRect {
|
||||
|
||||
public var hashValue: Int {
|
||||
return Int(self.origin.x) << 10 ^ Int(self.origin.y) +
|
||||
Int(self.size.width) << 10 ^ Int(self.size.height);
|
||||
let o = Int(self.origin.x) << 10 ^ Int(self.origin.y)
|
||||
let s = Int(self.size.width) << 10 ^ Int(self.size.height)
|
||||
return o + s
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,14 +25,14 @@ struct Cell: CustomStringConvertible {
|
||||
self.attributes = attrs
|
||||
self.marked = marked
|
||||
}
|
||||
|
||||
|
||||
var description: String {
|
||||
return self.string.characters.count > 0 ? self.string : "*"
|
||||
return self.string.count > 0 ? self.string : "*"
|
||||
}
|
||||
}
|
||||
|
||||
extension Position: CustomStringConvertible, Equatable {
|
||||
|
||||
|
||||
static let zero = Position(row: 0, column: 0)
|
||||
static let null = Position(row: -1, column: -1)
|
||||
|
||||
@ -42,20 +42,20 @@ extension Position: CustomStringConvertible, Equatable {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
public var description: String {
|
||||
return "Position<\(self.row):\(self.column)>"
|
||||
}
|
||||
}
|
||||
|
||||
struct Size: CustomStringConvertible, Equatable {
|
||||
|
||||
|
||||
static let zero = Size(width: 0, height: 0)
|
||||
|
||||
static func ==(left: Size, right: Size) -> Bool {
|
||||
return left.width == right.width && left.height == right.height
|
||||
}
|
||||
|
||||
|
||||
var width: Int
|
||||
var height: Int
|
||||
|
||||
@ -65,9 +65,9 @@ struct Size: CustomStringConvertible, Equatable {
|
||||
}
|
||||
|
||||
struct Region: CustomStringConvertible {
|
||||
|
||||
|
||||
static let zero = Region(top: 0, bottom: 0, left: 0, right: 0)
|
||||
|
||||
|
||||
var top: Int
|
||||
var bottom: Int
|
||||
var left: Int
|
||||
@ -96,49 +96,49 @@ class Grid: CustomStringConvertible {
|
||||
var foreground = defaultForeground
|
||||
var background = defaultBackground
|
||||
var special = defaultSpecial
|
||||
|
||||
|
||||
var attrs: CellAttributes = CellAttributes(
|
||||
fontTrait: .none,
|
||||
foreground: defaultForeground, background: defaultBackground, special: defaultSpecial
|
||||
)
|
||||
|
||||
|
||||
fileprivate(set) var cells: [[Cell]] = []
|
||||
|
||||
var hasData: Bool {
|
||||
return !self.cells.isEmpty
|
||||
}
|
||||
|
||||
|
||||
var description: String {
|
||||
return self.cells.reduce("<<< Grid\n") { $1.reduce($0) { $0 + $1.description } + "\n" } + ">>>"
|
||||
}
|
||||
|
||||
|
||||
func resize(_ size: Size) {
|
||||
self.region = Region(top: 0, bottom: size.height - 1, left: 0, right: size.width - 1)
|
||||
self.size = size
|
||||
self.position = Position.zero
|
||||
|
||||
|
||||
let emptyCellAttrs = CellAttributes(fontTrait: .none,
|
||||
foreground: self.foreground, background: self.background, special: self.special)
|
||||
|
||||
|
||||
let emptyRow = Array(repeating: Cell(string: " ", attrs: emptyCellAttrs), count: size.width)
|
||||
self.cells = Array(repeating: emptyRow, count: size.height)
|
||||
}
|
||||
|
||||
|
||||
func clear() {
|
||||
self.clearRegion(self.region)
|
||||
}
|
||||
|
||||
|
||||
func eolClear() {
|
||||
self.clearRegion(
|
||||
Region(top: self.position.row, bottom: self.position.row,
|
||||
left: self.position.column, right: self.region.right)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
func setScrollRegion(_ region: Region) {
|
||||
self.region = region
|
||||
}
|
||||
|
||||
|
||||
func scroll(_ count: Int) {
|
||||
var start, stop, step : Int
|
||||
if count > 0 {
|
||||
@ -168,7 +168,7 @@ class Grid: CustomStringConvertible {
|
||||
}
|
||||
self.clearRegion(Region(top: clearTop, bottom: clearBottom, left: self.region.left, right: self.region.right))
|
||||
}
|
||||
|
||||
|
||||
func goto(_ position: Position) {
|
||||
self.position = position
|
||||
}
|
||||
@ -180,7 +180,7 @@ class Grid: CustomStringConvertible {
|
||||
// |abcde>| <- ">" at the end of the line is wrong -> the XPC could tell the main app whether the string occupies
|
||||
// |ㅎ | two cells using vim_strwidth()
|
||||
self.cells[self.position.row][self.position.column] = Cell(string: string, attrs: self.attrs)
|
||||
|
||||
|
||||
// Increment the column of the put position because neovim calls sets the position only once when drawing
|
||||
// consecutive cells in the same line
|
||||
self.advancePosition()
|
||||
@ -230,7 +230,7 @@ class Grid: CustomStringConvertible {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Region(top: row, bottom: row, left: left, right: right)
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ class Grid: CustomStringConvertible {
|
||||
return false
|
||||
}
|
||||
|
||||
if self.cells[position.row][position.column].string.characters.count == 0 {
|
||||
if self.cells[position.row][position.column].string.count == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
@ -264,11 +264,11 @@ class Grid: CustomStringConvertible {
|
||||
func previousCellPosition(_ position: Position) -> Position {
|
||||
return Position(row: position.row, column: max(position.column - 1, 0))
|
||||
}
|
||||
|
||||
|
||||
func nextCellPosition(_ position: Position) -> Position {
|
||||
return Position(row: position.row, column: min(position.column + 1, self.size.width - 1))
|
||||
}
|
||||
|
||||
|
||||
func cellForSingleIndex(_ idx: Int) -> Cell {
|
||||
let position = self.positionFromSingleIndex(idx)
|
||||
return self.cells[position.row][position.column]
|
||||
@ -282,7 +282,7 @@ class Grid: CustomStringConvertible {
|
||||
|
||||
let clearedAttrs = CellAttributes(fontTrait: .none,
|
||||
foreground: self.foreground, background: self.background, special: self.special)
|
||||
|
||||
|
||||
let clearedCell = Cell(string: " ", attrs: clearedAttrs)
|
||||
let clearedRow = Array(repeating: clearedCell, count: region.right - region.left + 1)
|
||||
for i in region.top...region.bottom {
|
||||
|
@ -6,10 +6,10 @@
|
||||
import Cocoa
|
||||
|
||||
public class InputTestView: NSView, NSTextInputClient {
|
||||
|
||||
|
||||
var markedText: String?
|
||||
var text = ""
|
||||
|
||||
|
||||
var handledBySelector = false
|
||||
|
||||
/* The receiver inserts aString replacing the content specified by replacementRange. aString can be either an NSString or NSAttributedString instance.
|
||||
@ -18,7 +18,7 @@ public class InputTestView: NSView, NSTextInputClient {
|
||||
Swift.print("\(#function): \(aString), \(replacementRange)")
|
||||
self.markedText = nil
|
||||
}
|
||||
|
||||
|
||||
/* The receiver invokes the action specified by aSelector.
|
||||
*/
|
||||
public override func doCommandBySelector(aSelector: Selector) {
|
||||
@ -28,20 +28,20 @@ public class InputTestView: NSView, NSTextInputClient {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The receiver inserts aString replacing the content specified by replacementRange. aString can be either an NSString or NSAttributedString instance. selectedRange specifies the selection inside the string being inserted; hence, the location is relative to the beginning of aString. When aString is an NSString, the receiver is expected to render the marked text with distinguishing appearance (i.e. NSTextView renders with -markedTextAttributes).
|
||||
*/
|
||||
public func setMarkedText(aString: AnyObject, selectedRange: NSRange, replacementRange: NSRange) {
|
||||
Swift.print("\(#function): \(aString), \(selectedRange), \(replacementRange)")
|
||||
self.markedText = String(aString)
|
||||
}
|
||||
|
||||
|
||||
/* The receiver unmarks the marked text. If no marked text, the invocation of this method has no effect.
|
||||
*/
|
||||
public func unmarkText() {
|
||||
Swift.print("\(#function): ")
|
||||
}
|
||||
|
||||
|
||||
/// Return the current selection (or the position of the cursor with empty-length range). For example when you enter
|
||||
/// "Cmd-Ctrl-Return" you'll get the Emoji-popup at the rect by firstRectForCharacterRange(actualRange:) where the
|
||||
/// first range is the result of this method.
|
||||
@ -50,7 +50,7 @@ public class InputTestView: NSView, NSTextInputClient {
|
||||
Swift.print("\(#function): returning \(result)")
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
/* Returns the marked range. Returns {NSNotFound, 0} if no marked range.
|
||||
*/
|
||||
public func markedRange() -> NSRange {
|
||||
@ -62,7 +62,7 @@ public class InputTestView: NSView, NSTextInputClient {
|
||||
Swift.print("\(#function): returning \(NSRange(location: NSNotFound, length: 0))")
|
||||
return NSRange(location: NSNotFound, length: 0)
|
||||
}
|
||||
|
||||
|
||||
/* Returns whether or not the receiver has marked text.
|
||||
*/
|
||||
public func hasMarkedText() -> Bool {
|
||||
@ -70,21 +70,21 @@ public class InputTestView: NSView, NSTextInputClient {
|
||||
Swift.print("\(#function): returning \(result)")
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
/* Returns attributed string specified by aRange. It may return nil. If non-nil return value and actualRange is non-NULL, it contains the actual range for the return value. The range can be adjusted from various reasons (i.e. adjust to grapheme cluster boundary, performance optimization, etc).
|
||||
*/
|
||||
public func attributedSubstringForProposedRange(aRange: NSRange, actualRange: NSRangePointer) -> NSAttributedString? {
|
||||
Swift.print("\(#function): \(aRange), \(actualRange[0])")
|
||||
return NSAttributedString(string: "하")
|
||||
}
|
||||
|
||||
|
||||
/* Returns an array of attribute names recognized by the receiver.
|
||||
*/
|
||||
public func validAttributesForMarkedText() -> [String] {
|
||||
// Swift.print("\(#function): ")
|
||||
return []
|
||||
}
|
||||
|
||||
|
||||
/* Returns the first logical rectangular area for aRange. The return value is in the screen coordinate. The size value can be negative if the text flows to the left. If non-NULL, actuallRange contains the character range corresponding to the returned area.
|
||||
*/
|
||||
public func firstRectForCharacterRange(aRange: NSRange, actualRange: NSRangePointer) -> NSRect {
|
||||
@ -97,10 +97,10 @@ public class InputTestView: NSView, NSTextInputClient {
|
||||
|
||||
let resultInSelf = NSRect(x: 0, y: 0, width: 10, height: 10)
|
||||
let result = self.window?.convertRectToScreen(self.convertRect(resultInSelf, toView: nil))
|
||||
|
||||
|
||||
return result!
|
||||
}
|
||||
|
||||
|
||||
/* Returns the index for character that is nearest to aPoint. aPoint is in the screen coordinate system.
|
||||
*/
|
||||
public func characterIndexForPoint(aPoint: NSPoint) -> Int {
|
||||
@ -126,16 +126,16 @@ public class InputTestView: NSView, NSTextInputClient {
|
||||
public override func keyDown(theEvent: NSEvent) {
|
||||
Swift.print("\(#function): \(theEvent)")
|
||||
let modifierFlags = theEvent.modifierFlags
|
||||
|
||||
|
||||
let capslock = modifierFlags.contains(.AlphaShiftKeyMask)
|
||||
let shift = modifierFlags.contains(.ShiftKeyMask)
|
||||
let control = modifierFlags.contains(.ControlKeyMask)
|
||||
let option = modifierFlags.contains(.AlternateKeyMask)
|
||||
let command = modifierFlags.contains(.CommandKeyMask)
|
||||
let chars = theEvent.characters!
|
||||
// let chars = theEvent.characters!
|
||||
let charsIgnoringModifiers = shift || capslock ? theEvent.charactersIgnoringModifiers!.lowercaseString
|
||||
: theEvent.charactersIgnoringModifiers!
|
||||
|
||||
|
||||
// Swift.print("characters: \(chars)")// = " + String(format:"%x", theEvent.characters!.unicodeScalars.first!.value))
|
||||
// Swift.print("characters ign: \(charsIgnoringModifiers)")// = " + String(format:"%x", theEvent.charactersIgnoringModifiers!.unicodeScalars.first!.value))
|
||||
// Swift.print(String(format: "keycode: %x", theEvent.keyCode))
|
||||
@ -150,12 +150,12 @@ public class InputTestView: NSView, NSTextInputClient {
|
||||
// self.text += theEvent.charactersIgnoringModifiers!
|
||||
// Swift.print("\(#function): after: \(self.text)")
|
||||
}
|
||||
|
||||
|
||||
public override func drawRect(dirtyRect: NSRect) {
|
||||
NSColor.yellowColor().set()
|
||||
dirtyRect.fill()
|
||||
}
|
||||
|
||||
|
||||
private func vimInput(string: String) {
|
||||
// Swift.print("### vim input: \(string)")
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import Cocoa
|
||||
class KeyUtils {
|
||||
|
||||
static func isControlCode(key: String) -> Bool {
|
||||
guard key.characters.count == 1 else {
|
||||
guard key.count == 1 else {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ class KeyUtils {
|
||||
}
|
||||
|
||||
static func isSpecial(key: String) -> Bool {
|
||||
guard key.characters.count == 1 else {
|
||||
guard key.count == 1 else {
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,9 @@ extension NeoVimView {
|
||||
return false
|
||||
}
|
||||
|
||||
guard let paths = sender.draggingPasteboard().propertyList(forType: NSFilenamesPboardType) as? [String] else {
|
||||
guard let paths = sender.draggingPasteboard().propertyList(
|
||||
forType: NSPasteboard.PasteboardType(String(kUTTypeFileURL))
|
||||
) as? [String] else {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -31,5 +33,5 @@ extension NeoVimView {
|
||||
}
|
||||
|
||||
fileprivate func isFile(sender: NSDraggingInfo) -> Bool {
|
||||
return (sender.draggingPasteboard().types?.contains(String(kUTTypeFileURL))) ?? false
|
||||
return (sender.draggingPasteboard().types?.contains(NSPasteboard.PasteboardType(String(kUTTypeFileURL)))) ?? false
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ extension NeoVimView {
|
||||
return
|
||||
}
|
||||
|
||||
let context = NSGraphicsContext.current()!.cgContext
|
||||
let context = NSGraphicsContext.current!.cgContext
|
||||
context.saveGState()
|
||||
defer { context.restoreGState() }
|
||||
|
||||
@ -55,7 +55,7 @@ extension NeoVimView {
|
||||
|
||||
let positions = rowFrag.range
|
||||
// filter out the put(0, 0)s (after a wide character)
|
||||
.filter { self.grid.cells[rowFrag.row][$0].string.characters.count > 0 }
|
||||
.filter { self.grid.cells[rowFrag.row][$0].string.count > 0 }
|
||||
.map { self.pointInView(forRow: rowFrag.row, column: $0) }
|
||||
|
||||
if positions.isEmpty {
|
||||
@ -159,7 +159,7 @@ extension NeoVimView {
|
||||
let displayStr = "\(discreteSize.width) × \(discreteSize.height)"
|
||||
|
||||
var sizeAttrs = resizeTextAttrs
|
||||
sizeAttrs[NSForegroundColorAttributeName] = self.theme.foreground
|
||||
sizeAttrs[NSAttributedStringKey.foregroundColor] = self.theme.foreground
|
||||
|
||||
let size = displayStr.size(withAttributes: sizeAttrs)
|
||||
let x = (boundsSize.width - size.width) / 2
|
||||
@ -305,9 +305,9 @@ extension NeoVimView {
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate let emojiAttrs = [ NSFontAttributeName: NSFont(name: "AppleColorEmoji", size: 72)! ]
|
||||
fileprivate let emojiAttrs = [ NSAttributedStringKey.font: NSFont(name: "AppleColorEmoji", size: 72)! ]
|
||||
fileprivate let resizeTextAttrs = [
|
||||
NSFontAttributeName: NSFont.systemFont(ofSize: 18),
|
||||
NSForegroundColorAttributeName: NSColor.darkGray
|
||||
NSAttributedStringKey.font: NSFont.systemFont(ofSize: 18),
|
||||
NSAttributedStringKey.foregroundColor: NSColor.darkGray
|
||||
]
|
||||
fileprivate let colorSpace = NSColorSpace.sRGB
|
||||
|
@ -11,7 +11,7 @@ extension NeoVimView {
|
||||
self.keyDownDone = false
|
||||
NSCursor.setHiddenUntilMouseMoves(true)
|
||||
|
||||
let context = NSTextInputContext.current()
|
||||
let context = NSTextInputContext.current
|
||||
let cocoaHandledEvent = context?.handleEvent(event) ?? false
|
||||
if self.keyDownDone && cocoaHandledEvent {
|
||||
return
|
||||
@ -174,7 +174,7 @@ extension NeoVimView {
|
||||
// FIXME: do we have to handle positions at the column borders?
|
||||
if let markedText = self.markedText {
|
||||
let result = NSRange(location: self.grid.singleIndexFrom(self.markedPosition),
|
||||
length: markedText.characters.count)
|
||||
length: markedText.count)
|
||||
// self.logger.debug("\(#function): \(result)")
|
||||
return result
|
||||
}
|
||||
@ -206,7 +206,7 @@ extension NeoVimView {
|
||||
|
||||
// we only support last marked text, thus fill dummy characters when Cocoa asks for more
|
||||
// characters than marked...
|
||||
let fillCount = aRange.length - lastMarkedText.characters.count
|
||||
let fillCount = aRange.length - lastMarkedText.count
|
||||
guard fillCount >= 0 else {
|
||||
return nil
|
||||
}
|
||||
@ -217,7 +217,7 @@ extension NeoVimView {
|
||||
return NSAttributedString(string: fillChars + lastMarkedText)
|
||||
}
|
||||
|
||||
public func validAttributesForMarkedText() -> [String] {
|
||||
public func validAttributesForMarkedText() -> [NSAttributedStringKey] {
|
||||
return []
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ extension NeoVimView {
|
||||
return 1
|
||||
}
|
||||
|
||||
func vimModifierFlags(_ modifierFlags: NSEventModifierFlags) -> String? {
|
||||
func vimModifierFlags(_ modifierFlags: NSEvent.ModifierFlags) -> String? {
|
||||
var result = ""
|
||||
|
||||
let control = modifierFlags.contains(.control)
|
||||
@ -262,7 +262,7 @@ extension NeoVimView {
|
||||
result += "S-"
|
||||
}
|
||||
|
||||
if result.characters.count > 0 {
|
||||
if result.count > 0 {
|
||||
return result
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ extension NeoVimView {
|
||||
|| self.mode == .normal
|
||||
|| self.mode == .visual
|
||||
let canCopyOrCut = self.mode == .normal || self.mode == .visual
|
||||
let canPaste = NSPasteboard.general().string(forType: NSPasteboardTypeString) != nil
|
||||
let canPaste = NSPasteboard.general.string(forType: .string) != nil
|
||||
let canDelete = self.mode == .visual || self.mode == .normal
|
||||
let canSelectAll = self.mode == .insert
|
||||
|| self.mode == .replace
|
||||
@ -86,7 +86,7 @@ extension NeoVimView {
|
||||
}
|
||||
|
||||
@IBAction func paste(_ sender: AnyObject?) {
|
||||
guard let content = NSPasteboard.general().string(forType: NSPasteboardTypeString) else {
|
||||
guard let content = NSPasteboard.general.string(forType: .string) else {
|
||||
return
|
||||
}
|
||||
|
||||
@ -151,14 +151,14 @@ extension NeoVimView {
|
||||
|
||||
@IBAction func makeFontBigger(_ sender: Any?) {
|
||||
let curFont = self.drawer.font
|
||||
let font = NSFontManager.shared()
|
||||
let font = NSFontManager.shared
|
||||
.convert(curFont, toSize: min(curFont.pointSize + 1, NeoVimView.maxFontSize))
|
||||
self.updateFontMetaData(font)
|
||||
}
|
||||
|
||||
@IBAction func makeFontSmaller(_ sender: Any?) {
|
||||
let curFont = self.drawer.font
|
||||
let font = NSFontManager.shared()
|
||||
let font = NSFontManager.shared
|
||||
.convert(curFont, toSize: max(curFont.pointSize - 1, NeoVimView.minFontSize))
|
||||
self.updateFontMetaData(font)
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ extension NeoVimView {
|
||||
}
|
||||
|
||||
switch event.phase {
|
||||
case NSEventPhase.began:
|
||||
case .began:
|
||||
let pinchImageRep = self.bitmapImageRepForCachingDisplay(in: self.bounds)!
|
||||
self.cacheDisplay(in: self.bounds, to: pinchImageRep)
|
||||
self.pinchBitmap = pinchImageRep
|
||||
@ -60,9 +60,9 @@ extension NeoVimView {
|
||||
self.isCurrentlyPinching = true
|
||||
self.needsDisplay = true
|
||||
|
||||
case NSEventPhase.ended, NSEventPhase.cancelled:
|
||||
case .ended, .cancelled:
|
||||
self.isCurrentlyPinching = false
|
||||
self.updateFontMetaData(NSFontManager.shared().convert(self.font, toSize: resultingFontSize))
|
||||
self.updateFontMetaData(NSFontManager.shared.convert(self.font, toSize: resultingFontSize))
|
||||
self.pinchTargetScale = 1
|
||||
|
||||
default:
|
||||
@ -152,7 +152,7 @@ extension NeoVimView {
|
||||
}
|
||||
|
||||
fileprivate func vimScrollInputFor(deltaX: CGFloat, deltaY: CGFloat,
|
||||
modifierFlags: NSEventModifierFlags,
|
||||
modifierFlags: NSEvent.ModifierFlags,
|
||||
cellPosition: Position) -> (String, String) {
|
||||
|
||||
let vimMouseLocation = self.wrapNamedKeys("\(cellPosition.column),\(cellPosition.row)")
|
||||
|
@ -116,7 +116,7 @@ extension NeoVimView {
|
||||
self.markForRender(position: curPos)
|
||||
// When the cursor is in the command line, then we need this...
|
||||
self.markForRender(cellPosition: self.grid.nextCellPosition(curPos))
|
||||
if markedText.characters.count == 0 {
|
||||
if markedText.count == 0 {
|
||||
self.markForRender(position: self.grid.previousCellPosition(curPos))
|
||||
}
|
||||
}
|
||||
@ -229,7 +229,7 @@ extension NeoVimView {
|
||||
gui.async {
|
||||
self.bridgeLogger.mark()
|
||||
|
||||
NSBeep()
|
||||
NSSound.beep()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ public class NeoVimView: NSView,
|
||||
self.agent = NeoVimAgent(uuid: self.uuid)
|
||||
|
||||
super.init(frame: .zero)
|
||||
self.register(forDraggedTypes: [String(kUTTypeFileURL)])
|
||||
self.registerForDraggedTypes([NSPasteboard.PasteboardType(String(kUTTypeFileURL))])
|
||||
|
||||
self.wantsLayer = true
|
||||
self.cellSize = self.drawer.cellSize
|
||||
|
@ -191,6 +191,8 @@
|
||||
4BB489431D952CF6005BB0E8 /* WorkspaceToolButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB489411D952CF6005BB0E8 /* WorkspaceToolButton.swift */; };
|
||||
4BB727141E97A718001571C1 /* CocoaMarkdown.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B183E0D1E06E2940079E8A8 /* CocoaMarkdown.framework */; };
|
||||
4BB727151E97A718001571C1 /* CocoaMarkdown.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B183E0D1E06E2940079E8A8 /* CocoaMarkdown.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4BB7F3931F9D261500624F61 /* Swifter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BB7F3911F9D260B00624F61 /* Swifter.framework */; };
|
||||
4BB7F3941F9D261500624F61 /* Swifter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BB7F3911F9D260B00624F61 /* Swifter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4BCADE081D11ED12004DAD0F /* CocoaExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BCADE071D11ED12004DAD0F /* CocoaExtensions.swift */; };
|
||||
4BDCFACB1D31449700F62670 /* NeoVimServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BDCFACA1D31449700F62670 /* NeoVimServer.m */; };
|
||||
4BDCFACD1D3145AC00F62670 /* libnvim.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BDCFACC1D3145AC00F62670 /* libnvim.a */; };
|
||||
@ -223,24 +225,6 @@
|
||||
4BDF641D1D0887C100D47E1D /* TextDrawer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BDF641B1D0887C100D47E1D /* TextDrawer.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
4BDF64241D08CAB000D47E1D /* MMCoreTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDF64221D08CAB000D47E1D /* MMCoreTextView.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
4BDF64251D08CAB000D47E1D /* MMCoreTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BDF64231D08CAB000D47E1D /* MMCoreTextView.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
4BE149871EEF4792003DE5E2 /* Errno.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149751EEF4792003DE5E2 /* Errno.swift */; };
|
||||
4BE149881EEF4792003DE5E2 /* Files.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149761EEF4792003DE5E2 /* Files.swift */; };
|
||||
4BE149891EEF4792003DE5E2 /* HttpParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149771EEF4792003DE5E2 /* HttpParser.swift */; };
|
||||
4BE1498A1EEF4792003DE5E2 /* HttpRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149781EEF4792003DE5E2 /* HttpRequest.swift */; };
|
||||
4BE1498B1EEF4792003DE5E2 /* HttpResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149791EEF4792003DE5E2 /* HttpResponse.swift */; };
|
||||
4BE1498C1EEF4792003DE5E2 /* HttpRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE1497A1EEF4792003DE5E2 /* HttpRouter.swift */; };
|
||||
4BE1498D1EEF4792003DE5E2 /* HttpServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE1497B1EEF4792003DE5E2 /* HttpServer.swift */; };
|
||||
4BE1498E1EEF4792003DE5E2 /* HttpServerIO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE1497C1EEF4792003DE5E2 /* HttpServerIO.swift */; };
|
||||
4BE1498F1EEF4792003DE5E2 /* Process.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE1497D1EEF4792003DE5E2 /* Process.swift */; };
|
||||
4BE149901EEF4792003DE5E2 /* Scopes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE1497E1EEF4792003DE5E2 /* Scopes.swift */; };
|
||||
4BE149911EEF4792003DE5E2 /* Socket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE1497F1EEF4792003DE5E2 /* Socket.swift */; };
|
||||
4BE149921EEF4792003DE5E2 /* Socket+File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149801EEF4792003DE5E2 /* Socket+File.swift */; };
|
||||
4BE149931EEF4792003DE5E2 /* Socket+Server.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149811EEF4792003DE5E2 /* Socket+Server.swift */; };
|
||||
4BE149941EEF4792003DE5E2 /* String+BASE64.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149821EEF4792003DE5E2 /* String+BASE64.swift */; };
|
||||
4BE149951EEF4792003DE5E2 /* String+File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149831EEF4792003DE5E2 /* String+File.swift */; };
|
||||
4BE149961EEF4792003DE5E2 /* String+Misc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149841EEF4792003DE5E2 /* String+Misc.swift */; };
|
||||
4BE149971EEF4792003DE5E2 /* String+SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149851EEF4792003DE5E2 /* String+SHA1.swift */; };
|
||||
4BE149981EEF4792003DE5E2 /* WebSockets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE149861EEF4792003DE5E2 /* WebSockets.swift */; };
|
||||
4BEBA5091CFF374B00673FDF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BEBA5081CFF374B00673FDF /* AppDelegate.swift */; };
|
||||
4BEBA50B1CFF374B00673FDF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4BEBA50A1CFF374B00673FDF /* Assets.xcassets */; };
|
||||
4BEBA50E1CFF374B00673FDF /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4BEBA50C1CFF374B00673FDF /* MainMenu.xib */; };
|
||||
@ -311,6 +295,7 @@
|
||||
4B183E101E06E29C0079E8A8 /* CocoaMarkdown.framework in Embed Frameworks */,
|
||||
4B2A2BFF1D0351810074CE9A /* SwiftNeoVim.framework in Embed Frameworks */,
|
||||
4B2A2BEF1D02261F0074CE9A /* RxSwift.framework in Embed Frameworks */,
|
||||
4BB7F3941F9D261500624F61 /* Swifter.framework in Embed Frameworks */,
|
||||
4B401B161D0454E900D99EDC /* PureLayout.framework in Embed Frameworks */,
|
||||
4B2A2BED1D02261F0074CE9A /* RxCocoa.framework in Embed Frameworks */,
|
||||
);
|
||||
@ -541,6 +526,7 @@
|
||||
4BB409E61DD68CCC005F39A2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/FileBrowserMenu.xib; sourceTree = "<group>"; };
|
||||
4BB409ED1DDA77E9005F39A2 /* ProxyWorkspaceBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProxyWorkspaceBar.swift; path = Workspace/ProxyWorkspaceBar.swift; sourceTree = "<group>"; };
|
||||
4BB489411D952CF6005BB0E8 /* WorkspaceToolButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WorkspaceToolButton.swift; path = Workspace/WorkspaceToolButton.swift; sourceTree = "<group>"; };
|
||||
4BB7F3911F9D260B00624F61 /* Swifter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Swifter.framework; path = Carthage/Build/Mac/Swifter.framework; sourceTree = "<group>"; };
|
||||
4BCADE071D11ED12004DAD0F /* CocoaExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CocoaExtensions.swift; sourceTree = "<group>"; };
|
||||
4BCF638F1D323CFD00F15CE4 /* nvim */ = {isa = PBXFileReference; lastKnownFileType = folder; name = nvim; path = neovim/src/nvim; sourceTree = SOURCE_ROOT; };
|
||||
4BDCFAC91D31449700F62670 /* NeoVimServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NeoVimServer.h; sourceTree = "<group>"; };
|
||||
@ -568,24 +554,6 @@
|
||||
4BDF641B1D0887C100D47E1D /* TextDrawer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextDrawer.m; sourceTree = "<group>"; };
|
||||
4BDF64221D08CAB000D47E1D /* MMCoreTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMCoreTextView.h; sourceTree = "<group>"; };
|
||||
4BDF64231D08CAB000D47E1D /* MMCoreTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMCoreTextView.m; sourceTree = "<group>"; };
|
||||
4BE149751EEF4792003DE5E2 /* Errno.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Errno.swift; path = Carthage/Checkouts/swifter/Sources/Errno.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE149761EEF4792003DE5E2 /* Files.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Files.swift; path = Carthage/Checkouts/swifter/Sources/Files.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE149771EEF4792003DE5E2 /* HttpParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HttpParser.swift; path = Carthage/Checkouts/swifter/Sources/HttpParser.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE149781EEF4792003DE5E2 /* HttpRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HttpRequest.swift; path = Carthage/Checkouts/swifter/Sources/HttpRequest.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE149791EEF4792003DE5E2 /* HttpResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HttpResponse.swift; path = Carthage/Checkouts/swifter/Sources/HttpResponse.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE1497A1EEF4792003DE5E2 /* HttpRouter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HttpRouter.swift; path = Carthage/Checkouts/swifter/Sources/HttpRouter.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE1497B1EEF4792003DE5E2 /* HttpServer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HttpServer.swift; path = Carthage/Checkouts/swifter/Sources/HttpServer.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE1497C1EEF4792003DE5E2 /* HttpServerIO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HttpServerIO.swift; path = Carthage/Checkouts/swifter/Sources/HttpServerIO.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE1497D1EEF4792003DE5E2 /* Process.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Process.swift; path = Carthage/Checkouts/swifter/Sources/Process.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE1497E1EEF4792003DE5E2 /* Scopes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Scopes.swift; path = Carthage/Checkouts/swifter/Sources/Scopes.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE1497F1EEF4792003DE5E2 /* Socket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Socket.swift; path = Carthage/Checkouts/swifter/Sources/Socket.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BE149801EEF4792003DE5E2 /* Socket+File.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Socket+File.swift"; path = "Carthage/Checkouts/swifter/Sources/Socket+File.swift"; sourceTree = SOURCE_ROOT; };
|
||||
4BE149811EEF4792003DE5E2 /* Socket+Server.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Socket+Server.swift"; path = "Carthage/Checkouts/swifter/Sources/Socket+Server.swift"; sourceTree = SOURCE_ROOT; };
|
||||
4BE149821EEF4792003DE5E2 /* String+BASE64.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+BASE64.swift"; path = "Carthage/Checkouts/swifter/Sources/String+BASE64.swift"; sourceTree = SOURCE_ROOT; };
|
||||
4BE149831EEF4792003DE5E2 /* String+File.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+File.swift"; path = "Carthage/Checkouts/swifter/Sources/String+File.swift"; sourceTree = SOURCE_ROOT; };
|
||||
4BE149841EEF4792003DE5E2 /* String+Misc.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+Misc.swift"; path = "Carthage/Checkouts/swifter/Sources/String+Misc.swift"; sourceTree = SOURCE_ROOT; };
|
||||
4BE149851EEF4792003DE5E2 /* String+SHA1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+SHA1.swift"; path = "Carthage/Checkouts/swifter/Sources/String+SHA1.swift"; sourceTree = SOURCE_ROOT; };
|
||||
4BE149861EEF4792003DE5E2 /* WebSockets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WebSockets.swift; path = Carthage/Checkouts/swifter/Sources/WebSockets.swift; sourceTree = SOURCE_ROOT; };
|
||||
4BEBA5051CFF374B00673FDF /* VimR.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VimR.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4BEBA5081CFF374B00673FDF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
4BEBA50A1CFF374B00673FDF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
@ -665,6 +633,7 @@
|
||||
4B2A2BFE1D0351810074CE9A /* SwiftNeoVim.framework in Frameworks */,
|
||||
4BDD056A1DB0CAB700D1B405 /* Sparkle.framework in Frameworks */,
|
||||
4B337FBB1DEB76F20020ADD2 /* CocoaFontAwesome.framework in Frameworks */,
|
||||
4BB7F3931F9D261500624F61 /* Swifter.framework in Frameworks */,
|
||||
4B183E0E1E06E2940079E8A8 /* CocoaMarkdown.framework in Frameworks */,
|
||||
4B2A2BEE1D02261F0074CE9A /* RxSwift.framework in Frameworks */,
|
||||
4B401B141D0454DC00D99EDC /* PureLayout.framework in Frameworks */,
|
||||
@ -887,6 +856,7 @@
|
||||
4B5012001EBA791000F76C46 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4BB7F3911F9D260B00624F61 /* Swifter.framework */,
|
||||
4B5011F71EBA67EB00F76C46 /* RxTest.framework */,
|
||||
4B183E0D1E06E2940079E8A8 /* CocoaMarkdown.framework */,
|
||||
4B337FBA1DEB76F20020ADD2 /* CocoaFontAwesome.framework */,
|
||||
@ -1032,31 +1002,6 @@
|
||||
name = "File Items";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4BE149741EEF4771003DE5E2 /* Swifter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4BE149751EEF4792003DE5E2 /* Errno.swift */,
|
||||
4BE149761EEF4792003DE5E2 /* Files.swift */,
|
||||
4BE149771EEF4792003DE5E2 /* HttpParser.swift */,
|
||||
4BE149781EEF4792003DE5E2 /* HttpRequest.swift */,
|
||||
4BE149791EEF4792003DE5E2 /* HttpResponse.swift */,
|
||||
4BE1497A1EEF4792003DE5E2 /* HttpRouter.swift */,
|
||||
4BE1497B1EEF4792003DE5E2 /* HttpServer.swift */,
|
||||
4BE1497C1EEF4792003DE5E2 /* HttpServerIO.swift */,
|
||||
4BE1497D1EEF4792003DE5E2 /* Process.swift */,
|
||||
4BE1497E1EEF4792003DE5E2 /* Scopes.swift */,
|
||||
4BE1497F1EEF4792003DE5E2 /* Socket.swift */,
|
||||
4BE149801EEF4792003DE5E2 /* Socket+File.swift */,
|
||||
4BE149811EEF4792003DE5E2 /* Socket+Server.swift */,
|
||||
4BE149821EEF4792003DE5E2 /* String+BASE64.swift */,
|
||||
4BE149831EEF4792003DE5E2 /* String+File.swift */,
|
||||
4BE149841EEF4792003DE5E2 /* String+Misc.swift */,
|
||||
4BE149851EEF4792003DE5E2 /* String+SHA1.swift */,
|
||||
4BE149861EEF4792003DE5E2 /* WebSockets.swift */,
|
||||
);
|
||||
name = Swifter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4BEBA4FC1CFF374B00673FDF = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -1100,7 +1045,6 @@
|
||||
4B6423941D8EFD6100FC78C8 /* Workspace */,
|
||||
4B97E2CF1D33F92200FC0660 /* resources */,
|
||||
1929BA652D3B88FC071531EC /* UI */,
|
||||
4BE149741EEF4771003DE5E2 /* Swifter */,
|
||||
);
|
||||
path = VimR;
|
||||
sourceTree = "<group>";
|
||||
@ -1341,7 +1285,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0830;
|
||||
LastUpgradeCheck = 0820;
|
||||
LastUpgradeCheck = 0900;
|
||||
ORGANIZATIONNAME = "Tae Won Ha";
|
||||
TargetAttributes = {
|
||||
4B12CD851F5A985600167D59 = {
|
||||
@ -1351,7 +1295,7 @@
|
||||
4B2A2BF61D0351810074CE9A = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
DevelopmentTeam = H96Q2NKTQH;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 0900;
|
||||
};
|
||||
4B56F28F1D29903F00C1F92E = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
@ -1371,11 +1315,11 @@
|
||||
4BEBA5041CFF374B00673FDF = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
DevelopmentTeam = H96Q2NKTQH;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 0900;
|
||||
};
|
||||
4BEBA5131CFF374B00673FDF = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 0900;
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -1622,25 +1566,19 @@
|
||||
4B6423981D8EFDE000FC78C8 /* WorkspaceBar.swift in Sources */,
|
||||
4BB1BEA91D48773200463C29 /* RxSwiftCommons.swift in Sources */,
|
||||
4B6A70961D6100E300E12030 /* SwiftCommons.swift in Sources */,
|
||||
4BE149911EEF4792003DE5E2 /* Socket.swift in Sources */,
|
||||
4BEBA5091CFF374B00673FDF /* AppDelegate.swift in Sources */,
|
||||
4B64239A1D8EFE3000FC78C8 /* WorkspaceTool.swift in Sources */,
|
||||
1929B462CD4935AFF6D69457 /* FileItem.swift in Sources */,
|
||||
1929B6388EAF16C190B82955 /* FileItemIgnorePattern.swift in Sources */,
|
||||
4BE1498E1EEF4792003DE5E2 /* HttpServerIO.swift in Sources */,
|
||||
4BE149951EEF4792003DE5E2 /* String+File.swift in Sources */,
|
||||
1929B67DA3EB21A631EF1DBB /* FileUtils.swift in Sources */,
|
||||
1929B3F5743967125F357C9F /* Matcher.swift in Sources */,
|
||||
1929B53876E6952D378C2B30 /* ScoredFileItem.swift in Sources */,
|
||||
1929BD3F9E609BFADB27584B /* Scorer.swift in Sources */,
|
||||
4BE149871EEF4792003DE5E2 /* Errno.swift in Sources */,
|
||||
4BB409EE1DDA77E9005F39A2 /* ProxyWorkspaceBar.swift in Sources */,
|
||||
1929B0E0C3BC59F52713D5A2 /* FoundationCommons.swift in Sources */,
|
||||
1929BD2F41D93ADFF43C1C98 /* NetUtils.m in Sources */,
|
||||
1929BE0DAEE9664C5BCFA211 /* States.swift in Sources */,
|
||||
4BE149931EEF4792003DE5E2 /* Socket+Server.swift in Sources */,
|
||||
1929B4FEE6EB56EF3F56B805 /* Context.swift in Sources */,
|
||||
4BE149901EEF4792003DE5E2 /* Scopes.swift in Sources */,
|
||||
1929BD3878A3A47B8D685CD2 /* AppDelegateReducer.swift in Sources */,
|
||||
1929BAFF1E011321D3186EE6 /* UiRoot.swift in Sources */,
|
||||
1929B29B95AD176D57942E08 /* UiRootReducer.swift in Sources */,
|
||||
@ -1649,45 +1587,33 @@
|
||||
1929B4B70926DE113E6BF990 /* PreviewReducer.swift in Sources */,
|
||||
1929B5C1BABBC0D09D97C3EF /* PreviewService.swift in Sources */,
|
||||
1929B0F599D1F62C7BE53D2C /* HttpServerService.swift in Sources */,
|
||||
4BE149881EEF4792003DE5E2 /* Files.swift in Sources */,
|
||||
1929B3AC66EFE35D68C020E3 /* PreviewToolReducer.swift in Sources */,
|
||||
1929B59FA5C286E010F70BEE /* Types.swift in Sources */,
|
||||
4BE149941EEF4792003DE5E2 /* String+BASE64.swift in Sources */,
|
||||
1929B6D8F5FC723B7109031F /* OpenQuicklyReducer.swift in Sources */,
|
||||
1929B5543B1E31A26096E656 /* FileMonitorReducer.swift in Sources */,
|
||||
1929B5F016431A76292D1E84 /* FileMonitor.swift in Sources */,
|
||||
1929B71381946860626E5224 /* FileBrowserReducer.swift in Sources */,
|
||||
1929BA715337FE26155B2071 /* OpenedFileList.swift in Sources */,
|
||||
1929B4E54E2F13A7F5F2B682 /* OpenedFileListReducer.swift in Sources */,
|
||||
4BE1498B1EEF4792003DE5E2 /* HttpResponse.swift in Sources */,
|
||||
1929BAE4900D72A7877741B1 /* PrefWindow.swift in Sources */,
|
||||
1929BEAE0592096BC1191B67 /* PrefPane.swift in Sources */,
|
||||
1929BEDE1BE950EDA9497363 /* GeneralPref.swift in Sources */,
|
||||
1929B3217A7A3D79E28C80DB /* PrefWindowReducer.swift in Sources */,
|
||||
4BE1498C1EEF4792003DE5E2 /* HttpRouter.swift in Sources */,
|
||||
4BE1498F1EEF4792003DE5E2 /* Process.swift in Sources */,
|
||||
1929B6BE1610892E6C4C0CE6 /* GeneralPrefReducer.swift in Sources */,
|
||||
1929B05B9D664052EC2D23EF /* FileOutlineView.swift in Sources */,
|
||||
1929BCC9D3604933DFF07E2E /* FileBrowser.swift in Sources */,
|
||||
1929B4F0612224E594E89B92 /* AppearancePref.swift in Sources */,
|
||||
4BE1498D1EEF4792003DE5E2 /* HttpServer.swift in Sources */,
|
||||
1929B50D933A369A86A165DE /* AdvencedPref.swift in Sources */,
|
||||
1929BCC7908DD899999B70BE /* AppearancePrefReducer.swift in Sources */,
|
||||
1929B00BA624DA8DC75F7E02 /* SerializableStates.swift in Sources */,
|
||||
4BE149961EEF4792003DE5E2 /* String+Misc.swift in Sources */,
|
||||
1929B3557317755A43513B17 /* OpenQuicklyWindow.swift in Sources */,
|
||||
4BE149981EEF4792003DE5E2 /* WebSockets.swift in Sources */,
|
||||
4BE149971EEF4792003DE5E2 /* String+SHA1.swift in Sources */,
|
||||
1929B333855A5406C400DA92 /* OpenQuicklyFilterOperation.swift in Sources */,
|
||||
1929B1837C750CADB3A5BCB9 /* OpenQuicklyFileViewRow.swift in Sources */,
|
||||
1929B990A143763A56CFCED0 /* PrefService.swift in Sources */,
|
||||
4BE149921EEF4792003DE5E2 /* Socket+File.swift in Sources */,
|
||||
1929BA76A1D97D8226F7CFB1 /* Debouncer.swift in Sources */,
|
||||
1929B71610FF1DC6E459BA49 /* PreviewUtils.swift in Sources */,
|
||||
1929B08C6230B9C5AB72DAF1 /* Pref128ToCurrentConverter.swift in Sources */,
|
||||
4BE1498A1EEF4792003DE5E2 /* HttpRequest.swift in Sources */,
|
||||
1929B94083273D4B321AD848 /* FileItemUtils.swift in Sources */,
|
||||
4BE149891EEF4792003DE5E2 /* HttpParser.swift in Sources */,
|
||||
1929BFDE22D155F7C4B19E96 /* HtmlPreviewTool.swift in Sources */,
|
||||
1929B4B00D7BB191A9A6532D /* HtmlPreviewToolReducer.swift in Sources */,
|
||||
1929BCF7F7B9CC5499A3F506 /* AdvancedPrefReducer.swift in Sources */,
|
||||
@ -2105,14 +2031,20 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
@ -2141,7 +2073,7 @@
|
||||
OTHER_SWIFT_FLAGS = "-D DEBUG";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 4.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Debug;
|
||||
@ -2155,14 +2087,20 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
@ -2183,7 +2121,7 @@
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 4.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Release;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
@ -45,6 +46,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
@ -45,6 +46,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
@ -55,6 +56,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
@ -45,6 +46,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
@ -45,6 +46,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
@ -55,6 +56,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
@ -121,11 +121,11 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
// MARK: - Actions
|
||||
extension AdvancedPref {
|
||||
|
||||
func useInteractiveZshAction(_ sender: NSButton) {
|
||||
@objc func useInteractiveZshAction(_ sender: NSButton) {
|
||||
self.emit(.setUseInteractiveZsh(sender.boolState))
|
||||
}
|
||||
|
||||
func useSnapshotUpdateChannelAction(_ sender: NSButton) {
|
||||
@objc func useSnapshotUpdateChannelAction(_ sender: NSButton) {
|
||||
self.emit(.setUseSnapshotUpdate(sender.boolState))
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ extension AppDelegate {
|
||||
return false
|
||||
}
|
||||
|
||||
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplicationTerminateReply {
|
||||
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
|
||||
self.stateContext.savePrefs()
|
||||
|
||||
if self.hasDirtyWindows && self.hasMainWindows {
|
||||
@ -143,7 +143,7 @@ extension AppDelegate {
|
||||
discardAndQuitButton.keyEquivalentModifierMask = .command
|
||||
discardAndQuitButton.keyEquivalent = "d"
|
||||
|
||||
if alert.runModal() == NSAlertSecondButtonReturn {
|
||||
if alert.runModal() == .alertSecondButtonReturn {
|
||||
self.uiRoot.prepareQuit()
|
||||
return .terminateNow
|
||||
}
|
||||
@ -172,7 +172,7 @@ extension AppDelegate {
|
||||
// MARK: - AppleScript
|
||||
extension AppDelegate {
|
||||
|
||||
func handle(getUrlEvent event: NSAppleEventDescriptor, replyEvent: NSAppleEventDescriptor) {
|
||||
@objc func handle(getUrlEvent event: NSAppleEventDescriptor, replyEvent: NSAppleEventDescriptor) {
|
||||
guard let urlString = event.paramDescriptor(forKeyword: UInt32(keyDirectObject))?.stringValue else {
|
||||
return
|
||||
}
|
||||
@ -286,7 +286,7 @@ extension AppDelegate {
|
||||
panel.canChooseDirectories = true
|
||||
panel.allowsMultipleSelection = true
|
||||
panel.begin { result in
|
||||
guard result == NSFileHandlingPanelOKButton else {
|
||||
guard result == .OK else {
|
||||
return
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ fileprivate enum VimRUrlAction: String {
|
||||
|
||||
fileprivate let updater = SUUpdater()
|
||||
|
||||
fileprivate let debugMenuItemIdentifier = "debug-menu-item"
|
||||
fileprivate let debugMenuItemIdentifier = NSUserInterfaceItemIdentifier("debug-menu-item")
|
||||
|
||||
fileprivate let filePrefix = "file="
|
||||
fileprivate let cwdPrefix = "cwd="
|
||||
|
@ -43,7 +43,7 @@ extension NSImage {
|
||||
|
||||
result.lockFocus()
|
||||
color.set()
|
||||
NSRectFillUsingOperation(CGRect(origin: .zero, size: self.size), .sourceAtop)
|
||||
CGRect(origin: .zero, size: self.size).fill(using: .sourceAtop)
|
||||
result.unlockFocus()
|
||||
|
||||
return result
|
||||
@ -54,11 +54,11 @@ extension NSButton {
|
||||
|
||||
var boolState: Bool {
|
||||
get {
|
||||
return self.state == NSOnState ? true : false
|
||||
return self.state == .on ? true : false
|
||||
}
|
||||
|
||||
set {
|
||||
self.state = newValue ? NSOnState : NSOffState
|
||||
self.state = newValue ? .on : .off
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -67,11 +67,11 @@ extension NSMenuItem {
|
||||
|
||||
var boolState: Bool {
|
||||
get {
|
||||
return self.state == NSOnState ? true : false
|
||||
return self.state == .on ? true : false
|
||||
}
|
||||
|
||||
set {
|
||||
self.state = newValue ? NSOnState : NSOffState
|
||||
self.state = newValue ? .on : .off
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -102,17 +102,17 @@ extension NSAttributedString {
|
||||
}
|
||||
|
||||
static func infoLabel(markdown: String) -> NSAttributedString {
|
||||
let size = NSFont.smallSystemFontSize()
|
||||
let size = NSFont.smallSystemFontSize
|
||||
let document = CMDocument(data: markdown.data(using: .utf8), options: .normalize)
|
||||
|
||||
let attrs = CMTextAttributes()
|
||||
attrs?.textAttributes = [
|
||||
NSFontAttributeName: NSFont.systemFont(ofSize: size),
|
||||
NSForegroundColorAttributeName: NSColor.gray,
|
||||
NSAttributedStringKey.font: NSFont.systemFont(ofSize: size),
|
||||
NSAttributedStringKey.foregroundColor: NSColor.gray,
|
||||
]
|
||||
attrs?.inlineCodeAttributes = [
|
||||
NSFontAttributeName: NSFont.userFixedPitchFont(ofSize: size)!,
|
||||
NSForegroundColorAttributeName: NSColor.gray,
|
||||
NSAttributedStringKey.font: NSFont.userFixedPitchFont(ofSize: size)!,
|
||||
NSAttributedStringKey.foregroundColor: NSColor.gray,
|
||||
]
|
||||
|
||||
let renderer = CMAttributedStringRenderer(document: document, attributes: attrs)
|
||||
@ -138,7 +138,7 @@ extension NSView {
|
||||
self.removeConstraints(self.constraints)
|
||||
}
|
||||
|
||||
var isFirstResponder: Bool {
|
||||
@objc var isFirstResponder: Bool {
|
||||
return self.window?.firstResponder == self
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ extension NSTableView {
|
||||
static func standardTableView() -> NSTableView {
|
||||
let tableView = NSTableView(frame: CGRect.zero)
|
||||
|
||||
let column = NSTableColumn(identifier: "name")
|
||||
let column = NSTableColumn(identifier: NSUserInterfaceItemIdentifier("name"))
|
||||
column.isEditable = false
|
||||
|
||||
tableView.addTableColumn(column)
|
||||
@ -183,7 +183,7 @@ extension NSOutlineView {
|
||||
}
|
||||
|
||||
static func configure(toStandard outlineView: NSOutlineView) {
|
||||
let column = NSTableColumn(identifier: "name")
|
||||
let column = NSTableColumn(identifier: NSUserInterfaceItemIdentifier("name"))
|
||||
column.resizingMask = .autoresizingMask
|
||||
column.isEditable = false
|
||||
|
||||
|
@ -74,8 +74,6 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
fileprivate let emit: (Action) -> Void
|
||||
fileprivate let disposeBag = DisposeBag()
|
||||
|
||||
fileprivate let fontManager = NSFontManager.shared()
|
||||
|
||||
fileprivate var font: NSFont
|
||||
fileprivate var linespacing: CGFloat
|
||||
fileprivate var usesLigatures: Bool
|
||||
@ -135,7 +133,7 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
|
||||
// This takes approx. 0.8s - 1s on my machine... -_-
|
||||
DispatchQueue.global(qos: .background).async {
|
||||
fontPopup.addItems(withTitles: self.fontManager.availableFontNames(with: .fixedPitchFontMask)!)
|
||||
fontPopup.addItems(withTitles: sharedFontManager.availableFontNames(with: .fixedPitchFontMask)!)
|
||||
self.updateViews()
|
||||
}
|
||||
|
||||
@ -162,8 +160,9 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
previewArea.isHorizontallyResizable = true
|
||||
previewArea.textContainer?.heightTracksTextView = false
|
||||
previewArea.textContainer?.widthTracksTextView = false
|
||||
previewArea.autoresizingMask = [.viewWidthSizable, .viewHeightSizable]
|
||||
previewArea.textContainer?.containerSize = CGSize.init(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)
|
||||
previewArea.autoresizingMask = [.width, .height]
|
||||
previewArea.textContainer?.containerSize = CGSize(width: CGFloat.greatestFiniteMagnitude,
|
||||
height: CGFloat.greatestFiniteMagnitude)
|
||||
previewArea.layoutManager?.replaceTextStorage(NSTextStorage(string: self.exampleText))
|
||||
previewArea.isRichText = false
|
||||
previewArea.turnOffLigatures(self)
|
||||
@ -223,7 +222,7 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
linespacingField.autoPinEdge(.top, to: .bottom, of: sizeCombo, withOffset: 18)
|
||||
linespacingField.autoPinEdge(.left, to: .right, of: linespacingTitle, withOffset: 5)
|
||||
linespacingField.autoSetDimension(.width, toSize: 60)
|
||||
NotificationCenter.default.addObserver(forName: NSNotification.Name.NSControlTextDidEndEditing,
|
||||
NotificationCenter.default.addObserver(forName: NSControl.textDidEndEditingNotification,
|
||||
object: linespacingField,
|
||||
queue: nil) { [unowned self] _ in
|
||||
self.linespacingAction()
|
||||
@ -259,19 +258,19 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
// MARK: - Actions
|
||||
extension AppearancePref {
|
||||
|
||||
func usesColorschemeAction(_ sender: NSButton) {
|
||||
@objc func usesColorschemeAction(_ sender: NSButton) {
|
||||
self.emit(.setUsesColorscheme(sender.boolState))
|
||||
}
|
||||
|
||||
func fileIconAction(_ sender: NSButton) {
|
||||
@objc func fileIconAction(_ sender: NSButton) {
|
||||
self.emit(.setShowsFileIcon(sender.boolState))
|
||||
}
|
||||
|
||||
func usesLigaturesAction(_ sender: NSButton) {
|
||||
@objc func usesLigaturesAction(_ sender: NSButton) {
|
||||
self.emit(.setUsesLigatures(sender.boolState))
|
||||
}
|
||||
|
||||
func fontPopupAction(_ sender: NSPopUpButton) {
|
||||
@objc func fontPopupAction(_ sender: NSPopUpButton) {
|
||||
guard let selectedItem = self.fontPopup.selectedItem else {
|
||||
return
|
||||
}
|
||||
@ -293,14 +292,14 @@ extension AppearancePref {
|
||||
}
|
||||
|
||||
let newFontSize = self.cappedFontSize(Int(self.sizes[self.sizeCombo.indexOfSelectedItem]))
|
||||
let newFont = self.fontManager.convert(self.font, toSize: newFontSize)
|
||||
let newFont = sharedFontManager.convert(self.font, toSize: newFontSize)
|
||||
|
||||
self.emit(.setFont(newFont))
|
||||
}
|
||||
|
||||
func sizeComboBoxDidEnter(_ sender: AnyObject!) {
|
||||
@objc func sizeComboBoxDidEnter(_ sender: AnyObject!) {
|
||||
let newFontSize = self.cappedFontSize(self.sizeCombo.integerValue)
|
||||
let newFont = self.fontManager.convert(self.font, toSize: newFontSize)
|
||||
let newFont = sharedFontManager.convert(self.font, toSize: newFontSize)
|
||||
|
||||
self.emit(.setFont(newFont))
|
||||
}
|
||||
@ -338,3 +337,5 @@ extension AppearancePref {
|
||||
return cgfSize
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate let sharedFontManager = NSFontManager.shared
|
||||
|
@ -22,7 +22,7 @@ class Application: NSApplication {
|
||||
}
|
||||
|
||||
@IBAction override func showHelp(_: Any?) {
|
||||
NSWorkspace.shared().open(URL(string: "https://github.com/qvacua/vimr/wiki")!)
|
||||
NSWorkspace.shared.open(URL(string: "https://github.com/qvacua/vimr/wiki")!)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ extension FileBrowser {
|
||||
// MARK: - Actions
|
||||
extension FileBrowser {
|
||||
|
||||
func showHiddenAction(_ sender: Any?) {
|
||||
@objc func showHiddenAction(_ sender: Any?) {
|
||||
guard let menuItem = sender as? NSMenuItem else {
|
||||
return
|
||||
}
|
||||
@ -172,11 +172,11 @@ extension FileBrowser {
|
||||
self.emit(UuidAction(uuid: self.uuid, action: .setShowHidden(!menuItem.boolState)))
|
||||
}
|
||||
|
||||
func goToParentAction(_ sender: Any?) {
|
||||
@objc func goToParentAction(_ sender: Any?) {
|
||||
self.emit(UuidAction(uuid: self.uuid, action: .setAsWorkingDirectory(self.cwd.parent)))
|
||||
}
|
||||
|
||||
func scrollToSourceAction(_ sender: Any?) {
|
||||
@objc func scrollToSourceAction(_ sender: Any?) {
|
||||
guard let url = self.currentBufferUrl else {
|
||||
return
|
||||
}
|
||||
@ -184,7 +184,7 @@ extension FileBrowser {
|
||||
self.fileView.select(url)
|
||||
}
|
||||
|
||||
func refreshAction(_ sender: Any?) {
|
||||
@objc func refreshAction(_ sender: Any?) {
|
||||
self.emit(UuidAction(uuid: self.uuid, action: .refresh))
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ class FileItemIgnorePattern: Hashable, CustomStringConvertible {
|
||||
}
|
||||
|
||||
static func from(string str: String) -> Set<FileItemIgnorePattern> {
|
||||
if str.trimmingCharacters(in: whitespaceCharSet).characters.count == 0 {
|
||||
if str.trimmingCharacters(in: whitespaceCharSet).count == 0 {
|
||||
return Set()
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ class FileItemIgnorePattern: Hashable, CustomStringConvertible {
|
||||
.components(separatedBy: ",")
|
||||
.flatMap {
|
||||
let trimmed = $0.trimmingCharacters(in: whitespaceCharSet)
|
||||
if trimmed.characters.count == 0 {
|
||||
if trimmed.count == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -46,33 +46,33 @@ class FileItemIgnorePattern: Hashable, CustomStringConvertible {
|
||||
var description: String {
|
||||
return "<FileItemIgnorePattern: pattern=\(self.pattern), folderPattern=\(self.folderPattern)>"
|
||||
}
|
||||
|
||||
|
||||
let folderPattern: Bool
|
||||
let pattern: String
|
||||
|
||||
|
||||
fileprivate let patternAsFileSysRep: UnsafeMutablePointer<Int8>
|
||||
|
||||
|
||||
init(pattern: String) {
|
||||
self.pattern = pattern
|
||||
self.folderPattern = pattern.hasPrefix("*/")
|
||||
|
||||
|
||||
let fileSysRep = (pattern as NSString).fileSystemRepresentation
|
||||
let len = Int(strlen(fileSysRep))
|
||||
|
||||
|
||||
self.patternAsFileSysRep = UnsafeMutablePointer<Int8>.allocate(capacity: len + 1)
|
||||
memcpy(self.patternAsFileSysRep, fileSysRep, len)
|
||||
self.patternAsFileSysRep[len] = 0
|
||||
}
|
||||
|
||||
|
||||
deinit {
|
||||
let len = Int(strlen(self.patternAsFileSysRep))
|
||||
self.patternAsFileSysRep.deallocate(capacity: len + 1)
|
||||
}
|
||||
|
||||
|
||||
func match(absolutePath path: String) -> Bool {
|
||||
let matches: Int32
|
||||
let absolutePath = path as NSString
|
||||
|
||||
|
||||
if self.folderPattern {
|
||||
matches = fnmatch(self.patternAsFileSysRep,
|
||||
absolutePath.fileSystemRepresentation,
|
||||
@ -82,7 +82,7 @@ class FileItemIgnorePattern: Hashable, CustomStringConvertible {
|
||||
(absolutePath.lastPathComponent as NSString).fileSystemRepresentation,
|
||||
FNM_NOESCAPE)
|
||||
}
|
||||
|
||||
|
||||
return matches != FNM_NOMATCH
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class FileOutlineView: NSOutlineView,
|
||||
self.delegate = self
|
||||
self.allowsEmptySelection = true
|
||||
|
||||
guard Bundle.main.loadNibNamed("FileBrowserMenu", owner: self, topLevelObjects: nil) else {
|
||||
guard Bundle.main.loadNibNamed(NSNib.Name(rawValue: "FileBrowserMenu"), owner: self, topLevelObjects: nil) else {
|
||||
NSLog("WARN: FileBrowserMenu.xib could not be loaded")
|
||||
return
|
||||
}
|
||||
@ -341,7 +341,7 @@ extension FileOutlineView {
|
||||
extension FileOutlineView {
|
||||
|
||||
func outlineView(_ outlineView: NSOutlineView, rowViewForItem item: Any) -> NSTableRowView? {
|
||||
return self.make(withIdentifier: "file-row-view", owner: self) as? ThemedTableRow
|
||||
return self.makeView(withIdentifier: NSUserInterfaceItemIdentifier("file-row-view"), owner: self) as? ThemedTableRow
|
||||
?? ThemedTableRow(withIdentifier: "file-row-view", themedView: self)
|
||||
}
|
||||
|
||||
@ -350,7 +350,7 @@ extension FileOutlineView {
|
||||
return nil
|
||||
}
|
||||
|
||||
let cell = (self.make(withIdentifier: "file-cell-view", owner: self) as? ThemedTableCell)?.reset()
|
||||
let cell = (self.makeView(withIdentifier: NSUserInterfaceItemIdentifier("file-cell-view"), owner: self) as? ThemedTableCell)?.reset()
|
||||
?? ThemedTableCell(withIdentifier: "file-cell-view")
|
||||
|
||||
cell.isDir = fileBrowserItem.isDir
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
fileprivate let workspace = NSWorkspace.shared()
|
||||
fileprivate let workspace = NSWorkspace.shared
|
||||
fileprivate let iconsCache = NSCache<NSURL, NSImage>()
|
||||
|
||||
class FileUtils {
|
||||
|
@ -112,7 +112,7 @@ class GeneralPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
|
||||
let ignoreListTitle = self.titleTextField(title: "Files To Ignore:")
|
||||
let ignoreField = self.ignoreField
|
||||
NotificationCenter.default.addObserver(forName: NSNotification.Name.NSControlTextDidEndEditing,
|
||||
NotificationCenter.default.addObserver(forName: NSControl.textDidEndEditingNotification,
|
||||
object: ignoreField,
|
||||
queue: nil) { [unowned self] _ in
|
||||
self.ignorePatternsAction()
|
||||
@ -204,13 +204,13 @@ class GeneralPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
// MARK: - Actions
|
||||
extension GeneralPref {
|
||||
|
||||
func copyCliTool(_ sender: NSButton) {
|
||||
@objc func copyCliTool(_ sender: NSButton) {
|
||||
let panel = NSOpenPanel()
|
||||
panel.canChooseFiles = false
|
||||
panel.canChooseDirectories = true
|
||||
|
||||
panel.beginSheetModal(for: self.window!) { result in
|
||||
guard result == NSFileHandlingPanelOKButton else {
|
||||
guard result == .OK else {
|
||||
return
|
||||
}
|
||||
|
||||
@ -234,15 +234,15 @@ extension GeneralPref {
|
||||
}
|
||||
}
|
||||
|
||||
func openUntitledWindowWhenLaunchingAction(_ sender: NSButton) {
|
||||
@objc func openUntitledWindowWhenLaunchingAction(_ sender: NSButton) {
|
||||
self.emit(.setOpenOnLaunch(self.openWhenLaunchingCheckbox.boolState))
|
||||
}
|
||||
|
||||
func openUntitledWindowOnReactivationAction(_ sender: NSButton) {
|
||||
@objc func openUntitledWindowOnReactivationAction(_ sender: NSButton) {
|
||||
self.emit(.setOpenOnReactivation(self.openOnReactivationCheckbox.boolState))
|
||||
}
|
||||
|
||||
func afterLastWindowAction(_ sender: NSPopUpButton) {
|
||||
@objc func afterLastWindowAction(_ sender: NSPopUpButton) {
|
||||
let index = sender.indexOfSelectedItem
|
||||
|
||||
guard index >= 0 && index <= 2 else {
|
||||
|
@ -99,12 +99,12 @@ class HtmlPreviewTool: NSView, UiComponent, WKNavigationDelegate {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
func selectHtmlFile(sender: Any?) {
|
||||
@objc func selectHtmlFile(sender: Any?) {
|
||||
let panel = NSOpenPanel()
|
||||
panel.canChooseDirectories = false
|
||||
panel.allowsMultipleSelection = false
|
||||
panel.beginSheetModal(for: self.window!) { result in
|
||||
guard result == NSFileHandlingPanelOKButton else {
|
||||
guard result == .OK else {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import Swifter
|
||||
|
||||
class HttpServerService {
|
||||
|
||||
|
@ -20,7 +20,7 @@ class ImageAndTextTableCell: NSTableCellView {
|
||||
static let widthWithoutText = CGFloat(2 + 16 + 4 + 2)
|
||||
|
||||
static func width(with text: String) -> CGFloat {
|
||||
let attrStr = NSAttributedString(string: text, attributes: [NSFontAttributeName: ImageAndTextTableCell.font])
|
||||
let attrStr = NSAttributedString(string: text, attributes: [NSAttributedStringKey.font: ImageAndTextTableCell.font])
|
||||
|
||||
return self.widthWithoutText + attrStr.size().width
|
||||
}
|
||||
@ -30,7 +30,7 @@ class ImageAndTextTableCell: NSTableCellView {
|
||||
height: max(self._textField.intrinsicContentSize.height, 16))
|
||||
}
|
||||
|
||||
override var backgroundStyle: NSBackgroundStyle {
|
||||
override var backgroundStyle: NSView.BackgroundStyle {
|
||||
didSet {
|
||||
let attrStr = NSMutableAttributedString(attributedString: self.attributedText)
|
||||
|
||||
@ -45,10 +45,10 @@ class ImageAndTextTableCell: NSTableCellView {
|
||||
|
||||
switch self.backgroundStyle {
|
||||
case .light:
|
||||
attrStr.addAttribute(NSForegroundColorAttributeName, value: NSColor.black, range: nameRange)
|
||||
attrStr.addAttribute(NSAttributedStringKey.foregroundColor, value: NSColor.black, range: nameRange)
|
||||
|
||||
case .dark:
|
||||
attrStr.addAttribute(NSForegroundColorAttributeName, value: NSColor.white, range: nameRange)
|
||||
attrStr.addAttribute(NSAttributedStringKey.foregroundColor, value: NSColor.white, range: nameRange)
|
||||
|
||||
default:
|
||||
return
|
||||
@ -91,7 +91,7 @@ class ImageAndTextTableCell: NSTableCellView {
|
||||
init(withIdentifier identifier: String) {
|
||||
super.init(frame: CGRect.zero)
|
||||
|
||||
self.identifier = identifier
|
||||
self.identifier = NSUserInterfaceItemIdentifier(identifier)
|
||||
|
||||
self.textField = self._textField
|
||||
self.imageView = self._imageView
|
||||
|
@ -17,7 +17,7 @@ extension MainWindow {
|
||||
panel.canChooseDirectories = true
|
||||
panel.allowsMultipleSelection = true
|
||||
panel.beginSheetModal(for: self.window) { result in
|
||||
guard result == NSFileHandlingPanelOKButton else {
|
||||
guard result == .OK else {
|
||||
return
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ extension MainWindow {
|
||||
fileprivate func savePanelSheet(action: @escaping (URL) -> Void) {
|
||||
let panel = NSSavePanel()
|
||||
panel.beginSheetModal(for: self.window) { result in
|
||||
guard result == NSFileHandlingPanelOKButton else {
|
||||
guard result == .OK else {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ extension MainWindow {
|
||||
}
|
||||
|
||||
func set(repUrl url: URL?, themed: Bool) {
|
||||
if self.window.styleMask.contains(.fullScreen) || themed == false {
|
||||
if self.window.styleMask.contains(NSWindow.StyleMask.fullScreen) || themed == false {
|
||||
self.internalSetRepUrl(url)
|
||||
return
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ extension MainWindow {
|
||||
self.emit(self.uuidAction(for: .frameChanged(to: self.window.frame)))
|
||||
}
|
||||
|
||||
func windowShouldClose(_: Any) -> Bool {
|
||||
func windowShouldClose(_: NSWindow) -> Bool {
|
||||
guard self.neoVimView.isCurrentBufferDirty() else {
|
||||
self.neoVimView.closeCurrentTab()
|
||||
return false
|
||||
@ -146,7 +146,7 @@ extension MainWindow {
|
||||
discardAndCloseButton.keyEquivalentModifierMask = .command
|
||||
discardAndCloseButton.keyEquivalent = "d"
|
||||
alert.beginSheetModal(for: self.window, completionHandler: { response in
|
||||
if response == NSAlertSecondButtonReturn {
|
||||
if response == .alertSecondButtonReturn {
|
||||
self.neoVimView.closeCurrentTabWithoutSaving()
|
||||
}
|
||||
})
|
||||
|
@ -108,7 +108,7 @@ class MainWindow: NSObject,
|
||||
|
||||
self.cliPipePath = state.cliPipePath
|
||||
|
||||
self.windowController = NSWindowController(windowNibName: "MainWindow")
|
||||
self.windowController = NSWindowController(windowNibName: NSNib.Name(rawValue: "MainWindow"))
|
||||
|
||||
let neoVimViewConfig = NeoVimView.Config(useInteractiveZsh: state.useInteractiveZsh,
|
||||
cwd: state.cwd,
|
||||
@ -322,8 +322,6 @@ class MainWindow: NSObject,
|
||||
fileprivate var linespacing = NeoVimView.defaultLinespacing
|
||||
fileprivate var usesLigatures = false
|
||||
|
||||
fileprivate let fontManager = NSFontManager.shared()
|
||||
|
||||
fileprivate var previewPosition = Marked(Position.beginning)
|
||||
|
||||
fileprivate var preview: PreviewTool?
|
||||
|
@ -14,7 +14,7 @@ class OpenQuicklyFileViewRow: NSTableRowView {
|
||||
NSColor.clear.set()
|
||||
}
|
||||
|
||||
self.rectsBeingDrawn().forEach { NSRectFillUsingOperation(NSIntersectionRect($0, dirtyRect), .sourceOver) }
|
||||
self.rectsBeingDrawn().forEach { NSIntersectionRect($0, dirtyRect).fill(using: .sourceOver) }
|
||||
}
|
||||
|
||||
fileprivate func rectsBeingDrawn() -> [CGRect] {
|
||||
|
@ -34,7 +34,7 @@ class OpenQuicklyFilterOperation: Operation {
|
||||
}
|
||||
|
||||
let sorted: [ScoredFileItem]
|
||||
if pattern.characters.count == 0 {
|
||||
if pattern.count == 0 {
|
||||
let truncatedItems = self.flatFileItems[0...min(maxResultCount, self.flatFileItems.count - 1)]
|
||||
sorted = truncatedItems.map { ScoredFileItem(score: 0, url: $0.url) }
|
||||
} else {
|
||||
|
@ -26,7 +26,7 @@ class OpenQuicklyWindow: NSObject,
|
||||
|
||||
required init(source: Observable<StateType>, emitter: ActionEmitter, state: StateType) {
|
||||
self.emit = emitter.typedEmit()
|
||||
self.windowController = NSWindowController(windowNibName: "OpenQuicklyWindow")
|
||||
self.windowController = NSWindowController(windowNibName: NSNib.Name("OpenQuicklyWindow"))
|
||||
|
||||
self.searchStream = self.searchField.rx
|
||||
.text.orEmpty
|
||||
@ -155,7 +155,7 @@ class OpenQuicklyWindow: NSObject,
|
||||
let progressIndicator = self.progressIndicator
|
||||
progressIndicator.isIndeterminate = true
|
||||
progressIndicator.isDisplayedWhenStopped = false
|
||||
progressIndicator.style = .spinningStyle
|
||||
progressIndicator.style = .spinning
|
||||
progressIndicator.controlSize = .small
|
||||
|
||||
let fileView = self.fileView
|
||||
@ -172,8 +172,8 @@ class OpenQuicklyWindow: NSObject,
|
||||
cwdControl.backgroundColor = NSColor.clear
|
||||
cwdControl.refusesFirstResponder = true
|
||||
cwdControl.cell?.controlSize = .small
|
||||
cwdControl.cell?.font = NSFont.systemFont(ofSize: NSFont.smallSystemFontSize())
|
||||
cwdControl.setContentCompressionResistancePriority(NSLayoutPriorityDefaultLow, for: .horizontal)
|
||||
cwdControl.cell?.font = NSFont.systemFont(ofSize: NSFont.smallSystemFontSize)
|
||||
cwdControl.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||
|
||||
let countField = self.countField
|
||||
countField.isEditable = false
|
||||
@ -231,7 +231,7 @@ extension OpenQuicklyWindow {
|
||||
|
||||
@objc(tableView: viewForTableColumn:row:)
|
||||
func tableView(_ tableView: NSTableView, viewFor _: NSTableColumn?, row: Int) -> NSView? {
|
||||
let cachedCell = (tableView.make(withIdentifier: "file-view-row", owner: self) as? ImageAndTextTableCell)?.reset()
|
||||
let cachedCell = (tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier("file-view-row"), owner: self) as? ImageAndTextTableCell)?.reset()
|
||||
let cell = cachedCell ?? ImageAndTextTableCell(withIdentifier: "file-view-row")
|
||||
|
||||
let url = self.fileViewItems[row].url
|
||||
@ -257,9 +257,9 @@ extension OpenQuicklyWindow {
|
||||
let rowText: NSMutableAttributedString
|
||||
let pathInfo = truncatedPathComps.dropLast().reversed().joined(separator: " / ")
|
||||
rowText = NSMutableAttributedString(string: "\(name) — \(pathInfo)")
|
||||
rowText.addAttribute(NSForegroundColorAttributeName,
|
||||
rowText.addAttribute(NSAttributedStringKey.foregroundColor,
|
||||
value: NSColor.lightGray,
|
||||
range: NSRange(location: name.characters.count, length: pathInfo.characters.count + 3))
|
||||
range: NSRange(location: name.count, length: pathInfo.characters.count + 3))
|
||||
|
||||
return rowText
|
||||
}
|
||||
@ -315,7 +315,7 @@ extension OpenQuicklyWindow {
|
||||
// MARK: - NSWindowDelegate
|
||||
extension OpenQuicklyWindow {
|
||||
|
||||
func windowShouldClose(_: Any) -> Bool {
|
||||
func windowShouldClose(_: NSWindow) -> Bool {
|
||||
self.emit(.close)
|
||||
|
||||
return false
|
||||
|
@ -114,7 +114,7 @@ class OpenedFileList: NSView,
|
||||
// MARK: - Actions
|
||||
extension OpenedFileList {
|
||||
|
||||
func doubleClickAction(_ sender: Any?) {
|
||||
@objc func doubleClickAction(_ sender: Any?) {
|
||||
let clickedRow = self.bufferList.clickedRow
|
||||
guard clickedRow >= 0 && clickedRow < self.buffers.count else {
|
||||
return
|
||||
@ -137,12 +137,12 @@ extension OpenedFileList {
|
||||
extension OpenedFileList {
|
||||
|
||||
public func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? {
|
||||
return tableView.make(withIdentifier: "buffer-row-view", owner: self) as? ThemedTableRow
|
||||
return tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier("buffer-row-view"), owner: self) as? ThemedTableRow
|
||||
?? ThemedTableRow(withIdentifier: "buffer-row-view", themedView: self)
|
||||
}
|
||||
|
||||
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
|
||||
let cachedCell = (tableView.make(withIdentifier: "buffer-cell-view", owner: self) as? ThemedTableCell)?.reset()
|
||||
let cachedCell = (tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier("buffer-cell-view"), owner: self) as? ThemedTableCell)?.reset()
|
||||
let cell = cachedCell ?? ThemedTableCell(withIdentifier: "buffer-cell-view")
|
||||
|
||||
let buffer = self.buffers[row]
|
||||
@ -169,13 +169,13 @@ extension OpenedFileList {
|
||||
let pathInfo = url.pathComponents.dropFirst().dropLast().reversed().joined(separator: " / ") + " /"
|
||||
let rowText = NSMutableAttributedString(string: "\(name) — \(pathInfo)")
|
||||
|
||||
rowText.addAttribute(NSForegroundColorAttributeName,
|
||||
rowText.addAttribute(NSAttributedStringKey.foregroundColor,
|
||||
value: self.theme.foreground,
|
||||
range: NSRange(location: 0, length: name.characters.count))
|
||||
range: NSRange(location: 0, length: name.count))
|
||||
|
||||
rowText.addAttribute(NSForegroundColorAttributeName,
|
||||
rowText.addAttribute(NSAttributedStringKey.foregroundColor,
|
||||
value: self.theme.foreground.brightening(by: 1.15),
|
||||
range: NSRange(location: name.characters.count, length: pathInfo.characters.count + 3))
|
||||
range: NSRange(location: name.count, length: pathInfo.characters.count + 3))
|
||||
|
||||
return rowText
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ class PrefUtils {
|
||||
fileprivate static let whitespaceCharSet = CharacterSet.whitespaces
|
||||
|
||||
static func ignorePatterns(fromString str: String) -> Set<FileItemIgnorePattern> {
|
||||
if str.trimmingCharacters(in: self.whitespaceCharSet).characters.count == 0 {
|
||||
if str.trimmingCharacters(in: self.whitespaceCharSet).count == 0 {
|
||||
return Set()
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ class PrefUtils {
|
||||
.components(separatedBy: ",")
|
||||
.flatMap {
|
||||
let trimmed = $0.trimmingCharacters(in: self.whitespaceCharSet)
|
||||
if trimmed.characters.count == 0 {
|
||||
if trimmed.count == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -83,10 +83,10 @@ class PrefUtils {
|
||||
static func saneFont(_ fontName: String, fontSize: CGFloat) -> NSFont {
|
||||
var editorFont = NSFont(name: fontName, size: fontSize) ?? NeoVimView.defaultFont
|
||||
if !editorFont.isFixedPitch {
|
||||
editorFont = NSFontManager.shared().convert(NeoVimView.defaultFont, toSize: editorFont.pointSize)
|
||||
editorFont = NSFontManager.shared.convert(NeoVimView.defaultFont, toSize: editorFont.pointSize)
|
||||
}
|
||||
if editorFont.pointSize < NeoVimView.minFontSize || editorFont.pointSize > NeoVimView.maxFontSize {
|
||||
editorFont = NSFontManager.shared().convert(editorFont, toSize: NeoVimView.defaultFont.pointSize)
|
||||
editorFont = NSFontManager.shared.convert(editorFont, toSize: NeoVimView.defaultFont.pointSize)
|
||||
}
|
||||
|
||||
return editorFont
|
||||
|
@ -23,7 +23,7 @@ class PrefWindow: NSObject,
|
||||
self.emit = emitter.typedEmit()
|
||||
self.openStatusMark = state.preferencesOpen.mark
|
||||
|
||||
self.windowController = NSWindowController(windowNibName: "PrefWindow")
|
||||
self.windowController = NSWindowController(windowNibName: NSNib.Name("PrefWindow"))
|
||||
|
||||
self.panes = [
|
||||
GeneralPref(source: source, emitter: emitter, state: state),
|
||||
@ -122,7 +122,7 @@ class PrefWindow: NSObject,
|
||||
// MARK: - NSWindowDelegate
|
||||
extension PrefWindow {
|
||||
|
||||
func windowShouldClose(_: Any) -> Bool {
|
||||
func windowShouldClose(_: NSWindow) -> Bool {
|
||||
self.emit(.close)
|
||||
|
||||
return false
|
||||
|
@ -178,28 +178,28 @@ class PreviewTool: NSView, UiComponent, WKNavigationDelegate {
|
||||
// MARK: - Actions
|
||||
extension PreviewTool {
|
||||
|
||||
func refreshNowAction(_: Any?) {
|
||||
@objc func refreshNowAction(_: Any?) {
|
||||
self.emit(UuidAction(uuid: self.uuid, action: .refreshNow))
|
||||
}
|
||||
|
||||
func forwardSearchAction(_: Any?) {
|
||||
@objc func forwardSearchAction(_: Any?) {
|
||||
self.forwardSearch(position: self.editorPosition.payload)
|
||||
}
|
||||
|
||||
func reverseSearchAction(_: Any?) {
|
||||
@objc func reverseSearchAction(_: Any?) {
|
||||
self.previewPosition = Marked(self.previewPosition.payload) // set a new mark
|
||||
self.emit(UuidAction(uuid: self.uuid, action: .reverseSearch(to: self.previewPosition)))
|
||||
}
|
||||
|
||||
func automaticForwardSearchAction(_ sender: NSMenuItem) {
|
||||
@objc func automaticForwardSearchAction(_ sender: NSMenuItem) {
|
||||
self.emit(UuidAction(uuid: self.uuid, action: .setAutomaticForwardSearch(to: !sender.boolState)))
|
||||
}
|
||||
|
||||
func automaticReverseSearchAction(_ sender: NSMenuItem) {
|
||||
@objc func automaticReverseSearchAction(_ sender: NSMenuItem) {
|
||||
self.emit(UuidAction(uuid: self.uuid, action: .setAutomaticReverseSearch(to: !sender.boolState)))
|
||||
}
|
||||
|
||||
func refreshOnWriteAction(_ sender: NSMenuItem) {
|
||||
@objc func refreshOnWriteAction(_ sender: NSMenuItem) {
|
||||
self.emit(UuidAction(uuid: self.uuid, action: .setRefreshOnWrite(to: !sender.boolState)))
|
||||
}
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ extension String {
|
||||
return self
|
||||
}
|
||||
|
||||
let idx = self.characters.index(self.startIndex, offsetBy: prefix.characters.count)
|
||||
return self[idx..<self.endIndex]
|
||||
let idx = self.index(self.startIndex, offsetBy: prefix.characters.count)
|
||||
return String(self[idx..<self.endIndex])
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ class ThemedTableRow: NSTableRowView {
|
||||
|
||||
super.init(frame: .zero)
|
||||
|
||||
self.identifier = identifier
|
||||
self.identifier = NSUserInterfaceItemIdentifier(identifier)
|
||||
}
|
||||
|
||||
open override func drawBackground(in dirtyRect: NSRect) {
|
||||
@ -32,7 +32,7 @@ class ThemedTableRow: NSTableRowView {
|
||||
}
|
||||
|
||||
self.themedView?.theme.background.set()
|
||||
NSRectFill(dirtyRect)
|
||||
dirtyRect.fill()
|
||||
}
|
||||
|
||||
override func drawSelection(in dirtyRect: NSRect) {
|
||||
@ -41,7 +41,7 @@ class ThemedTableRow: NSTableRowView {
|
||||
}
|
||||
|
||||
self.themedView?.theme.highlightBackground.set()
|
||||
NSRectFill(dirtyRect)
|
||||
dirtyRect.fill()
|
||||
}
|
||||
|
||||
fileprivate weak var themedView: ThemedView?
|
||||
@ -58,7 +58,7 @@ class ThemedTableCell: NSTableCellView {
|
||||
static let widthWithoutText = CGFloat(2 + 16 + 4 + 2)
|
||||
|
||||
static func width(with text: String) -> CGFloat {
|
||||
let attrStr = NSAttributedString(string: text, attributes: [NSFontAttributeName: ThemedTableCell.font])
|
||||
let attrStr = NSAttributedString(string: text, attributes: [NSAttributedStringKey.font: ThemedTableCell.font])
|
||||
|
||||
return self.widthWithoutText + attrStr.size().width
|
||||
}
|
||||
@ -123,7 +123,7 @@ class ThemedTableCell: NSTableCellView {
|
||||
init(withIdentifier identifier: String) {
|
||||
super.init(frame: .zero)
|
||||
|
||||
self.identifier = identifier
|
||||
self.identifier = NSUserInterfaceItemIdentifier(identifier)
|
||||
|
||||
self.textField = self._textField
|
||||
self.imageView = self._imageView
|
||||
@ -154,7 +154,7 @@ class ThemedTableCell: NSTableCellView {
|
||||
textField.removeFromSuperview()
|
||||
self.addSubview(textField)
|
||||
|
||||
textField.autoPinEdgesToSuperviewEdges(with: EdgeInsets(top: 2, left: 4, bottom: 2, right: 2))
|
||||
textField.autoPinEdgesToSuperviewEdges(with: NSEdgeInsets(top: 2, left: 4, bottom: 2, right: 2))
|
||||
}
|
||||
|
||||
fileprivate let _textField = NSTextField(forAutoLayout: ())
|
||||
|
@ -87,7 +87,7 @@ class InnerToolBar: NSView, NSUserInterfaceValidations {
|
||||
|
||||
override var intrinsicContentSize: CGSize {
|
||||
if #available(macOS 10.11, *) {
|
||||
return CGSize(width: NSViewNoIntrinsicMetric, height: InnerToolBar.height)
|
||||
return CGSize(width: NSView.noIntrinsicMetric, height: InnerToolBar.height)
|
||||
} else {
|
||||
return CGSize(width: -1, height: InnerToolBar.height)
|
||||
}
|
||||
@ -128,13 +128,13 @@ class InnerToolBar: NSView, NSUserInterfaceValidations {
|
||||
self.theme.separator.set()
|
||||
let bottomSeparatorRect = self.bottomSeparatorRect()
|
||||
if dirtyRect.intersects(bottomSeparatorRect) {
|
||||
NSRectFill(bottomSeparatorRect)
|
||||
bottomSeparatorRect.fill()
|
||||
}
|
||||
|
||||
self.theme.toolbarForeground.set()
|
||||
let innerSeparatorRect = self.innerSeparatorRect()
|
||||
if dirtyRect.intersects(innerSeparatorRect) {
|
||||
NSRectFill(innerSeparatorRect)
|
||||
innerSeparatorRect.fill()
|
||||
}
|
||||
}
|
||||
|
||||
@ -258,23 +258,23 @@ class InnerToolBar: NSView, NSUserInterfaceValidations {
|
||||
// MARK: - Actions
|
||||
extension InnerToolBar {
|
||||
|
||||
func closeAction(_ sender: Any?) {
|
||||
@objc func closeAction(_ sender: Any?) {
|
||||
self.tool?.toggle()
|
||||
}
|
||||
|
||||
func moveToTopAction(_ sender: Any?) {
|
||||
@objc func moveToTopAction(_ sender: Any?) {
|
||||
self.move(to: .top)
|
||||
}
|
||||
|
||||
func moveToRightAction(_ sender: Any?) {
|
||||
@objc func moveToRightAction(_ sender: Any?) {
|
||||
self.move(to: .right)
|
||||
}
|
||||
|
||||
func moveToBottomAction(_ sender: Any?) {
|
||||
@objc func moveToBottomAction(_ sender: Any?) {
|
||||
self.move(to: .bottom)
|
||||
}
|
||||
|
||||
func moveToLeftAction(_ sender: Any?) {
|
||||
@objc func moveToLeftAction(_ sender: Any?) {
|
||||
self.move(to: .left)
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ class Workspace: NSView, WorkspaceBarDelegate {
|
||||
super.init(frame: .zero)
|
||||
self.configureForAutoLayout()
|
||||
|
||||
self.register(forDraggedTypes: [WorkspaceToolButton.toolUti])
|
||||
self.registerForDraggedTypes([NSPasteboard.PasteboardType(WorkspaceToolButton.toolUti)])
|
||||
self.bars.values.forEach {
|
||||
$0.workspace = self
|
||||
$0.delegate = self
|
||||
@ -161,7 +161,7 @@ extension Workspace {
|
||||
self.endDrag()
|
||||
}
|
||||
|
||||
override func draggingEnded(_ sender: NSDraggingInfo?) {
|
||||
override func draggingEnded(_ sender: NSDraggingInfo) {
|
||||
self.endDrag()
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ extension Workspace {
|
||||
leftBar.autoPinEdge(toSuperviewEdge: .left)
|
||||
leftBar.autoPinEdge(.bottom, to: .top, of: bottomBar)
|
||||
|
||||
NSLayoutConstraint.autoSetPriority(NSLayoutPriorityDragThatCannotResizeWindow) {
|
||||
NSLayoutConstraint.autoSetPriority(.dragThatCannotResizeWindow) {
|
||||
topBar.dimensionConstraint = topBar.autoSetDimension(.height, toSize: 50)
|
||||
rightBar.dimensionConstraint = rightBar.autoSetDimension(.width, toSize: 50)
|
||||
bottomBar.dimensionConstraint = bottomBar.autoSetDimension(.height, toSize: 50)
|
||||
|
@ -38,7 +38,7 @@ fileprivate class ProxyBar: NSView {
|
||||
super.init(frame: .zero)
|
||||
self.configureForAutoLayout()
|
||||
|
||||
self.register(forDraggedTypes: [WorkspaceToolButton.toolUti])
|
||||
self.registerForDraggedTypes([NSPasteboard.PasteboardType(WorkspaceToolButton.toolUti)])
|
||||
|
||||
self.wantsLayer = true
|
||||
}
|
||||
@ -249,7 +249,7 @@ extension ProxyBar {
|
||||
fileprivate func isTool(atIndex idx: Int, beingDragged info: NSDraggingInfo) -> Bool {
|
||||
let pasteboard = info.draggingPasteboard()
|
||||
|
||||
guard let uuid = pasteboard.string(forType: WorkspaceToolButton.toolUti) else {
|
||||
guard let uuid = pasteboard.string(forType: NSPasteboard.PasteboardType(WorkspaceToolButton.toolUti)) else {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ extension ProxyBar {
|
||||
return .move
|
||||
}
|
||||
|
||||
override func draggingEnded(_ sender: NSDraggingInfo?) {
|
||||
override func draggingEnded(_ sender: NSDraggingInfo) {
|
||||
self.endDrag()
|
||||
}
|
||||
|
||||
@ -423,11 +423,11 @@ extension WorkspaceBar {
|
||||
|
||||
self.isMouseDownOngoing = true
|
||||
self.delegate?.resizeWillStart(workspaceBar: self, tool: self.selectedTool)
|
||||
self.dimensionConstraint.priority = NSLayoutPriorityDragThatCannotResizeWindow - 1
|
||||
self.dimensionConstraint.priority = NSLayoutConstraint.Priority(NSLayoutConstraint.Priority.RawValue(Int(NSLayoutConstraint.Priority.dragThatCannotResizeWindow.rawValue) - 1))
|
||||
|
||||
var dragged = false
|
||||
var curEvent = event
|
||||
let nextEventMask: NSEventMask = [.leftMouseDragged, .leftMouseDown, .leftMouseUp]
|
||||
let nextEventMask: NSEvent.EventTypeMask = [.leftMouseDragged, .leftMouseDown, .leftMouseUp]
|
||||
|
||||
while curEvent.type != .leftMouseUp {
|
||||
let nextEvent = NSApp.nextEvent(matching: nextEventMask,
|
||||
@ -459,7 +459,7 @@ extension WorkspaceBar {
|
||||
dragged = true
|
||||
}
|
||||
|
||||
self.dimensionConstraint.priority = NSLayoutPriorityDragThatCannotResizeWindow
|
||||
self.dimensionConstraint.priority = .dragThatCannotResizeWindow
|
||||
self.isMouseDownOngoing = false
|
||||
self.delegate?.resizeDidEnd(workspaceBar: self, tool: self.selectedTool)
|
||||
}
|
||||
@ -471,9 +471,9 @@ extension WorkspaceBar {
|
||||
|
||||
switch self.location {
|
||||
case .top, .bottom:
|
||||
self.addCursorRect(self.resizeRect(), cursor: NSCursor.resizeUpDown())
|
||||
self.addCursorRect(self.resizeRect(), cursor: .resizeUpDown)
|
||||
case .right, .left:
|
||||
self.addCursorRect(self.resizeRect(), cursor: NSCursor.resizeLeftRight())
|
||||
self.addCursorRect(self.resizeRect(), cursor: .resizeLeftRight)
|
||||
}
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ extension WorkspaceBar {
|
||||
|
||||
let innerLineRect = self.innerSeparatorRect()
|
||||
if dirtyRect.intersects(innerLineRect) {
|
||||
NSRectFill(innerLineRect)
|
||||
innerLineRect.fill()
|
||||
}
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ extension WorkspaceBar {
|
||||
|
||||
let outerLineRect = self.outerSeparatorRect()
|
||||
if dirtyRect.intersects(outerLineRect) {
|
||||
NSRectFill(outerLineRect)
|
||||
outerLineRect.fill()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,13 +57,13 @@ class WorkspaceToolButton: NSView, NSDraggingSource {
|
||||
|
||||
init(title: String) {
|
||||
self.title = NSMutableAttributedString(string: title, attributes: [
|
||||
NSFontAttributeName: NSFont.systemFont(ofSize: 11),
|
||||
NSAttributedStringKey.font: NSFont.systemFont(ofSize: 11),
|
||||
])
|
||||
|
||||
super.init(frame: .zero)
|
||||
self.configureForAutoLayout()
|
||||
|
||||
self.title.addAttribute(NSForegroundColorAttributeName,
|
||||
self.title.addAttribute(NSAttributedStringKey.foregroundColor,
|
||||
value: self.theme.foreground,
|
||||
range: NSRange(location: 0, length: self.title.length))
|
||||
|
||||
@ -77,7 +77,7 @@ class WorkspaceToolButton: NSView, NSDraggingSource {
|
||||
self.dehighlight()
|
||||
}
|
||||
|
||||
self.title.addAttribute(NSForegroundColorAttributeName,
|
||||
self.title.addAttribute(NSAttributedStringKey.foregroundColor,
|
||||
value: self.theme.foreground,
|
||||
range: NSRange(location: 0, length: self.title.length))
|
||||
|
||||
@ -137,19 +137,19 @@ extension WorkspaceToolButton {
|
||||
}
|
||||
|
||||
override func mouseDown(with event: NSEvent) {
|
||||
guard let nextEvent = self.window!.nextEvent(matching: [NSLeftMouseUpMask, NSLeftMouseDraggedMask]) else {
|
||||
guard let nextEvent = self.window!.nextEvent(matching: [.leftMouseUp, .leftMouseDragged]) else {
|
||||
return
|
||||
}
|
||||
|
||||
switch nextEvent.type {
|
||||
|
||||
case NSLeftMouseUp:
|
||||
case .leftMouseUp:
|
||||
self.tool?.toggle()
|
||||
return
|
||||
|
||||
case NSLeftMouseDragged:
|
||||
case .leftMouseDragged:
|
||||
let pasteboardItem = NSPasteboardItem()
|
||||
pasteboardItem.setString(self.tool!.uuid, forType: WorkspaceToolButton.toolUti)
|
||||
pasteboardItem.setString(self.tool!.uuid, forType: NSPasteboard.PasteboardType(WorkspaceToolButton.toolUti))
|
||||
|
||||
let draggingItem = NSDraggingItem(pasteboardWriter: pasteboardItem)
|
||||
draggingItem.setDraggingFrame(self.bounds, contents: self.snapshot())
|
||||
@ -192,7 +192,7 @@ extension WorkspaceToolButton {
|
||||
|
||||
result.lockFocus()
|
||||
self.theme.barButtonHighlight.set()
|
||||
NSRectFill(rect)
|
||||
rect.fill()
|
||||
image.draw(in: rect)
|
||||
result.unlockFocus()
|
||||
|
||||
|
@ -18,6 +18,11 @@ popd
|
||||
echo "### Updating carthage"
|
||||
carthage update --platform osx --cache-builds
|
||||
|
||||
# to avoid Xcode time out, cf https://stackoverflow.com/questions/37922146/xctests-failing-on-physical-device-canceling-tests-due-to-timeout/40790171#40790171
|
||||
echo "### Building"
|
||||
xcodebuild build -scheme SwiftNeoVim
|
||||
xcodebuild build -scheme VimR
|
||||
|
||||
echo "### Executing tests"
|
||||
xcodebuild test -scheme SwiftNeoVim
|
||||
xcodebuild test -scheme VimR
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
* GH-534: `Cmd-D` for "Discard and Close/Quit" buttons. (thanks @nclark for the PR)
|
||||
* GH-521: Improve the performance of the file browser, especically for folders like `node_modules` which contains many many files.
|
||||
* GH-544: Migrate to Swift 4
|
||||
|
||||
# 0.19.1-229
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user