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

GH-299 Fix the behavior of set parent as cwd (see also GH-340 for go up)

This commit is contained in:
Tae Won Ha 2016-11-13 22:53:57 +01:00
parent 7a83f6c871
commit 2c47873a15
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 7 additions and 5 deletions

View File

@ -315,7 +315,7 @@ extension FileOutlineView {
return
}
guard item.isDir else {
guard self.level(forItem: clickedItem) > 0 else {
return
}
@ -335,12 +335,14 @@ extension FileOutlineView {
return true
}
if item.action == #selector(setAsWorkingDirectory(_:))
|| item.action == #selector(setParentAsWorkingDirectory(_:))
{
if item.action == #selector(setAsWorkingDirectory(_:)) {
return clickedItem.isDir
}
if item.action == #selector(setParentAsWorkingDirectory(_:)) {
return self.level(forItem: clickedItem) > 0
}
return true
}
}

View File

@ -177,7 +177,7 @@ class MainWindowComponent: WindowComponent, NSWindowDelegate, NSUserInterfaceVal
self.neoVimView.cwd = url
case let FileBrowserAction.setParentAsWorkingDirectory(url: url):
self.neoVimView.cwd = self.neoVimView.cwd.parent
self.neoVimView.cwd = url.parent
default:
NSLog("unrecognized action: \(action)")