如何在codemirror中根据子字符串选择文本? [英] How to select the text based on substring in codemirror?

查看:665
本文介绍了如何在codemirror中根据子字符串选择文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在codemirror中根据搜索到的字符串去行? doc.getSelection()函数需要一个行号作为参数。我只有字符串如何解析该字符串到函数,并获得滚动视图和textarea中搜索字符串的选择。我的要求还有其他功能吗?它就像查找和替换功能,但我只需要在textarea中选择特定的字符串。

任何帮助都将非常感谢。

How to go the line based on searched string in codemirror? doc.getSelection() function needs a line number as an argument. I have only string how to parse this string to the function and get the scroll view and selection of searched string in the textarea. Is there any other function for my requirement? Its like find and replace function but I just need to select the specific string in the textarea.
Any help will be greatly appreciated.

推荐答案

看看这里:查找和替换Textarea [ ^ ]。根据需要更改代码。
Have a look here: Find and Replace for an Textarea[^]. Change the code to your needs.


这篇关于如何在codemirror中根据子字符串选择文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆