openSearchPanel function

bool openSearchPanel(
  1. EditorViewState view
)

Open the search panel.

Implementation

bool openSearchPanel(EditorViewState view) {
  final state = view.state.field(searchState, false);
  if (state != null && state.panel != null) {
    // Panel already open - just focus it
    return true;
  }

  final effects = <StateEffect<dynamic>>[_togglePanel.of(true)];
  if (state == null) {
    effects.add(StateEffect.appendConfig.of(searchExtensions));
  }

  view.dispatch([TransactionSpec(effects: effects)]);
  return true;
}