1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 11:37:32 +03:00

Remove unused stuff

This commit is contained in:
Tae Won Ha 2016-08-26 17:45:58 +02:00
parent 7cccc87f7f
commit 798058354a
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
5 changed files with 3 additions and 57 deletions

View File

@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithUuid:(NSString *)uuid;
- (void)quit;
- (bool)runLocalServerAndNeoVimWithPath:(NSString *)path;
- (bool)runLocalServerAndNeoVim;
- (void)vimCommand:(NSString *)string;

View File

@ -119,7 +119,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
[_neoVimServerTask launch];
}
- (bool)runLocalServerAndNeoVimWithPath:(NSString *)path {
- (bool)runLocalServerAndNeoVim {
_localServerThread = [[NSThread alloc] initWithTarget:self selector:@selector(runLocalServer) object:nil];
[_localServerThread start];

View File

@ -112,7 +112,7 @@ public class NeoVimView: NSView, NSUserInterfaceValidations {
// We cannot set bridge in init since self is not available before super.init()...
self.agent.bridge = self
let noErrorDuringInitialization = self.agent.runLocalServerAndNeoVimWithPath(ShellUtils.pathForUserShell())
let noErrorDuringInitialization = self.agent.runLocalServerAndNeoVim()
// Neovim is ready now: resize neovim to bounds.
DispatchUtils.gui {

View File

@ -1,50 +0,0 @@
/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Foundation
class ShellUtils {
static let defaultPath = "/usr/local/bin:/opt/local/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
private static let cmdForPath = "env | grep '^PATH=' | sed 's/^PATH=//'"
static func run(command command: String, arguments: [String] = []) -> String? {
let pipe = NSPipe()
let task = NSTask()
task.standardOutput = pipe
task.launchPath = command
task.arguments = arguments
task.launch()
let file = pipe.fileHandleForReading;
let data = file.readDataToEndOfFile()
file.closeFile()
let output = NSString(data: data, encoding: NSUTF8StringEncoding)
return output?.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
}
static func pathForUserShell() -> String {
guard let shell = NSProcessInfo.processInfo().environment["SHELL"] else {
return ShellUtils.defaultPath
}
let shellUrl = NSURL(fileURLWithPath: shell)
guard let shellPath = shellUrl.path else {
return ShellUtils.defaultPath
}
var shellOptions = [String]()
if shellUrl.lastPathComponent != "tsch" {
shellOptions.append("-l") // tsch allows the -l option only for interactive shell
}
shellOptions.append("-c")
shellOptions.append(ShellUtils.cmdForPath)
return ShellUtils.run(command: shellPath, arguments: shellOptions) ?? ShellUtils.defaultPath
}
}

View File

@ -48,7 +48,6 @@
4B6A709A1D65058A00E12030 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B56F29C1D29926600C1F92E /* Quick.framework */; };
4B6A709C1D6507A000E12030 /* Nimble.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B56F29B1D29926600C1F92E /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4B6A709D1D6507A000E12030 /* Quick.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B56F29C1D29926600C1F92E /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4B6A709F1D660CDA00E12030 /* ShellUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A709E1D660CDA00E12030 /* ShellUtils.swift */; };
4B854A1D1D31447C00E08DE1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B854A1C1D31447C00E08DE1 /* main.m */; };
4B97E2CC1D33F53D00FC0660 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B97E2CE1D33F53D00FC0660 /* MainWindow.xib */; };
4B9A15241D2993DA009F9F67 /* Nimble.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B56F29B1D29926600C1F92E /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@ -215,7 +214,6 @@
4B570DC11D303CAF006EDC21 /* NeoVimAgent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NeoVimAgent.m; sourceTree = "<group>"; };
4B6A70931D60E04200E12030 /* CocoaExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CocoaExtensions.swift; sourceTree = "<group>"; };
4B6A70951D6100E300E12030 /* SwiftCommons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftCommons.swift; sourceTree = "<group>"; };
4B6A709E1D660CDA00E12030 /* ShellUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShellUtils.swift; sourceTree = "<group>"; };
4B854A1A1D31447C00E08DE1 /* NeoVimServer */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = NeoVimServer; sourceTree = BUILT_PRODUCTS_DIR; };
4B854A1C1D31447C00E08DE1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
4B97E2CD1D33F53D00FC0660 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainWindow.xib; sourceTree = "<group>"; };
@ -343,7 +341,6 @@
4BEE79131D16D1C60012EDAA /* NeoVimView */,
4BEE79161D16D3800012EDAA /* CellAttributes.swift */,
1929BA6128BFDD54CA92F46E /* ColorUtils.swift */,
4B6A709E1D660CDA00E12030 /* ShellUtils.swift */,
4B2A2BF91D0351810074CE9A /* SwiftNeoVim.h */,
4BDF641A1D0887C100D47E1D /* TextDrawer.h */,
4BDF641B1D0887C100D47E1D /* TextDrawer.m */,
@ -717,7 +714,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4B6A709F1D660CDA00E12030 /* ShellUtils.swift in Sources */,
4BEE79171D16D3800012EDAA /* CellAttributes.swift in Sources */,
4BF6E29C1D34153C0053FA76 /* KeyUtils.swift in Sources */,
4BCADE081D11ED12004DAD0F /* CocoaExtensions.swift in Sources */,