示例#1
0
        void scintilla1_Click(object sender, EventArgs e)
        {
            ScintillaNET.Scintilla scintilla1 = sender as ScintillaNET.Scintilla;

            string word = scintilla1.GetWordFromPosition(scintilla1.CurrentPos);

            var match = Regex.Match(word, "^[rvo][0-9]+$");

            foreach (ScintillaNET.Range r in m_PrevRanges)
            {
                r.ClearIndicator(4);
            }

            m_PrevRanges.Clear();

            if (match.Success)
            {
                var matches = Regex.Matches(scintilla1.Text, word + "\\.[xyzwrgba]+");

                foreach (Match m in matches)
                {
                    var r = scintilla1.GetRange(m.Index, m.Index + m.Length);
                    m_PrevRanges.Add(r);
                    r.SetIndicator(4);
                }
            }
        }