Skip to content

搜索预览区代码块高亮关键字 #11350

Closed
@allrobot

Description

@allrobot

Improve add highlighting to the subpage code snippet of the search bar.

In what scenarios do you need this feature?

SiYuan_E8lBjhYiKG

搜索的普通文本能高亮显示,但是代码片段中的文本无法高亮显示,而是整个代码片段进行高亮……

Describe the optimal solution

代码片段搜索到的内容进行高亮显示,而不是整个代码片段高亮

Describe the candidate solution

No response

Other information

编辑,需求和 #8332 一样,主要是搜索内容的高亮,就像 https://github.com/Misuzu2027/syplugin-document-search 插件那样:
Image
Image

Activity

changed the title [-]Improve add highlighting to the subpage code snippet of the search bar.[/-] [+]搜索预览区代码块高亮关键字[/+] on May 13, 2024
allrobot

allrobot commented on Jul 7, 2024

@allrobot
Author

代码高亮是许多记录笔记时的必要功能,对于普通用户来说,知识管理所需的搜索功能很重要

然而,当前代码块的搜索体验存在不便,如点击参数时,光标仅跳转至代码块开始,而非目标字符串,给搜索带来不便,这增加了不必要的搜索时间:从代码块肉眼搜索关键词所需的时间

找了快10秒才从代码块找到--max相关的字符串

SiYuan_3e6tGjYRLa.webm

建议改进搜索功能:在预览区域,无论是代码块还是注释块,都应对匹配的字符串进行高亮显示;点击匹配项时,光标应精确跳转至目标字符串的起始位置,并高亮显示所在页面的所有匹配字符串。同时,用户进行其他操作,如随机点击后,高亮应消失,但在使用滚轮浏览时,高亮显示不应取消。

added this to the 3.1.15 milestone on Dec 8, 2024
88250

88250 commented on Dec 8, 2024

@88250
Member

合并到 #13343 中处理。

removed this from the 3.1.15 milestone on Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Vanessa219@allrobot

      Issue actions

        搜索预览区代码块高亮关键字 · Issue #11350 · siyuan-note/siyuan