private void OnCancelHighlight(ScintillaControl sci) { if (sci.isHiliteSelected && sci.hasHighlights && sci.SelText.Length == 0) { sci.RemoveHighlights(); sci.hasHighlights = false; } }
/// <summary> /// Provides basic highlighting of selected text /// </summary> private void OnSelectHighlight(ScintillaControl sci) { sci.RemoveHighlights(); if (Control.ModifierKeys == Keys.Control && sci.SelText.Length != 0) { Language language = Configuration.GetLanguage(sci.ConfigurationLanguage); Int32 color = language.editorstyle.HighlightBackColor; String pattern = sci.SelText.Trim(); FRSearch search = new FRSearch(pattern); search.WholeWord = true; search.NoCase = false; search.Filter = SearchFilter.None; // Everywhere sci.AddHighlights(search.Matches(sci.Text), color); sci.hasHighlights = true; } }
/// <summary> /// Refreshes the highlights /// </summary> private void RefreshHighlights(ScintillaControl sci, List<SearchMatch> matches) { sci.RemoveHighlights(); if (this.highlightTimer.Enabled) this.highlightTimer.Stop(); Hashtable table = new Hashtable(); table["sci"] = sci; table["matches"] = matches; this.highlightTimer.Tag = table; this.highlightTimer.Start(); }
/// <summary> /// Cancel highlights if not using aggressive highlighting /// </summary> private void OnCancelHighlight(ScintillaControl sci) { if (sci.isHiliteSelected && sci.hasHighlights && sci.SelText.Length == 0 && PluginBase.MainForm.Settings.HighlightMatchingWordsMode != Enums.HighlightMatchingWordsMode.SelectionOrPosition) { sci.RemoveHighlights(1); sci.hasHighlights = false; } }
private void ClearSquiggles(ScintillaControl sci) { if (sci == null) return; try { sci.RemoveHighlights(2); } finally { fileWithSquiggles = null; } }