/// <summary> /// Squiggle a result /// </summary> /// <param name="item"></param> private void AddSquiggle(ListViewItem item) { Match m = errorCharacters.Match(item.SubItems[2].Text); if (m.Success) { // check if the file is open string fname = (item.SubItems[4].Text + "\\" + item.SubItems[3].Text).Replace('/', '\\'); WeifenLuo.WinFormsUI.DockContent[] docs = this.plugin.MainForm.GetDocuments(); ScintillaNet.ScintillaControl Sci; foreach (WeifenLuo.WinFormsUI.DockContent doc in docs) { Sci = this.plugin.MainForm.GetSciControl(doc); if (fname == Sci.Tag.ToString()) { // find position int line = Convert.ToInt16(((Match)item.Tag).Groups["line"].Value) - 1; int start = Convert.ToInt16(m.Groups["start"].Value); int end = Convert.ToInt16(m.Groups["end"].Value); if ((start >= 0) && (end > start) && (end < Sci.TextLength)) { int position = Sci.PositionFromLine(line) + start; int es = Sci.EndStyled; int mask = 1 << Sci.StyleBits; Sci.SetIndicStyle(0, /*INDIC_SQUIGGLE*/ 1); Sci.SetIndicFore(0, 0x000000ff); Sci.StartStyling(position, mask); Sci.SetStyling(end - start, mask); Sci.StartStyling(es, mask - 1); } break; } } } }