Possible to toggle find-and-replace options while focus is in an editor?


#1

I’ve added key bindings to toggle find-and-replace options while in the editor. Keybinding Resolver suggests that the commands are executed - the correct things appear in green text with a green checkmark - but the options don’t get toggled.

What does it mean for a command to execute but not execute? Or does the green-text-and-checkmark mean something different than “executed”?

Is it possible to make this work?

These are a couple of the key bindings:

'atom-text-editor':
  'alt-r': 'find-and-replace:toggle-regex-option' 
  'alt-s': 'find-and-replace:toggle-selection-option' 

Thanks.


#2

Some commands are designed to work only in a specific context. For example, let’s say you had a command to sort lines in a text file. If you created a key binding like this:

'.settings-view':
  'alt-r': 'sort-lines:sort'

I would have to assume that wouldn’t work because you’re activating the command in a context that it isn’t designed to work in. So if the commands you’re referencing are expecting the focus to be on the find and replace panel but you’re executing them when a text editor is active, then they don’t work.

I haven’t looked at the code, but this is one potential explanation.


How do I run a command like you would run from the command pallete in a shell script?