From f326ddf70a2021290fd863242022dcd2b8ca112a Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 13 Nov 2016 23:32:50 +0100 Subject: [PATCH] GH-296 Use == for tools and make a property private --- VimR/Workspace/Workspace.swift | 3 ++- VimR/Workspace/WorkspaceBar.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/VimR/Workspace/Workspace.swift b/VimR/Workspace/Workspace.swift index c6c1b414..5d6a4f6e 100644 --- a/VimR/Workspace/Workspace.swift +++ b/VimR/Workspace/Workspace.swift @@ -36,6 +36,8 @@ class Workspace: NSView, WorkspaceBarDelegate { } } + fileprivate var tools = [WorkspaceTool]() + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } @@ -43,7 +45,6 @@ class Workspace: NSView, WorkspaceBarDelegate { // MARK: - API let mainView: NSView let bars: [WorkspaceBarLocation: WorkspaceBar] - var tools = [WorkspaceTool]() let config: Config weak var delegate: WorkspaceDelegate? diff --git a/VimR/Workspace/WorkspaceBar.swift b/VimR/Workspace/WorkspaceBar.swift index c482f9f8..a0c05de9 100644 --- a/VimR/Workspace/WorkspaceBar.swift +++ b/VimR/Workspace/WorkspaceBar.swift @@ -532,7 +532,7 @@ extension WorkspaceBar { if self.isOpen { let curTool = self.selectedTool! - if curTool === tool { + if curTool == tool { // In this case, curTool.isSelected is already set to false in WorkspaceTool.toggle() self.selectedTool = nil } else {