예제 #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);
                }
            }
        }
예제 #2
0
        private void Editor_CharAdded(object sender, ScintillaNET.CharAddedEventArgs e)
        {
            ScintillaNET.Scintilla Editor = sender as ScintillaNET.Scintilla;

            curWord = Editor.GetWordFromPosition(Editor.SelectionStart);
            if (curWord.Length == 0)
            {
                return;
            }
            Predicate <string> startWord = compareWithCurrentWord;
            List <string>      list      = autoCompleteList.FindAll(startWord);

            if (list.Count > 0)
            {
                Editor.AutoCShow(curWord.Length, string.Join(SciEditor.AutoCSeparator.ToString(), list.ToArray()));
            }
        }