From 6bfa8e8bb11f29b969eb27f5010f57b447e5ff62 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 3 Dec 2017 18:07:25 +0100 Subject: [PATCH] Rename more --- NvimView/NvimView.xcodeproj/project.pbxproj | 16 ++++++++-------- NvimView/NvimView/{NeoVimAgent.h => NvimAgent.h} | 2 +- NvimView/NvimView/{NeoVimAgent.m => NvimAgent.m} | 8 ++++---- NvimView/NvimView/NvimView+Api.swift | 2 +- NvimView/NvimView/NvimView.h | 2 +- NvimView/NvimView/NvimView.swift | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) rename NvimView/NvimView/{NeoVimAgent.h => NvimAgent.h} (97%) rename NvimView/NvimView/{NeoVimAgent.m => NvimAgent.m} (99%) diff --git a/NvimView/NvimView.xcodeproj/project.pbxproj b/NvimView/NvimView.xcodeproj/project.pbxproj index 1523eb0b..7c8f92f0 100644 --- a/NvimView/NvimView.xcodeproj/project.pbxproj +++ b/NvimView/NvimView.xcodeproj/project.pbxproj @@ -18,7 +18,7 @@ 4B90F0341FD2AFAE008A39E0 /* CocoaExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0161FD2AFAC008A39E0 /* CocoaExtensions.swift */; }; 4B90F0351FD2AFAE008A39E0 /* NvimView+Mouse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0171FD2AFAC008A39E0 /* NvimView+Mouse.swift */; }; 4B90F0361FD2AFAE008A39E0 /* NvimViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0181FD2AFAC008A39E0 /* NvimViewDelegate.swift */; }; - 4B90F0371FD2AFAE008A39E0 /* NeoVimAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90F0191FD2AFAC008A39E0 /* NeoVimAgent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B90F0371FD2AFAE008A39E0 /* NvimAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90F0191FD2AFAC008A39E0 /* NvimAgent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B90F0381FD2AFAE008A39E0 /* ColorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F01A1FD2AFAC008A39E0 /* ColorUtils.swift */; }; 4B90F0391FD2AFAE008A39E0 /* NvimView+Api.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F01B1FD2AFAC008A39E0 /* NvimView+Api.swift */; }; 4B90F03A1FD2AFAE008A39E0 /* NvimView+Key.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F01C1FD2AFAC008A39E0 /* NvimView+Key.swift */; }; @@ -35,7 +35,7 @@ 4B90F0461FD2AFAE008A39E0 /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0281FD2AFAD008A39E0 /* Grid.swift */; }; 4B90F0481FD2AFAE008A39E0 /* NeoVimUiBridgeProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F02A1FD2AFAD008A39E0 /* NeoVimUiBridgeProtocol.m */; }; 4B90F0491FD2AFAE008A39E0 /* CellAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F02B1FD2AFAD008A39E0 /* CellAttributes.swift */; }; - 4B90F04A1FD2AFAE008A39E0 /* NeoVimAgent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F02C1FD2AFAE008A39E0 /* NeoVimAgent.m */; }; + 4B90F04A1FD2AFAE008A39E0 /* NvimAgent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F02C1FD2AFAE008A39E0 /* NvimAgent.m */; }; 4B90F0521FD2AFD3008A39E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0511FD2AFD3008A39E0 /* main.m */; }; 4B90F0661FD2AFF7008A39E0 /* server_ui.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0561FD2AFF7008A39E0 /* server_ui.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 4B90F0681FD2AFF7008A39E0 /* CocoaCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F05A1FD2AFF7008A39E0 /* CocoaCategories.m */; }; @@ -96,7 +96,7 @@ 4B90F0161FD2AFAC008A39E0 /* CocoaExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CocoaExtensions.swift; sourceTree = ""; }; 4B90F0171FD2AFAC008A39E0 /* NvimView+Mouse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NvimView+Mouse.swift"; sourceTree = ""; }; 4B90F0181FD2AFAC008A39E0 /* NvimViewDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NvimViewDelegate.swift; sourceTree = ""; }; - 4B90F0191FD2AFAC008A39E0 /* NeoVimAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NeoVimAgent.h; sourceTree = ""; }; + 4B90F0191FD2AFAC008A39E0 /* NvimAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NvimAgent.h; sourceTree = ""; }; 4B90F01A1FD2AFAC008A39E0 /* ColorUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorUtils.swift; sourceTree = ""; }; 4B90F01B1FD2AFAC008A39E0 /* NvimView+Api.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NvimView+Api.swift"; sourceTree = ""; }; 4B90F01C1FD2AFAC008A39E0 /* NvimView+Key.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NvimView+Key.swift"; sourceTree = ""; }; @@ -114,7 +114,7 @@ 4B90F0281FD2AFAD008A39E0 /* Grid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Grid.swift; sourceTree = ""; }; 4B90F02A1FD2AFAD008A39E0 /* NeoVimUiBridgeProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NeoVimUiBridgeProtocol.m; sourceTree = ""; }; 4B90F02B1FD2AFAD008A39E0 /* CellAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CellAttributes.swift; sourceTree = ""; }; - 4B90F02C1FD2AFAE008A39E0 /* NeoVimAgent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NeoVimAgent.m; sourceTree = ""; }; + 4B90F02C1FD2AFAE008A39E0 /* NvimAgent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NvimAgent.m; sourceTree = ""; }; 4B90F04F1FD2AFD3008A39E0 /* NvimServer */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = NvimServer; sourceTree = BUILT_PRODUCTS_DIR; }; 4B90F0511FD2AFD3008A39E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 4B90F0561FD2AFF7008A39E0 /* server_ui.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = server_ui.m; sourceTree = ""; }; @@ -193,8 +193,8 @@ 4B90F0271FD2AFAD008A39E0 /* Logger.swift */, 4B90F0261FD2AFAD008A39E0 /* MMCoreTextView.h */, 4B90F0201FD2AFAD008A39E0 /* MMCoreTextView.m */, - 4B90F0191FD2AFAC008A39E0 /* NeoVimAgent.h */, - 4B90F02C1FD2AFAE008A39E0 /* NeoVimAgent.m */, + 4B90F0191FD2AFAC008A39E0 /* NvimAgent.h */, + 4B90F02C1FD2AFAE008A39E0 /* NvimAgent.m */, 4B2016ED1FD45EED0038528A /* NvimAutoCommandEvent.generated.h */, 4B2016EC1FD45EED0038528A /* NvimAutoCommandEvent.generated.m */, 4B90F01D1FD2AFAC008A39E0 /* NvimObjectsExtensions.swift */, @@ -254,7 +254,7 @@ files = ( 4BF18C5D1FD2EEE400DF95D1 /* NvimView.h in Headers */, 4B90F0411FD2AFAE008A39E0 /* TextDrawer.h in Headers */, - 4B90F0371FD2AFAE008A39E0 /* NeoVimAgent.h in Headers */, + 4B90F0371FD2AFAE008A39E0 /* NvimAgent.h in Headers */, 4B90F02D1FD2AFAE008A39E0 /* NvimUiBridgeProtocol.h in Headers */, 4B2016EF1FD45EED0038528A /* NvimAutoCommandEvent.generated.h in Headers */, 4B90F0441FD2AFAE008A39E0 /* MMCoreTextView.h in Headers */, @@ -399,7 +399,7 @@ 4B90F03C1FD2AFAE008A39E0 /* NvimView+TouchBar.swift in Sources */, 4B2016EE1FD45EED0038528A /* NvimAutoCommandEvent.generated.m in Sources */, 4B90F03B1FD2AFAE008A39E0 /* NvimObjectsExtensions.swift in Sources */, - 4B90F04A1FD2AFAE008A39E0 /* NeoVimAgent.m in Sources */, + 4B90F04A1FD2AFAE008A39E0 /* NvimAgent.m in Sources */, 4B90F0351FD2AFAE008A39E0 /* NvimView+Mouse.swift in Sources */, 4B90F0431FD2AFAE008A39E0 /* NvimView+MenuItems.swift in Sources */, 4B90F0391FD2AFAE008A39E0 /* NvimView+Api.swift in Sources */, diff --git a/NvimView/NvimView/NeoVimAgent.h b/NvimView/NvimView/NvimAgent.h similarity index 97% rename from NvimView/NvimView/NeoVimAgent.h rename to NvimView/NvimView/NvimAgent.h index 7145c3d6..de0a6205 100644 --- a/NvimView/NvimView/NeoVimAgent.h +++ b/NvimView/NvimView/NvimAgent.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface NeoVimAgent : NSObject +@interface NvimAgent : NSObject @property (nonatomic) bool useInteractiveZsh; @property (nonatomic) NSURL *cwd; diff --git a/NvimView/NvimView/NeoVimAgent.m b/NvimView/NvimView/NvimAgent.m similarity index 99% rename from NvimView/NvimView/NeoVimAgent.m rename to NvimView/NvimView/NvimAgent.m index cff048d0..e9f327cd 100644 --- a/NvimView/NvimView/NeoVimAgent.m +++ b/NvimView/NvimView/NvimAgent.m @@ -3,7 +3,7 @@ * See LICENSE */ -#import "NeoVimAgent.h" +#import "NvimAgent.h" #import "NeoVimMsgIds.h" #import "Logger.h" @@ -50,7 +50,7 @@ static void log_cfmachport_error(SInt32 err, NeoVimAgentMsgId msgid, NSData *inp } -@interface NeoVimAgent () +@interface NvimAgent () - (void)handleMessageWithId:(SInt32)msgid data:(NSData *)data; @@ -59,7 +59,7 @@ static void log_cfmachport_error(SInt32 err, NeoVimAgentMsgId msgid, NSData *inp static CFDataRef local_server_callback(CFMessagePortRef local __unused, SInt32 msgid, CFDataRef data, void *info) { @autoreleasepool { - NeoVimAgent *agent = (__bridge NeoVimAgent *) info; + NvimAgent *agent = (__bridge NvimAgent *) info; [agent handleMessageWithId:msgid data:(__bridge NSData *) (data)]; } @@ -67,7 +67,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local __unused, SInt32 m } -@implementation NeoVimAgent { +@implementation NvimAgent { NSString *_uuid; CFMessagePortRef _remoteServerPort; diff --git a/NvimView/NvimView/NvimView+Api.swift b/NvimView/NvimView/NvimView+Api.swift index 25a45f0d..db4a7692 100644 --- a/NvimView/NvimView/NvimView+Api.swift +++ b/NvimView/NvimView/NvimView+Api.swift @@ -166,7 +166,7 @@ extension NvimView { - normal mode: `:command` - else: `::command` - We don't use NeoVimAgent.vimCommand because if we do for example "e /some/file" + We don't use NvimAgent.vimCommand because if we do for example "e /some/file" and its swap file already exists, then NeoVimServer spins and become unresponsive. */ private func exec(command cmd: String) { diff --git a/NvimView/NvimView/NvimView.h b/NvimView/NvimView/NvimView.h index 463e8f6e..e21ef24f 100644 --- a/NvimView/NvimView/NvimView.h +++ b/NvimView/NvimView/NvimView.h @@ -19,5 +19,5 @@ FOUNDATION_EXPORT const unsigned char NvimViewVersionString[]; #import // TODO: this header should not be public, but we cannot use a bridging header in a framework. #import -#import +#import #import diff --git a/NvimView/NvimView/NvimView.swift b/NvimView/NvimView/NvimView.swift index 3a3cb74a..8c8e235f 100644 --- a/NvimView/NvimView/NvimView.swift +++ b/NvimView/NvimView/NvimView.swift @@ -151,7 +151,7 @@ public class NvimView: NSView, public init(frame rect: NSRect, config: Config) { self.drawer = TextDrawer(font: self._font) - self.agent = NeoVimAgent(uuid: self.uuid) + self.agent = NvimAgent(uuid: self.uuid) let sockPath = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("vimr_\(self.uuid).sock").path guard let nvim = NvimApi(at: sockPath) else { @@ -206,7 +206,7 @@ public class NvimView: NSView, let bridgeLogger = LogContext.fileLogger(as: NvimView.self, with: URL(fileURLWithPath: "/tmp/nvv-bridge.log"), shouldLogDebug: nil) - let agent: NeoVimAgent + let agent: NvimAgent let nvim: NvimApi let grid = Grid()