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:
parent
7a83f6c871
commit
2c47873a15
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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)")
|
||||
|
Loading…
Reference in New Issue
Block a user