private void Scintilla_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { { switch (e.Button) { case System.Windows.Forms.MouseButtons.Left: if (FindReplace == null) { break; } //Clear current highlights FindReplace.ClearAllHighlights(); //Highlight identical text string sWord = Scintilla.GetWordFromPosition(Scintilla.CurrentPosition); if (!string.IsNullOrEmpty(sWord)) { FindReplace.FindAll(sWord, false, true); } break; default: break; } } }
void StandardScintilla_SelectionChanged(object sender, EventArgs e) { NativeInterface.IndicatorClearRange(0, Text.Length); if (string.IsNullOrWhiteSpace(Selection.Text)) { return; } foreach (Range r in FindReplace.FindAll(Selection.Text)) { r.SetIndicator(0); } }
public void FindInFiles(string pattern, bool matchCase, string filesOfType, VimGrepFlags flags, FSharpFunc <Unit, Unit> action) { var find = new FindReplace(); var options = new FilterOptions { CaseSensitive = matchCase, RegexSearch = true, }; var scope = new ShellWildcardSearchScope(_vim.VimData.CurrentDirectory, filesOfType); using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor(true)) { var results = find.FindAll(scope, monitor, pattern, null, options, System.Threading.CancellationToken.None); foreach (var result in results) { //TODO: Cancellation? monitor.ReportResult(result); } } action.Invoke(null); }