Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]搜索替换功能 #379

Closed
zimolab opened this issue Jan 10, 2023 · 6 comments
Closed

[Feature request]搜索替换功能 #379

zimolab opened this issue Jan 10, 2023 · 6 comments
Labels
🚀enhancement New feature or request

Comments

@zimolab
Copy link

zimolab commented Jan 10, 2023

能否开启codemirror自带的搜索替换功能?

@sunsonliu sunsonliu added the 🚀enhancement New feature or request label Jan 11, 2023
@sunsonliu
Copy link
Collaborator

是可以的,只是一直没有时间研究codemirror的搜索组件,所以一直没安排上。。。

@zimolab
Copy link
Author

zimolab commented Jan 11, 2023

研究了一下,还是比较简单,只要import几个文件就行

import 'codemirror/addon/scroll/annotatescrollbar.js'
import 'codemirror/addon/search/matchesonscrollbar.js'
import 'codemirror/addon/search/match-highlighter.js'
import 'codemirror/addon/search/jump-to-line.js'

import 'codemirror/addon/dialog/dialog.js'
import 'codemirror/addon/dialog/dialog.css'
import 'codemirror/addon/search/searchcursor.js'
import 'codemirror/addon/search/search.js'

不过官方自带的搜索替换对话框不好用就是,我使用一个第三方组件,感觉比官方自带的好用的多
第三方搜索替换对话框

@sunsonliu
Copy link
Collaborator

哈哈,求那个第三方组件的地址,我们瞅瞅~~~

@zimolab
Copy link
Author

zimolab commented Jan 12, 2023

应该是这个仓库:https://github.com/L-Focus/cm-search-replace
不过很奇怪的是,作者没有把源码上传到github上,npmjs上倒是有源码,搜索cm-search-replace就行,MIT协议的,用起来应该没啥问题。我看了一下,实现也不是很复杂,如果要正式添加到cherry-markdown里,最好还是要统一一下外观风格,界面上显示的字符串也要做一下国际化处理。

@sunsonliu
Copy link
Collaborator

收到~感谢推荐,我们去瞅瞅~~

@sunsonliu
Copy link
Collaborator

感谢推荐,已经接入了,在dev分支。
因为是第三方的组件,不太好修改,所以并没有实现国际化(现在是纯英文)。关于样式简单的处理了下感觉就挺好的。

如果有任何建议欢迎再给我们提issue哈,期待你的更多反馈~~

jiawei686 added a commit that referenced this issue Jan 13, 2023
* dev:
  feat: #379 通过引入第三方组件cm-search-replace实现左侧编辑器搜索、替换功能
  fix: #380 修复粘贴时转义&的问题,同时修复粘贴table时出现过多换行的问题\n feat: 当表格thead为空的时候,不再渲染<thead>
  fix: #374 光标处于编辑区域最低部时,预览区域滚动到了顶部
wty92911 pushed a commit to wty92911/cherry-markdown that referenced this issue May 22, 2023
* dev:
  feat: Tencent#379 通过引入第三方组件cm-search-replace实现左侧编辑器搜索、替换功能
  fix: Tencent#380 修复粘贴时转义&的问题,同时修复粘贴table时出现过多换行的问题\n feat: 当表格thead为空的时候,不再渲染<thead>
  fix: Tencent#374 光标处于编辑区域最低部时,预览区域滚动到了顶部
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants