mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 01:21:14 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
85262863ee
@ -547,6 +547,7 @@ func TryAccessFileByBlockID(id string) (ok bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getBoxesByPaths(paths []string) (ret map[string]*Box) {
|
func getBoxesByPaths(paths []string) (ret map[string]*Box) {
|
||||||
|
ret = map[string]*Box{}
|
||||||
for _, p := range paths {
|
for _, p := range paths {
|
||||||
id := strings.TrimSuffix(path.Base(p), ".sy")
|
id := strings.TrimSuffix(path.Base(p), ".sy")
|
||||||
bt := treenode.GetBlockTree(id)
|
bt := treenode.GetBlockTree(id)
|
||||||
|
@ -1075,8 +1075,8 @@ func filterSelfChildDocs(paths []string) (ret []string) {
|
|||||||
for _, fromPath := range paths {
|
for _, fromPath := range paths {
|
||||||
dir := strings.TrimSuffix(fromPath, ".sy")
|
dir := strings.TrimSuffix(fromPath, ".sy")
|
||||||
existParent := false
|
existParent := false
|
||||||
for _, d := range dirs {
|
for d, _ := range dirs {
|
||||||
if strings.HasPrefix(d, fromPath) {
|
if strings.HasPrefix(fromPath, d) {
|
||||||
existParent = true
|
existParent = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1218,12 +1218,7 @@ func RemoveDocs(paths []string) (err error) {
|
|||||||
util.PushEndlessProgress(Conf.Language(116))
|
util.PushEndlessProgress(Conf.Language(116))
|
||||||
|
|
||||||
paths = filterSelfChildDocs(paths)
|
paths = filterSelfChildDocs(paths)
|
||||||
var ids []string
|
pathsBoxes := getBoxesByPaths(paths)
|
||||||
for _, p := range paths {
|
|
||||||
ids = append(ids, strings.TrimSuffix(path.Base(p), ".sy"))
|
|
||||||
}
|
|
||||||
|
|
||||||
pathsBoxes := getBoxesByPaths(ids)
|
|
||||||
WaitForWritingFiles()
|
WaitForWritingFiles()
|
||||||
for p, box := range pathsBoxes {
|
for p, box := range pathsBoxes {
|
||||||
err = removeDoc(box, p)
|
err = removeDoc(box, p)
|
||||||
|
Loading…
Reference in New Issue
Block a user