1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 23:02:35 +03:00

Merge branch 'master' into issue/282-workspace

This commit is contained in:
Tae Won Ha 2016-09-25 08:58:01 +02:00
commit d29c67064e
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 12 additions and 12 deletions

View File

@ -17,16 +17,16 @@ private struct RowRun: CustomStringConvertible {
} }
} }
public struct LaunchOptions {
let useInteractiveZsh: Bool
public init(useInteractiveZsh: Bool) {
self.useInteractiveZsh = useInteractiveZsh
}
}
public class NeoVimView: NSView, NSUserInterfaceValidations { public class NeoVimView: NSView, NSUserInterfaceValidations {
public struct Config {
let useInteractiveZsh: Bool
public init(useInteractiveZsh: Bool) {
self.useInteractiveZsh = useInteractiveZsh
}
}
public static let minFontSize = CGFloat(4) public static let minFontSize = CGFloat(4)
public static let maxFontSize = CGFloat(128) public static let maxFontSize = CGFloat(128)
public static let defaultFont = NSFont.userFixedPitchFontOfSize(13)! public static let defaultFont = NSFont.userFixedPitchFontOfSize(13)!
@ -122,7 +122,7 @@ public class NeoVimView: NSView, NSUserInterfaceValidations {
private var pinchTargetScale = CGFloat(1) private var pinchTargetScale = CGFloat(1)
private var pinchImage = NSImage() private var pinchImage = NSImage()
public init(frame rect: NSRect, options: LaunchOptions) { public init(frame rect: NSRect, config: Config) {
self.drawer = TextDrawer(font: self._font, useLigatures: false) self.drawer = TextDrawer(font: self._font, useLigatures: false)
self.agent = NeoVimAgent(uuid: self.uuid) self.agent = NeoVimAgent(uuid: self.uuid)
@ -135,7 +135,7 @@ public class NeoVimView: NSView, NSUserInterfaceValidations {
// We cannot set bridge in init since self is not available before super.init()... // We cannot set bridge in init since self is not available before super.init()...
self.agent.bridge = self self.agent.bridge = self
self.agent.useInteractiveZsh = options.useInteractiveZsh self.agent.useInteractiveZsh = config.useInteractiveZsh
let noErrorDuringInitialization = self.agent.runLocalServerAndNeoVim() let noErrorDuringInitialization = self.agent.runLocalServerAndNeoVim()
// Neovim is ready now: resize neovim to bounds. // Neovim is ready now: resize neovim to bounds.
@ -154,7 +154,7 @@ public class NeoVimView: NSView, NSUserInterfaceValidations {
} }
convenience override init(frame rect: NSRect) { convenience override init(frame rect: NSRect) {
self.init(frame: rect, options: LaunchOptions(useInteractiveZsh: false)) self.init(frame: rect, config: Config(useInteractiveZsh: false))
} }
required public init?(coder: NSCoder) { required public init?(coder: NSCoder) {

View File

@ -56,7 +56,7 @@ class MainWindowComponent: WindowComponent, NSWindowDelegate {
initialData: PrefData) initialData: PrefData)
{ {
self.neoVimView = NeoVimView(frame: CGRect.zero, self.neoVimView = NeoVimView(frame: CGRect.zero,
options: LaunchOptions(useInteractiveZsh: initialData.advanced.useInteractiveZsh)) config: NeoVimView.Config(useInteractiveZsh: initialData.advanced.useInteractiveZsh))
self.neoVimView.translatesAutoresizingMaskIntoConstraints = false self.neoVimView.translatesAutoresizingMaskIntoConstraints = false
self.workspace = Workspace(mainView: self.neoVimView) self.workspace = Workspace(mainView: self.neoVimView)