Skip to content

search: trigger search on cmd+enter in console

Warren Gifford requested to merge rvt/cmd-enter into main

Created by: rvantonder

Screen Shot 2020-10-07 at 7 27 10 PM


Tested working manually. Question: Am I setting this in the right place? I'm not sure I grok useEffect. From docs:

Accepts a function that contains imperative, possibly effectful code. @param effect — Imperative function that can return a cleanup function @param deps — If present, effect will only activate if the values in the list change.

I don't really care that this effect depends on whether triggerSearch changes, but useEffect seems to require me to add it to deps since editorInstance is effectful, and I'm looking for a place to add this key binding where editorInstance is defined. I.e., editorInstance is only guaranteed to be defined after the check inside this useEffect block, so it seems like the right place. The implication is that triggerSearch needs to be included in deps, which is weird to me.

Merge request reports

Loading