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

Find multiple strings with find method and add to queue #2948

Closed
sdkcarlos opened this issue Apr 17, 2016 · 1 comment
Closed

Find multiple strings with find method and add to queue #2948

sdkcarlos opened this issue Apr 17, 2016 · 1 comment

Comments

@sdkcarlos
Copy link

I would like to execute a detailed search in a list, to display something like :

Searching "hello"

  • Hello found on line 1
  • Hello found on line 53
  • Hello found on line 55
  • Hello found on line 87

But using the following code only allows me to get the line 87 !

var range = editor.find("myString",{
       wrap: true,
       caseSensitive: false, 
       wholeWord: false,
       regExp: false,
       preventScroll: true // do not change selection
});
// This works, however it only returns an object with a range start and end of the last found item.
// and there are many lines that contains "myString" but i can retrieve only 1
// For example myString is on the line 1,53,55,87

I tried to with editor.findPrevious or findNext but those methods doesn't return anything.
Is possible to achieve this using ace api or i need to handle it by myself, thanks !

@nightwing
Copy link
Member

it is possible to call find function multiple times, but doing it without using ace api, would be simpler and faster, something like https://github.com/cloud9ide/nak/blob/master/lib/finalizer.js#L76 should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants