close editor after rename or remove the file
This commit is contained in:
parent
6fe83917dd
commit
15f3c12579
|
@ -495,14 +495,14 @@ func (sessions *wSessions) new(httpSession *sessions.Session, sid string) *WideS
|
|||
logger.Trace(event)
|
||||
|
||||
if event.Op&fsnotify.Create == fsnotify.Create {
|
||||
if err = watcher.Add(path); nil != err {
|
||||
logger.Warn(err, path)
|
||||
}
|
||||
|
||||
fileType := "f"
|
||||
|
||||
if util.File.IsDir(path) {
|
||||
fileType = "d"
|
||||
|
||||
if err = watcher.Add(path); nil != err {
|
||||
logger.Warn(err, path)
|
||||
}
|
||||
}
|
||||
|
||||
cmd := map[string]interface{}{"path": path, "dir": dir,
|
||||
|
|
|
@ -199,6 +199,11 @@ var session = {
|
|||
var node = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.path));
|
||||
tree.fileTree.removeNode(node);
|
||||
|
||||
var nodes = tree.fileTree.transformToArray(node);
|
||||
for (var i = 0, ii = nodes.length; i < ii; i++) {
|
||||
editors.tabs.del(nodes[i].path);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue