1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 02:54:31 +03:00

Use user's temp folder for the socket

This commit is contained in:
Tae Won Ha 2017-12-01 20:58:46 +01:00
parent 1497082e92
commit 8d06a3e475
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 9 additions and 2 deletions

View File

@ -210,8 +210,13 @@ static CFDataRef local_server_callback(CFMessagePortRef local __unused, SInt32 m
_neoVimServerTask.arguments = shellArgs;
[_neoVimServerTask launch];
__auto_type listenAddress = [
[[NSURL alloc] initFileURLWithPath:NSTemporaryDirectory()]
URLByAppendingPathComponent:[NSString stringWithFormat:@"vimr_%@.sock", _uuid]
].path;
NSString *cmd = [NSString stringWithFormat:@"NVIM_LISTEN_ADDRESS=%@ exec \"%@\" '%@' '%@'",
[NSString stringWithFormat:@"/tmp/vimr_%@.sock", _uuid],
listenAddress,
[self neoVimServerExecutablePath],
[self localServerName],
[self remoteServerName]];

View File

@ -152,7 +152,9 @@ public class NeoVimView: NSView,
public init(frame rect: NSRect, config: Config) {
self.drawer = TextDrawer(font: self._font)
self.agent = NeoVimAgent(uuid: self.uuid)
guard let nvim = Nvim(at: "/tmp/vimr_\(self.uuid).sock") else {
let sockPath = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("vimr_\(self.uuid).sock").path
guard let nvim = Nvim(at: sockPath) else {
preconditionFailure("Nvim could not be instantiated")
}