Search and Replace

AvaloniaEdit comes with a built-in SearchPanel that handles Find, Find Next/Prev, and Replace functionalities.

Installing the Search Panel

using AvaloniaEdit.Search;

// ... in constructor or attached event
SearchPanel.Install(textEditor);

Once installed, the standard hotkeys work automatically when the editor has focus:

  • Ctrl+F: Open Find
  • F3: Find Next
  • Shift+F3: Find Previous
  • Ctrl+H (or platform specific): Replace (if enabled)

You can control aspects of the search panel via the SearchPanel instance returned by Install:

var panel = SearchPanel.Install(textEditor);
panel.MarkerBrush = Brushes.Yellow; // Customize highlight color