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

Allow plugins to set find and replace strings in the Find/Replace panels #1572

Closed
keith-hall opened this issue Jan 18, 2017 · 1 comment
Closed

Comments

@keith-hall
Copy link
Collaborator

Currently, it is possible to execute the show_panel Window command and set a variety of options when showing the find or replace panels:

window.run_command('show_panel', { 'panel': 'replace', 'regex': True, 'case_sensitive': False, 'whole_word': False, 'in_selection': False, 'wrap': True, 'highlight': True, 'preserve_case': True })

however, it is not possible to set what value should be filled in for the Find What or Replace With text boxes.

The only current option is to use the slurp_find_string and slurp_replace_string commands, which take the selection from the buffer. However, these are also both Window commands, so there is no way to set the find/replace string without putting it into the main buffer first (i.e. one can't work around it by using a hidden output panel View to execute the commands on).

Please could it be made possible to set the find and replace strings either by:

  • specifying arguments to the show_panel command like window.run_command('show_panel', { 'panel': 'replace', 'regex': True, 'case_sensitive': False, 'whole_word': False, 'in_selection': False, 'wrap': True, 'highlight': True, 'preserve_case': True, 'find_string': 'foo', 'replace_string': 'bar' })
  • and/or by implementing new commands like set_find_string and set_replace_string which would take a string argument
@BenjaminSchaaf
Copy link
Member

In build 4123 the "pattern" and "replace_pattern" have been added as arguments for the find/replace/find-in-files panels.

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

No branches or pull requests

2 participants