From b6188c642e16aada67e458753d29e9cdfbb36b80 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 28 Nov 2022 16:30:08 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=9F=A5=E6=89=BE=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=AD=E4=BD=BF=E7=94=A8=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E5=BC=8F=E5=90=8E=E6=9B=BF=E6=8D=A2=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=20https://github.com/siyuan-note/siyuan/issues/6722?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/search/util.ts | 10 +++++----- kernel/api/search.go | 2 +- kernel/model/search.go | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/search/util.ts b/app/src/search/util.ts index 9a5878866..1c7b71d7a 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -98,7 +98,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: () - + @@ -530,7 +530,7 @@ const addQueryMenu = (config: ISearchOption, edit: Protyle, element: Element) => current: config.method === 0, click() { config.method = 0; - searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod}: ${window.siyuan.languages.text}`); + searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod} ${window.siyuan.languages.text}`); inputEvent(element, config, undefined, edit); } }).element); @@ -539,7 +539,7 @@ const addQueryMenu = (config: ISearchOption, edit: Protyle, element: Element) => current: config.method === 1, click() { config.method = 1; - searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod}: ${window.siyuan.languages.querySyntax}`); + searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod} ${window.siyuan.languages.querySyntax}`); inputEvent(element, config, undefined, edit); } }).element); @@ -548,7 +548,7 @@ const addQueryMenu = (config: ISearchOption, edit: Protyle, element: Element) => current: config.method === 2, click() { config.method = 2; - searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod}: SQL`); + searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod} SQL`); inputEvent(element, config, undefined, edit); } }).element); @@ -557,7 +557,7 @@ const addQueryMenu = (config: ISearchOption, edit: Protyle, element: Element) => current: config.method === 3, click() { config.method = 3; - searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod}: ${window.siyuan.languages.regex}`); + searchSyntaxCheckElement.setAttribute("aria-label", `${window.siyuan.languages.searchMethod} ${window.siyuan.languages.regex}`); inputEvent(element, config, undefined, edit); } }).element); diff --git a/kernel/api/search.go b/kernel/api/search.go index 01798c252..d6b3f6201 100644 --- a/kernel/api/search.go +++ b/kernel/api/search.go @@ -52,7 +52,7 @@ func findReplace(c *gin.Context) { if nil != err { ret.Code = -1 ret.Msg = err.Error() - ret.Data = map[string]interface{}{"closeTimeout": 3000} + ret.Data = map[string]interface{}{"closeTimeout": 5000} return } return diff --git a/kernel/model/search.go b/kernel/model/search.go index 0140eb985..bc2518a39 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -18,6 +18,7 @@ package model import ( "bytes" + "errors" "path" "regexp" "strconv" @@ -169,7 +170,7 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int) (ret []*Block, ne func FindReplace(keyword, replacement string, ids []string, method int) (err error) { // method:0:文本,1:查询语法,2:SQL,3:正则表达式 if 1 == method || 2 == method { - util.PushMsg(Conf.Language(132), 5000) + err = errors.New(Conf.Language(132)) return }