atom / find-and-replace

Find and replace in a single buffer and in the project
MIT License
242 stars 219 forks source link

open find panel programmatically? #1108

Open allefeld opened 4 years ago

allefeld commented 4 years ago

I would like to open the find panel programmatically in my package, for a given TextEditor object, with a given search term and options. Is that possible?

I found TextEditor::scan, but that gives me the search results directly. What I would like to do is initiate the search for the user in the UI, but let them continue / abandon it interactively.

Background: I get error messages from an external program, but without corresponding line numbers, only a part of the offending code.

gladed commented 4 years ago

This opens Find in Project for text under the cursor:

atom.commands.dispatch(document.querySelector('atom-text-editor'), 'project-find:show')

But I couldn't find a way to pass additional options.