Find string in Codemirror without Dialog
See original GitHub issueHi.
How do I trigger the search in CodeMirror to select(and unselect) a specific string without using the dialog?
I am looking for something like: CodeMirror.execCommand('find', 'test')
and it will mark all occurences of test just like it would when I use the dialog box.
I found a duplicate of this: https://github.com/codemirror/CodeMirror/issues/3392 but it has been closed with a hint to https://codemirror.net/doc/manual.html#addon_searchcursor and I really can’t see at all how I would implement this via getSearchCursor()
. Can someone provide an example for this or has some additional explanations?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Find string in Codemirror without Dialog · Issue #5521 - GitHub
Hi. How do I trigger the search in CodeMirror to select(and unselect) a specific string without using the dialog?
Read more >codemirror: search and highlight multipule words without dialog
Search and highlight multiple strings · I want to be able to iterate each number of matches found and print its line number....
Read more >Search/Replace Demo - CodeMirror
Persistent search (dialog doesn't autoclose, enter to find next, Shift-Enter to find previous); Alt-G: Jump to line. Searching is enabled by including addon/ ......
Read more >CodeMirror 5 User Manual
It may be a string, which either simply names the mode or is a MIME type associated with the mode. The value "null"...
Read more >Reference Manual - CodeMirror
Look up a translation for the given phrase (via the phrases facet), or return the original string if no translation is found.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks your right. It works now. I think a doc entry for this might be helpful.
FWIW the full working code is:
You didn’t move the cursor to a match yet, so
from
andto
aren’t returning anything.