diff --git a/file/files.go b/file/files.go index f38a3ce..26de794 100644 --- a/file/files.go +++ b/file/files.go @@ -203,11 +203,16 @@ func listFiles(dirname string) []string { dirs := []string{} files := []string{} - // 目录靠前,文件靠后 + // 排序:目录靠前,文件靠后 for _, name := range names { fio, _ := os.Lstat(filepath.Join(dirname, name)) if fio.IsDir() { + // 排除 .git 目录 + if ".git" == fio.Name() { + continue + } + dirs = append(dirs, name) } else { files = append(files, name) diff --git a/static/js/editor.js b/static/js/editor.js index 062cd2d..4ad3604 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -75,9 +75,6 @@ var editors = { cursorCh: editor.getCursor().ch }; - // XXX: 回调有问题,暂时不使用 WS 协议 - //editorWS.send(JSON.stringify(request)); - var autocompleteHints = []; $.ajax({ diff --git a/static/js/tree.js b/static/js/tree.js index 56558d5..26e5fa3 100644 --- a/static/js/tree.js +++ b/static/js/tree.js @@ -126,8 +126,7 @@ var tree = { } }; tree.fileTree = $.fn.zTree.init($("#files"), setting, data.root.children); - // TODO: remove - tree.fileTree.expandAll(true); + // tree.fileTree.expandAll(true); } } });