mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-01 01:32:04 +03:00
Use user's temp folder for the socket
This commit is contained in:
parent
1497082e92
commit
8d06a3e475
@ -210,8 +210,13 @@ static CFDataRef local_server_callback(CFMessagePortRef local __unused, SInt32 m
|
|||||||
_neoVimServerTask.arguments = shellArgs;
|
_neoVimServerTask.arguments = shellArgs;
|
||||||
[_neoVimServerTask launch];
|
[_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 *cmd = [NSString stringWithFormat:@"NVIM_LISTEN_ADDRESS=%@ exec \"%@\" '%@' '%@'",
|
||||||
[NSString stringWithFormat:@"/tmp/vimr_%@.sock", _uuid],
|
listenAddress,
|
||||||
[self neoVimServerExecutablePath],
|
[self neoVimServerExecutablePath],
|
||||||
[self localServerName],
|
[self localServerName],
|
||||||
[self remoteServerName]];
|
[self remoteServerName]];
|
||||||
|
@ -152,7 +152,9 @@ public class NeoVimView: NSView,
|
|||||||
public init(frame rect: NSRect, config: Config) {
|
public init(frame rect: NSRect, config: Config) {
|
||||||
self.drawer = TextDrawer(font: self._font)
|
self.drawer = TextDrawer(font: self._font)
|
||||||
self.agent = NeoVimAgent(uuid: self.uuid)
|
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")
|
preconditionFailure("Nvim could not be instantiated")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user