🎨 Replace All is no longer affected by pagination https://github.com/siyuan-note/siyuan/issues/8265

This commit is contained in:
Daniel 2023-06-29 18:06:04 +08:00
parent dce9d4da54
commit ecd4a58d03
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 36 additions and 21 deletions

View file

@ -207,7 +207,7 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int, isSquareBrackets
return
}
func FindReplace(keyword, replacement string, ids []string, method int) (err error) {
func FindReplace(keyword, replacement string, ids []string, paths, boxes []string, types map[string]bool, method, orderBy, groupBy int) (err error) {
// method0文本1查询语法2SQL3正则表达式
if 1 == method || 2 == method {
err = errors.New(Conf.Language(132))
@ -232,6 +232,13 @@ func FindReplace(keyword, replacement string, ids []string, method int) (err err
return
}
if 1 > len(ids) {
blocks, _, _, _ := FullTextSearchBlock(keyword, boxes, paths, types, method, orderBy, groupBy, 1)
for _, block := range blocks {
ids = append(ids, block.ID)
}
}
for _, id := range ids {
bt := treenode.GetBlockTree(id)
if nil == bt {