diff --git a/NvimView/DrawerDev/Info.plist b/NvimView/DrawerDev/Info.plist
index cbb9b409..bb0e22c7 100644
--- a/NvimView/DrawerDev/Info.plist
+++ b/NvimView/DrawerDev/Info.plist
@@ -17,9 +17,9 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- SNAPSHOT-300
+ SNAPSHOT-301
CFBundleVersion
- 300
+ 301
LSMinimumSystemVersion
$(MACOSX_DEPLOYMENT_TARGET)
NSHumanReadableCopyright
diff --git a/NvimView/NvimServer/NvimServer.m b/NvimView/NvimServer/NvimServer.m
index 87d28449..314a254d 100644
--- a/NvimView/NvimServer/NvimServer.m
+++ b/NvimView/NvimServer/NvimServer.m
@@ -68,6 +68,9 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
case NvimBridgeMsgIdFocusGained:
return data_async(data, neovim_focus_gained);
+ case NvimBridgeMsgIdReadyForRpcEvents:
+ return data_async(data, neovim_ready_for_rpcevents);
+
default:
CFRelease(data);
return NULL;
diff --git a/NvimView/NvimServer/server_ui.h b/NvimView/NvimServer/server_ui.h
index 04739e89..fb3f7bcc 100644
--- a/NvimView/NvimServer/server_ui.h
+++ b/NvimView/NvimServer/server_ui.h
@@ -19,5 +19,6 @@ extern void neovim_vim_input(void **argv);
extern void neovim_delete_and_input(void **argv);
extern void neovim_focus_gained(void **argv);
+extern void neovim_ready_for_rpcevents(void **argv);
extern void neovim_debug1(void **argv);
diff --git a/NvimView/NvimServer/server_ui.m b/NvimView/NvimServer/server_ui.m
index e2c811ae..f9d40fe6 100644
--- a/NvimView/NvimServer/server_ui.m
+++ b/NvimView/NvimServer/server_ui.m
@@ -16,6 +16,7 @@
#define FileInfo CarbonFileInfo
#define Boolean CarbonBoolean
+#import
#import
#import
#import
@@ -73,6 +74,8 @@ static NSInteger _initialHeight = 15;
static msgpack_sbuffer flush_sbuffer;
static msgpack_packer *flush_packer;
+static dispatch_queue_t rpc_queue;
+
#pragma mark Helper functions
static inline String vim_string_from(NSString *str) {
@@ -245,6 +248,8 @@ static void server_ui_main(UIBridgeData *bridge, UI *ui) {
msgpack_sbuffer_init(&flush_sbuffer);
flush_packer = msgpack_packer_new(&flush_sbuffer, msgpack_sbuffer_write);
+ rpc_queue = dispatch_queue_create("rpc_queu", NULL);
+
Loop loop;
loop_init(&loop, NULL);
@@ -553,6 +558,13 @@ void custom_ui_start(void) {
ui_bridge_attach(ui, server_ui_main, server_ui_scheduler);
}
+void custom_ui_rpcevent_subscribed() {
+ dispatch_async(rpc_queue, ^{
+ [_neovim_server sendMessageWithId:NvimServerMsgIdRpcEventSubscribed
+ data:NULL];
+ });
+}
+
void custom_ui_autocmds_groups(
event_T event,
char_u *fname __unused,
@@ -573,6 +585,8 @@ void custom_ui_autocmds_groups(
case EVENT_TABENTER:
case EVENT_TEXTCHANGED:
case EVENT_TEXTCHANGEDI:
+ case EVENT_VIMENTER:
+ case EVENT_GUIENTER:
break;
default:
@@ -739,6 +753,25 @@ void neovim_delete_and_input(void **argv) {
});
}
+static void do_autocmd_guienter() {
+ static bool recursive = false;
+
+ if (recursive) {
+ return; // disallow recursion
+ }
+ recursive = true;
+ apply_autocmds(EVENT_GUIENTER, NULL, NULL, false, curbuf);
+ recursive = false;
+}
+
+static void guienter_event(void **argv __unused) {
+ do_autocmd_guienter();
+}
+
+static void aucmd_schedule_guienter() {
+ loop_schedule_deferred(&main_loop, event_create(guienter_event, 0));
+}
+
void neovim_focus_gained(void **argv) {
work_async(argv, ^(NSData *data) {
const bool *values = data.bytes;
@@ -747,6 +780,12 @@ void neovim_focus_gained(void **argv) {
});
}
+void neovim_ready_for_rpcevents(void **argv) {
+ work_async(argv, ^(NSData *data) {
+ aucmd_schedule_guienter();
+ });
+}
+
void neovim_debug1(void **argv) {
work_async(argv, ^(NSData *data) {
NSLog(@"normal fg: %#08X", normal_fg);
diff --git a/NvimView/NvimView.xcodeproj/project.pbxproj b/NvimView/NvimView.xcodeproj/project.pbxproj
index 50464733..6e27b234 100644
--- a/NvimView/NvimView.xcodeproj/project.pbxproj
+++ b/NvimView/NvimView.xcodeproj/project.pbxproj
@@ -45,7 +45,7 @@
4B177886201220F300E32FF0 /* SharedTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1929B4F32708E99C40A57020 /* SharedTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
4B17E549209E3E4100265C1D /* RxNeovimApi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B17E548209E3E4100265C1D /* RxNeovimApi.framework */; };
4B21ED53213D4AEC009FD017 /* CocoaCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B0C89838D8402BB80BFC /* CocoaCommons.swift */; };
- 4B8662E81FDC3F9F007F490D /* vimr.vim in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B8662E41FDC3D4F007F490D /* vimr.vim */; };
+ 4B8662E81FDC3F9F007F490D /* com.qvacua.NvimView.vim in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B8662E41FDC3D4F007F490D /* com.qvacua.NvimView.vim */; };
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 */; };
@@ -140,7 +140,7 @@
dstPath = runtime/plugin;
dstSubfolderSpec = 7;
files = (
- 4B8662E81FDC3F9F007F490D /* vimr.vim in CopyFiles */,
+ 4B8662E81FDC3F9F007F490D /* com.qvacua.NvimView.vim in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -199,7 +199,7 @@
4B0A1B152129F49500F1E02F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
4B0A1B38212B332800F1E02F /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = ../Carthage/Build/Mac/Nimble.framework; sourceTree = ""; };
4B17E548209E3E4100265C1D /* RxNeovimApi.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxNeovimApi.framework; path = ../Carthage/Build/Mac/RxNeovimApi.framework; sourceTree = ""; };
- 4B8662E41FDC3D4F007F490D /* vimr.vim */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vimr.vim; sourceTree = ""; };
+ 4B8662E41FDC3D4F007F490D /* com.qvacua.NvimView.vim */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.vim; path = com.qvacua.NvimView.vim; 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 = ""; };
4B90F0101FD2AFAC008A39E0 /* NvimView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NvimView.swift; sourceTree = ""; };
@@ -359,7 +359,7 @@
isa = PBXGroup;
children = (
4B90F0081FD2AF59008A39E0 /* Info.plist */,
- 4B8662E41FDC3D4F007F490D /* vimr.vim */,
+ 4B8662E41FDC3D4F007F490D /* com.qvacua.NvimView.vim */,
4BF18C5C1FD2EEE400DF95D1 /* NvimView.h */,
4B90F0121FD2AFAC008A39E0 /* KeyUtils.swift */,
4B90F0271FD2AFAD008A39E0 /* Logger.swift */,
@@ -783,7 +783,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 300;
+ CURRENT_PROJECT_VERSION = 301;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -845,7 +845,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 300;
+ CURRENT_PROJECT_VERSION = 301;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -874,7 +874,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 300;
+ DYLIB_CURRENT_VERSION = 301;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
FRAMEWORK_VERSION = A;
@@ -896,7 +896,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 300;
+ DYLIB_CURRENT_VERSION = 301;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
FRAMEWORK_VERSION = A;
diff --git a/NvimView/NvimView/Info.plist b/NvimView/NvimView/Info.plist
index d1a2ab21..4cb41d50 100644
--- a/NvimView/NvimView/Info.plist
+++ b/NvimView/NvimView/Info.plist
@@ -15,9 +15,9 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- SNAPSHOT-300
+ SNAPSHOT-301
CFBundleVersion
- 300
+ 301
NSHumanReadableCopyright
Copyright © 2017 Tae Won Ha. All rights reserved.
NSPrincipalClass
diff --git a/NvimView/NvimView/Logger.swift b/NvimView/NvimView/Logger.swift
index 78008a74..6451f83b 100644
--- a/NvimView/NvimView/Logger.swift
+++ b/NvimView/NvimView/Logger.swift
@@ -86,7 +86,7 @@ class Logger {
default: self.name = String(describing: name)
}
- self.logDateFormatter.dateFormat = "dd HH:mm:SSS"
+ self.logDateFormatter.dateFormat = "dd HH:mm:ss.SSS"
self.appender = appender
}
diff --git a/NvimView/NvimView/NvimView+Draw.swift b/NvimView/NvimView/NvimView+Draw.swift
index 31ad1037..eecffa81 100644
--- a/NvimView/NvimView/NvimView+Draw.swift
+++ b/NvimView/NvimView/NvimView+Draw.swift
@@ -88,6 +88,13 @@ extension NvimView {
}
let cursorRegion = self.cursorRegion(for: self.ugrid.cursorPosition)
+ if cursorRegion.top < 0
+ || cursorRegion.bottom > self.ugrid.size.height - 1
+ || cursorRegion.left < 0
+ || cursorRegion.right > self.ugrid.size.width - 1 {
+ logger.error("\(cursorRegion) vs. \(self.ugrid.size)")
+ return
+ }
guard let cursorAttrs = self.cellAttributesCollection.attributes(
of: self.ugrid.cells[cursorPosition.row][cursorPosition.column].attrId
)?.reversed else {
diff --git a/NvimView/NvimView/NvimView+Resize.swift b/NvimView/NvimView/NvimView+Resize.swift
index f9ae9e01..4a365dde 100644
--- a/NvimView/NvimView/NvimView+Resize.swift
+++ b/NvimView/NvimView/NvimView+Resize.swift
@@ -52,8 +52,12 @@ extension NvimView {
return
}
- self.offset.x = floor((size.width - self.cellSize.width * CGFloat(discreteSize.width)) / 2)
- self.offset.y = floor((size.height - self.cellSize.height * CGFloat(discreteSize.height)) / 2)
+ self.offset.x = floor(
+ (size.width - self.cellSize.width * CGFloat(discreteSize.width)) / 2
+ )
+ self.offset.y = floor(
+ (size.height - self.cellSize.height * CGFloat(discreteSize.height)) / 2
+ )
self.bridge
.resize(width: discreteSize.width, height: discreteSize.height)
@@ -62,32 +66,50 @@ extension NvimView {
private func launchNeoVim(_ size: Size) {
logger.info("=== Starting neovim...")
- let sockPath = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("vimr_\(self.uuid).sock").path
+ let sockPath = URL(
+ fileURLWithPath: NSTemporaryDirectory()
+ ).appendingPathComponent("vimr_\(self.uuid).sock").path
self.api.msgpackRawStream
- .subscribe(onNext: { msg in
- switch msg {
- case let .notification(method, params):
- print("NOTIFICATION: \(method) with \(params.count) elements")
- case let .error(_, msg):
- print("MSG ERROR: \(msg)")
- default:
- print("???")
- break
- }
- }, onError: { print("ERROR: \($0)" )})
- .disposed(by: self.disposeBag)
+ .subscribe(onNext: { msg in
+ switch msg {
- // We wait here, since the user of NvimView cannot subscribe on the Completable. We could demand that the user
- // call launchNeoVim() by themselves, but...
+ case let .notification(method, params):
+ logger.debug("NOTIFICATION: \(method): \(params)")
+
+ guard method == NvimView.rpcEventName else { return }
+ self.eventsSubject.onNext(.rpcEvent(method, params))
+
+ case let .error(_, msg):
+ logger.debug("MSG ERROR: \(msg)")
+
+ default:
+ logger.debug("???: This should not happen")
+ break
+
+ }
+ }, onError: { print("ERROR: \($0)") })
+ .disposed(by: self.disposeBag)
+
+ // We wait here, since the user of NvimView cannot subscribe
+ // on the Completable. We could demand that the user call launchNeoVim()
+ // by themselves, but...
try? self.bridge
.runLocalServerAndNvim(width: size.width, height: size.height)
.andThen(self.api.run(at: sockPath))
+ .andThen(
+ self.sourceFileUrls.reduce(Completable.empty()) { prev, url in
+ prev.andThen(self.api
+ .commandOutput(str: "source \(url.path)")
+ .asCompletable())
+ }
+ )
+ .andThen(self.api.subscribe(event: NvimView.rpcEventName))
.wait()
}
private func randomEmoji() -> String {
- let idx = Int(arc4random_uniform(UInt32(emojis.count)))
+ let idx = Int.random(in: 0.. \(bufferHandle)")
#endif
@@ -200,8 +238,8 @@ extension NvimView {
#if TRACE
self.bridgeLogger.trace(
"row: \(row), startCol: \(startCol), endCol: \(endCol), " +
- "clearCol: \(clearCol), clearAttr: \(clearAttr), " +
- "chunk: \(chunk), attrIds: \(attrIds)"
+ "clearCol: \(clearCol), clearAttr: \(clearAttr), " +
+ "chunk: \(chunk), attrIds: \(attrIds)"
)
#endif
@@ -242,13 +280,13 @@ extension NvimView {
}
if row == self.markedPosition.row
- && startCol <= self.markedPosition.column
- && self.markedPosition.column <= endCol {
+ && startCol <= self.markedPosition.column
+ && self.markedPosition.column <= endCol {
self.ugrid.markCell(at: self.markedPosition)
}
let oldRowContainsWideChar = self.ugrid.cells[row][startCol.."
+ "fg: \(self.foreground.hex), bg: \(self.background.hex), " +
+ "visual-fg: \(self.visualForeground.hex), visual-bg: \(self.visualBackground.hex)" +
+ ">"
}
}
+ public static let rpcEventName = "com.qvacua.NvimView"
+
public static let minFontSize = CGFloat(4)
public static let maxFontSize = CGFloat(128)
public static let defaultFont = NSFont.userFixedPitchFont(ofSize: 12)!
@@ -112,7 +122,7 @@ public class NvimView: NSView,
public var isLeftOptionMeta = false
public var isRightOptionMeta = false
- public let uuid = UUID().uuidString
+ public let uuid = UUID()
public internal(set) var mode = CursorModeShape.normal
@@ -202,6 +212,8 @@ public class NvimView: NSView,
self.scheduler = SerialDispatchQueueScheduler(queue: self.queue,
internalSerialQueueName: "com.qvacua.NvimView.NvimView")
+ self.sourceFileUrls = config.sourceFiles
+
super.init(frame: .zero)
self.registerForDraggedTypes([NSPasteboard.PasteboardType(String(kUTTypeFileURL))])
@@ -285,6 +297,10 @@ public class NvimView: NSView,
case let .highlightAttrs(value):
self.setAttr(with: value)
+ case .rpcEventSubscribed:
+ self.rpcEventSubscribed()
+
+
case .debug1:
self.debug1(self)
@@ -296,10 +312,16 @@ public class NvimView: NSView,
}
convenience override public init(frame rect: NSRect) {
- self.init(frame: rect, config: Config(useInteractiveZsh: false,
- cwd: URL(fileURLWithPath: NSHomeDirectory()),
- nvimArgs: nil,
- envDict: nil))
+ self.init(
+ frame: rect,
+ config: Config(
+ useInteractiveZsh: false,
+ cwd: URL(fileURLWithPath: NSHomeDirectory()),
+ nvimArgs: nil,
+ envDict: nil,
+ sourceFiles: []
+ )
+ )
}
required public init?(coder: NSCoder) {
@@ -364,6 +386,11 @@ public class NvimView: NSView,
shouldLogDebug: nil
)
+ let sourceFileUrls: [URL]
+
+ let rpcEventSubscribedCondition = NSCondition()
+ var rpcEventSubscribedFlag = false
+
// MARK: - Private
private var _linespacing = NvimView.defaultLinespacing
}
diff --git a/NvimView/NvimView/UiBridge.swift b/NvimView/NvimView/UiBridge.swift
index 40737276..8c43bacc 100644
--- a/NvimView/NvimView/UiBridge.swift
+++ b/NvimView/NvimView/UiBridge.swift
@@ -35,6 +35,7 @@ class UiBridge {
case defaultColorsChanged(MessagePackValue)
case autoCommandEvent(MessagePackValue)
case highlightAttrs(MessagePackValue)
+ case rpcEventSubscribed
case debug1
case unknown
}
@@ -51,7 +52,7 @@ class UiBridge {
return self.streamSubject.asObservable()
}
- init(uuid: String, queue: DispatchQueue, config: NvimView.Config) {
+ init(uuid: UUID, queue: DispatchQueue, config: NvimView.Config) {
self.uuid = uuid
self.useInteractiveZsh = config.useInteractiveZsh
@@ -125,6 +126,10 @@ class UiBridge {
return self.sendMessage(msgId: .resize, data: [width, height].data())
}
+ func notifyReadinessForRpcEvents() -> Completable {
+ return self.sendMessage(msgId: .readyForRpcEvents, data: nil)
+ }
+
func focusGained(_ gained: Bool) -> Completable {
return self.sendMessage(msgId: .focusGained, data: [gained].data())
}
@@ -249,6 +254,9 @@ class UiBridge {
guard let v = MessagePackUtils.value(from: data) else { return }
self.streamSubject.onNext(.highlightAttrs(v))
+ case .rpcEventSubscribed:
+ self.streamSubject.onNext(.rpcEventSubscribed)
+
}
}
@@ -319,7 +327,7 @@ class UiBridge {
private let logger = LogContext.fileLogger(as: UiBridge.self, with: URL(fileURLWithPath: "/tmp/nvv-bridge.log"))
- private let uuid: String
+ private let uuid: UUID
private let useInteractiveZsh: Bool
private let cwd: URL
diff --git a/NvimView/NvimView/com.qvacua.NvimView.vim b/NvimView/NvimView/com.qvacua.NvimView.vim
new file mode 100644
index 00000000..1f1b847e
--- /dev/null
+++ b/NvimView/NvimView/com.qvacua.NvimView.vim
@@ -0,0 +1,45 @@
+set termguicolors
+set mouse=a
+set title
+
+"function! s:VimRMakeSessionTemporary() abort
+" call rpcnotify(0, 'com.qvacua.vimr.rpc-events.make-session-temporary')
+"endfunction
+"command! -nargs=0 VimRMakeSessionTemporary call s:VimRMakeSessionTemporary()
+"
+"function! s:VimRMaximizeWindow() abort
+" call rpcnotify(0, 'com.qvacua.vimr.rpc-events.maximize-window')
+"endfunction
+"command! -nargs=0 VimRMaximizeWindow call s:VimRMaximizeWindow()
+"
+"" -1: hide, 0: toggle, 1: show
+"function! s:VimRToggleTools(value) abort
+" call rpcnotify(0, 'com.qvacua.vimr.rpc-events.toggle-tools', a:value)
+"endfunction
+"command! -nargs=0 VimRHideTools call s:VimRToggleTools(-1)
+"command! -nargs=0 VimRToggleTools call s:VimRToggleTools(0)
+"command! -nargs=0 VimRShowTools call s:VimRToggleTools(1)
+"
+"" -1: hide, 0: toggle, 1: show
+"function! s:VimRToggleToolButtons(value) abort
+" call rpcnotify(0, 'com.qvacua.vimr.rpc-events.toggle-tool-buttons', a:value)
+"endfunction
+"command! -nargs=0 VimRHideToolButtons call s:VimRToggleToolButtons(-1)
+"command! -nargs=0 VimRToggleToolButtons call s:VimRToggleToolButtons(0)
+"command! -nargs=0 VimRShowToolButtons call s:VimRToggleToolButtons(1)
+"
+"function! s:VimRToggleFullscreen() abort
+" call rpcnotify(0, 'com.qvacua.vimr.rpc-events.toggle-fullscreen')
+"endfunction
+"command! -nargs=0 VimRToggleFullscreen call s:VimRToggleFullscreen()
+"
+"function! s:VimRTest() abort
+" VimRMakeSessionTemporary
+" VimRHideTools
+" VimRMaximizeWindow
+" normal o
+"endfunction
+"command! -nargs=0 VimRTest call s:VimRTest()
+"
+""au VimEnter * echo "hello"
+""au GuiEnter * echo "world"
diff --git a/NvimView/NvimView/vimr.vim b/NvimView/NvimView/vimr.vim
deleted file mode 100644
index 69002294..00000000
--- a/NvimView/NvimView/vimr.vim
+++ /dev/null
@@ -1,3 +0,0 @@
-set termguicolors
-set mouse=a
-set title
diff --git a/NvimView/NvimViewTests/Info.plist b/NvimView/NvimViewTests/Info.plist
index 32fdfdea..9252666e 100644
--- a/NvimView/NvimViewTests/Info.plist
+++ b/NvimView/NvimViewTests/Info.plist
@@ -15,8 +15,8 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- SNAPSHOT-300
+ SNAPSHOT-301
CFBundleVersion
- 300
+ 301
diff --git a/NvimView/SharedTypes.h b/NvimView/SharedTypes.h
index be314a2c..3beae944 100644
--- a/NvimView/SharedTypes.h
+++ b/NvimView/SharedTypes.h
@@ -41,12 +41,14 @@ typedef NS_ENUM(NSInteger, NvimServerMsgId) {
NvimServerMsgIdColorSchemeChanged,
NvimServerMsgIdDefaultColorsChanged,
NvimServerMsgIdAutoCommandEvent,
-
+ NvimServerMsgIdRpcEventSubscribed,
+
NvimServerMsgIdDebug1,
};
typedef NS_ENUM(NSInteger, NvimBridgeMsgId) {
NvimBridgeMsgIdAgentReady = 0,
+ NvimBridgeMsgIdReadyForRpcEvents,
NvimBridgeMsgIdInput,
NvimBridgeMsgIdDeleteInput,
NvimBridgeMsgIdResize,
diff --git a/NvimView/neovim b/NvimView/neovim
index 9f731c05..b212d045 160000
--- a/NvimView/neovim
+++ b/NvimView/neovim
@@ -1 +1 @@
-Subproject commit 9f731c05656fad98cc16bbbef7d1626b33695efc
+Subproject commit b212d045162eb07faee944220e96d27618c296e7
diff --git a/VimR/VimR.xcodeproj/project.pbxproj b/VimR/VimR.xcodeproj/project.pbxproj
index c2df9b57..97f8d051 100644
--- a/VimR/VimR.xcodeproj/project.pbxproj
+++ b/VimR/VimR.xcodeproj/project.pbxproj
@@ -16,6 +16,7 @@
1929B0F599D1F62C7BE53D2C /* HttpServerMiddleware.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B1DC584C89C477E83FA2 /* HttpServerMiddleware.swift */; };
1929B1837C750CADB3A5BCB9 /* OpenQuicklyFileViewRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B1558455B3A74D93EF2A /* OpenQuicklyFileViewRow.swift */; };
1929B20CE35B43BB1CE023BA /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BC2F05E9A5C0DB039739 /* Theme.swift */; };
+ 1929B250DB3FB395A700FE8C /* RpcEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BBF0944940845485A512 /* RpcEvents.swift */; };
1929B29B95AD176D57942E08 /* UiRootReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B457B9D0FA4D21F3751E /* UiRootReducer.swift */; };
1929B2D56C4652E251C23AD4 /* DefaultShortcuts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B93256AF7F9137223E36 /* DefaultShortcuts.swift */; };
1929B3217A7A3D79E28C80DB /* PrefWindowReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B49E6924847AD085C8C9 /* PrefWindowReducer.swift */; };
@@ -26,6 +27,7 @@
1929B3AC66EFE35D68C020E3 /* PreviewToolReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BFB0F294F3714D5E095F /* PreviewToolReducer.swift */; };
1929B3F5743967125F357C9F /* Matcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BEEB33113B0E33C3830F /* Matcher.swift */; };
1929B462CD4935AFF6D69457 /* FileItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B7CB4863F80230C32D3C /* FileItem.swift */; };
+ 1929B489A51FD5B13888A00C /* RpcEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BBF0944940845485A512 /* RpcEvents.swift */; };
1929B4B00D7BB191A9A6532D /* HtmlPreviewToolReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BE5AEA3D0980860EED50 /* HtmlPreviewToolReducer.swift */; };
1929B4B70926DE113E6BF990 /* PreviewReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BE37AA2843779CAFA76F /* PreviewReducer.swift */; };
1929B4E54E2F13A7F5F2B682 /* BufferListReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B67A10E6BB2986B2416E /* BufferListReducer.swift */; };
@@ -36,6 +38,7 @@
1929B53876E6952D378C2B30 /* ScoredFileItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BDF9EBAF1D9D44399045 /* ScoredFileItem.swift */; };
1929B542A071BD03C846F6EF /* PrefUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B8241CDE58F7AAF89AE4 /* PrefUtils.swift */; };
1929B5543B1E31A26096E656 /* FileMonitorReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B04EC69F616EEFAF5F96 /* FileMonitorReducer.swift */; };
+ 1929B560C6CE264FD1E1F5A3 /* com.qvacua.VimR.vim in Resources */ = {isa = PBXBuildFile; fileRef = 1929BC6D45B7E14D4D75D4E6 /* com.qvacua.VimR.vim */; };
1929B59FA5C286E010F70BEE /* Types.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BFC0A5A9C6DB09BE1368 /* Types.swift */; };
1929B5A2EE366F79ED32744C /* KeysPrefReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B88B5FA08E897A3C2168 /* KeysPrefReducer.swift */; };
1929B5C1BABBC0D09D97C3EF /* PreviewMiddleware.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B617C229B19DB3E987B8 /* PreviewMiddleware.swift */; };
@@ -352,7 +355,9 @@
1929BB6608B4F0E037CA0F4C /* States.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = States.swift; sourceTree = ""; };
1929BBC84557C8351EC6183E /* FileItemIgnorePatternTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileItemIgnorePatternTest.swift; sourceTree = ""; };
1929BBE0A534F2F6009D31BE /* AdvencedPref.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdvencedPref.swift; sourceTree = ""; };
+ 1929BBF0944940845485A512 /* RpcEvents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RpcEvents.swift; sourceTree = ""; };
1929BC2F05E9A5C0DB039739 /* Theme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = ""; };
+ 1929BC6D45B7E14D4D75D4E6 /* com.qvacua.VimR.vim */ = {isa = PBXFileReference; lastKnownFileType = file.vim; path = com.qvacua.VimR.vim; sourceTree = ""; };
1929BCE3E156C06EDF1F2806 /* FileOutlineView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileOutlineView.swift; sourceTree = ""; };
1929BD2CA8DD198A6BCDBCB7 /* ThemedTableSubviews.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThemedTableSubviews.swift; sourceTree = ""; };
1929BD4149D5A25C82064DD8 /* UiRoot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UiRoot.swift; sourceTree = ""; };
@@ -817,6 +822,7 @@
4BEBA50F1CFF374B00673FDF /* Info.plist */,
4B37ADB81D6E471B00970D55 /* vimr */,
4B3AC8931DB031C600AC5823 /* sparkle_pub.pem */,
+ 1929BC6D45B7E14D4D75D4E6 /* com.qvacua.VimR.vim */,
);
name = resources;
sourceTree = "";
@@ -878,6 +884,7 @@
4B97E2CF1D33F92200FC0660 /* resources */,
1929BA652D3B88FC071531EC /* UI */,
1929B66A5E2D00EA143AFD86 /* RxRedux.swift */,
+ 1929BBF0944940845485A512 /* RpcEvents.swift */,
);
path = VimR;
sourceTree = "";
@@ -1067,6 +1074,7 @@
4B9433E620B95EC6005807BA /* MacVim-log.icns in Resources */,
4B94340D20B95EC7005807BA /* MacVim-dtd.icns in Resources */,
4B9433DF20B95EC6005807BA /* MacVim-lisp.icns in Resources */,
+ 1929B560C6CE264FD1E1F5A3 /* com.qvacua.VimR.vim in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1182,6 +1190,7 @@
1929BA269EBD68251410A08E /* ShortcutsTableSubviews.swift in Sources */,
1929B2D56C4652E251C23AD4 /* DefaultShortcuts.swift in Sources */,
1929B0C7150100A84FBDB8BF /* ShortcutItem.swift in Sources */,
+ 1929B250DB3FB395A700FE8C /* RpcEvents.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1216,6 +1225,7 @@
1929BC682EA78BF50D1E0890 /* ShortcutsTableSubviews.swift in Sources */,
1929B0244BD7111E168726CF /* DefaultShortcuts.swift in Sources */,
1929BDC69A5F9D1661423488 /* ShortcutItem.swift in Sources */,
+ 1929B489A51FD5B13888A00C /* RpcEvents.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1310,7 +1320,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 300;
+ CURRENT_PROJECT_VERSION = 301;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -1368,7 +1378,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 300;
+ CURRENT_PROJECT_VERSION = 301;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
diff --git a/VimR/VimR/AppDelegateReducer.swift b/VimR/VimR/AppDelegateReducer.swift
index b1d734b1..339bb638 100644
--- a/VimR/VimR/AppDelegateReducer.swift
+++ b/VimR/VimR/AppDelegateReducer.swift
@@ -50,7 +50,7 @@ class AppDelegateReducer: ReducerType {
var mainWindow = state.mainWindowTemplate
- mainWindow.uuid = UUID().uuidString
+ mainWindow.uuid = UUID()
mainWindow.cwd = config.cwd
mainWindow.isDirty = false
diff --git a/VimR/VimR/Base.lproj/MainMenu.xib b/VimR/VimR/Base.lproj/MainMenu.xib
index a38c959b..1c69ad33 100644
--- a/VimR/VimR/Base.lproj/MainMenu.xib
+++ b/VimR/VimR/Base.lproj/MainMenu.xib
@@ -220,6 +220,21 @@
+
+
+
-