From 609af5aac1ae4147257c08871e613d99434df44a Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 3 Dec 2017 17:37:02 +0100 Subject: [PATCH] Rename auto commands file --- NvimView/NvimView.xcodeproj/project.pbxproj | 16 ++++++++-------- NvimView/NvimView/NeoVimAgent.m | 4 ++-- NvimView/NvimView/NvimUiBridgeProtocol.h | 4 ++-- NvimView/NvimView/NvimView+UiBridge.swift | 4 ++-- NvimView/NvimView/NvimView.h | 2 +- bin/generate_source.py | 18 +++++++++--------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/NvimView/NvimView.xcodeproj/project.pbxproj b/NvimView/NvimView.xcodeproj/project.pbxproj index 0d5036bc..f989726b 100644 --- a/NvimView/NvimView.xcodeproj/project.pbxproj +++ b/NvimView/NvimView.xcodeproj/project.pbxproj @@ -8,13 +8,13 @@ /* Begin PBXBuildFile section */ 1929B40A751BDA2882D4FC94 /* NvimViewObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B22A0CAD417EC3790F02 /* NvimViewObjects.swift */; }; + 4B2016EE1FD45EED0038528A /* NvimAutoCommandEvent.generated.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2016EC1FD45EED0038528A /* NvimAutoCommandEvent.generated.m */; }; + 4B2016EF1FD45EED0038528A /* NvimAutoCommandEvent.generated.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2016ED1FD45EED0038528A /* NvimAutoCommandEvent.generated.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B90F02D1FD2AFAE008A39E0 /* NvimUiBridgeProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90F00F1FD2AFAC008A39E0 /* NvimUiBridgeProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B90F02E1FD2AFAE008A39E0 /* NvimView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0101FD2AFAC008A39E0 /* NvimView.swift */; }; 4B90F02F1FD2AFAE008A39E0 /* NvimView+Resize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0111FD2AFAC008A39E0 /* NvimView+Resize.swift */; }; 4B90F0301FD2AFAE008A39E0 /* KeyUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0121FD2AFAC008A39E0 /* KeyUtils.swift */; }; - 4B90F0311FD2AFAE008A39E0 /* NeoVimAutoCommandEvent.generated.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0131FD2AFAC008A39E0 /* NeoVimAutoCommandEvent.generated.m */; }; 4B90F0321FD2AFAE008A39E0 /* NvimView+Dragging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B90F0141FD2AFAC008A39E0 /* NvimView+Dragging.swift */; }; - 4B90F0331FD2AFAE008A39E0 /* NeoVimAutoCommandEvent.generated.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B90F0151FD2AFAC008A39E0 /* NeoVimAutoCommandEvent.generated.h */; settings = {ATTRIBUTES = (Public, ); }; }; 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 */; }; @@ -90,15 +90,15 @@ /* Begin PBXFileReference section */ 1929B22A0CAD417EC3790F02 /* NvimViewObjects.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NvimViewObjects.swift; sourceTree = ""; }; + 4B2016EC1FD45EED0038528A /* NvimAutoCommandEvent.generated.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NvimAutoCommandEvent.generated.m; sourceTree = ""; }; + 4B2016ED1FD45EED0038528A /* NvimAutoCommandEvent.generated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NvimAutoCommandEvent.generated.h; sourceTree = ""; }; 4B90F0041FD2AF59008A39E0 /* NvimView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NvimView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4B90F0081FD2AF59008A39E0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 4B90F00F1FD2AFAC008A39E0 /* NvimUiBridgeProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NvimUiBridgeProtocol.h; sourceTree = ""; }; 4B90F0101FD2AFAC008A39E0 /* NvimView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NvimView.swift; sourceTree = ""; }; 4B90F0111FD2AFAC008A39E0 /* NvimView+Resize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NvimView+Resize.swift"; sourceTree = ""; }; 4B90F0121FD2AFAC008A39E0 /* KeyUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyUtils.swift; sourceTree = ""; }; - 4B90F0131FD2AFAC008A39E0 /* NeoVimAutoCommandEvent.generated.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NeoVimAutoCommandEvent.generated.m; sourceTree = ""; }; 4B90F0141FD2AFAC008A39E0 /* NvimView+Dragging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NvimView+Dragging.swift"; sourceTree = ""; }; - 4B90F0151FD2AFAC008A39E0 /* NeoVimAutoCommandEvent.generated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NeoVimAutoCommandEvent.generated.h; sourceTree = ""; }; 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 = ""; }; @@ -207,8 +207,8 @@ 4B90F0201FD2AFAD008A39E0 /* MMCoreTextView.m */, 4B90F0191FD2AFAC008A39E0 /* NeoVimAgent.h */, 4B90F02C1FD2AFAE008A39E0 /* NeoVimAgent.m */, - 4B90F0151FD2AFAC008A39E0 /* NeoVimAutoCommandEvent.generated.h */, - 4B90F0131FD2AFAC008A39E0 /* NeoVimAutoCommandEvent.generated.m */, + 4B2016ED1FD45EED0038528A /* NvimAutoCommandEvent.generated.h */, + 4B2016EC1FD45EED0038528A /* NvimAutoCommandEvent.generated.m */, 4B90F01D1FD2AFAC008A39E0 /* NeoVimObjectsExtensions.swift */, 4B90F00F1FD2AFAC008A39E0 /* NvimUiBridgeProtocol.h */, 4B90F02A1FD2AFAD008A39E0 /* NeoVimUiBridgeProtocol.m */, @@ -276,9 +276,9 @@ 4B90F02D1FD2AFAE008A39E0 /* NvimUiBridgeProtocol.h in Headers */, 4BE45C161FD2DB53005C0A95 /* NeoVimWindow.h in Headers */, 4BE45C1B1FD2DB53005C0A95 /* NeoVimBuffer.h in Headers */, + 4B2016EF1FD45EED0038528A /* NvimAutoCommandEvent.generated.h in Headers */, 4BE45C191FD2DB53005C0A95 /* NeoVimTab.h in Headers */, 4B90F0441FD2AFAE008A39E0 /* MMCoreTextView.h in Headers */, - 4B90F0331FD2AFAE008A39E0 /* NeoVimAutoCommandEvent.generated.h in Headers */, 4B90F0781FD2BA7B008A39E0 /* Logger.h in Headers */, 4B90F07B1FD30650008A39E0 /* NeoVimMsgIds.h in Headers */, ); @@ -419,13 +419,13 @@ 4B90F0401FD2AFAE008A39E0 /* TextDrawer.m in Sources */, 4B90F02E1FD2AFAE008A39E0 /* NvimView.swift in Sources */, 4B90F03C1FD2AFAE008A39E0 /* NvimView+TouchBar.swift in Sources */, + 4B2016EE1FD45EED0038528A /* NvimAutoCommandEvent.generated.m in Sources */, 4B90F03B1FD2AFAE008A39E0 /* NeoVimObjectsExtensions.swift in Sources */, 4BE45C1A1FD2DB53005C0A95 /* NeoVimBuffer.m in Sources */, 4B90F04A1FD2AFAE008A39E0 /* NeoVimAgent.m in Sources */, 4B90F0351FD2AFAE008A39E0 /* NvimView+Mouse.swift in Sources */, 4B90F0431FD2AFAE008A39E0 /* NvimView+MenuItems.swift in Sources */, 4B90F0391FD2AFAE008A39E0 /* NvimView+Api.swift in Sources */, - 4B90F0311FD2AFAE008A39E0 /* NeoVimAutoCommandEvent.generated.m in Sources */, 4B90F0451FD2AFAE008A39E0 /* Logger.swift in Sources */, 4B90F0321FD2AFAE008A39E0 /* NvimView+Dragging.swift in Sources */, 4B90F0491FD2AFAE008A39E0 /* CellAttributes.swift in Sources */, diff --git a/NvimView/NvimView/NeoVimAgent.m b/NvimView/NvimView/NeoVimAgent.m index b076c7f3..cff048d0 100644 --- a/NvimView/NvimView/NeoVimAgent.m +++ b/NvimView/NvimView/NeoVimAgent.m @@ -603,12 +603,12 @@ static CFDataRef local_server_callback(CFMessagePortRef local __unused, SInt32 m case NeoVimServerMsgIdAutoCommandEvent: { if (data.length == 2 * sizeof(NSInteger)) { NSInteger *values = (NSInteger *) data.bytes; - NeoVimAutoCommandEvent event = (NeoVimAutoCommandEvent) values[0]; + NvimAutoCommandEvent event = (NvimAutoCommandEvent) values[0]; NSInteger bufferHandle = (values + 1)[0]; [_bridge autoCommandEvent:event bufferHandle:bufferHandle]; } else { NSInteger *values = data_to_NSInteger_array(data, 1); - [_bridge autoCommandEvent:(NeoVimAutoCommandEvent) values[0] bufferHandle:-1]; + [_bridge autoCommandEvent:(NvimAutoCommandEvent) values[0] bufferHandle:-1]; } return; } diff --git a/NvimView/NvimView/NvimUiBridgeProtocol.h b/NvimView/NvimView/NvimUiBridgeProtocol.h index eee429fb..0f5a7b42 100644 --- a/NvimView/NvimView/NvimUiBridgeProtocol.h +++ b/NvimView/NvimView/NvimUiBridgeProtocol.h @@ -5,7 +5,7 @@ @import Foundation; -#import "NeoVimAutoCommandEvent.generated.h" +#import "NvimAutoCommandEvent.generated.h" // Keep in sync with ModeShape enum in cursor_shape.h. @@ -130,7 +130,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)setDirtyStatus:(bool)dirty; - (void)cwdChanged:(NSString *)cwd; - (void)colorSchemeChanged:(NSArray *)values; -- (void)autoCommandEvent:(NeoVimAutoCommandEvent)event bufferHandle:(NSInteger)bufferHandle; +- (void)autoCommandEvent:(NvimAutoCommandEvent)event bufferHandle:(NSInteger)bufferHandle; /** * NeoVim has been stopped. diff --git a/NvimView/NvimView/NvimView+UiBridge.swift b/NvimView/NvimView/NvimView+UiBridge.swift index 32018be7..a29b63f7 100644 --- a/NvimView/NvimView/NvimView+UiBridge.swift +++ b/NvimView/NvimView/NvimView+UiBridge.swift @@ -189,9 +189,9 @@ extension NvimView { } } - public func autoCommandEvent(_ event: NeoVimAutoCommandEvent, bufferHandle: Int) { + public func autoCommandEvent(_ event: NvimAutoCommandEvent, bufferHandle: Int) { gui.async { - self.bridgeLogger.debug("\(neoVimAutoCommandEventName(event)) -> \(bufferHandle)") + self.bridgeLogger.debug("\(nvimAutoCommandEventName(event)) -> \(bufferHandle)") if event == .BUFWINENTER || event == .BUFWINLEAVE { self.bufferListChanged() diff --git a/NvimView/NvimView/NvimView.h b/NvimView/NvimView/NvimView.h index 2b5b0f19..9baa2c0a 100644 --- a/NvimView/NvimView/NvimView.h +++ b/NvimView/NvimView/NvimView.h @@ -23,4 +23,4 @@ FOUNDATION_EXPORT const unsigned char NvimViewVersionString[]; #import #import #import -#import +#import diff --git a/bin/generate_source.py b/bin/generate_source.py index 961af6ed..913bb268 100755 --- a/bin/generate_source.py +++ b/bin/generate_source.py @@ -7,7 +7,7 @@ from string import Template print(os.getcwd()) if 'CONFIGURATION' in os.environ and os.environ['CONFIGURATION'] == 'Debug': - if os.path.isfile('./NvimView/NeoVimAutoCommandEvent.generated.h') and os.path.isfile('./NvimView/NeoVimAutoCommandEvent.generated.m'): + if os.path.isfile('./NvimView/NvimAutoCommandEvent.generated.h') and os.path.isfile('./NvimView/NvimAutoCommandEvent.generated.m'): print("Files already there, exiting...") exit(0) @@ -24,9 +24,9 @@ auto_cmds = [convert(line) for line in raw_auto_cmds] auto_cmds_impl_template = Template( ''' @import Foundation; -#import "NeoVimAutoCommandEvent.generated.h" +#import "NvimAutoCommandEvent.generated.h" -NSString *neoVimAutoCommandEventName(NeoVimAutoCommandEvent event) { +NSString *nvimAutoCommandEventName(NvimAutoCommandEvent event) { switch (event) { ${event_cases} default: return @"NON_EXISTING_EVENT"; @@ -36,28 +36,28 @@ ${event_cases} impl = auto_cmds_impl_template.substitute( event_cases='\n'.join( - [' case NeoVimAutoCommandEvent{}: return @"{}";'.format(event[0], event[0]) for event in auto_cmds]) + [' case NvimAutoCommandEvent{}: return @"{}";'.format(event[0], event[0]) for event in auto_cmds]) ) -with io.open('./NvimView/NeoVimAutoCommandEvent.generated.m', 'w') as auto_cmds_impl_file: +with io.open('./NvimView/NvimAutoCommandEvent.generated.m', 'w') as auto_cmds_impl_file: auto_cmds_impl_file.write(unicode(impl)) auto_cmds_header_template = Template( ''' @import Foundation; -typedef NS_ENUM(NSUInteger, NeoVimAutoCommandEvent) { +typedef NS_ENUM(NSUInteger, NvimAutoCommandEvent) { ${event_cases} }; #define NumberOfAutoCommandEvents ${count} -extern NSString * __nonnull neoVimAutoCommandEventName(NeoVimAutoCommandEvent event); +extern NSString * __nonnull nvimAutoCommandEventName(NvimAutoCommandEvent event); ''') header = auto_cmds_header_template.substitute( event_cases='\n'.join( - [' NeoVimAutoCommandEvent{} = {},'.format(event[0], event[1]) for event in auto_cmds] + [' NvimAutoCommandEvent{} = {},'.format(event[0], event[1]) for event in auto_cmds] ), count=str(len(auto_cmds)) ) -with io.open('./NvimView/NeoVimAutoCommandEvent.generated.h', 'w') as auto_cmds_header_file: +with io.open('./NvimView/NvimAutoCommandEvent.generated.h', 'w') as auto_cmds_header_file: auto_cmds_header_file.write(unicode(header))