Esempio n. 1
0
        private void Replace(string val)
        {
            var pos = sci.GetPositionFromLine(sci.CurrentLine) + lastLen;

            sci.ReplaceText(pos, sci.GetPositionByColumn(sci.CurrentLine, sci.GetLineEndColumn(sci.CurrentLine)), val);
            sci.CaretPosition = sci.GetTextLength();
        }
Esempio n. 2
0
        private bool TestIfComments(int pos, bool checkStr)
        {
            var st = sci.GetStyleAt(pos);

            //exclude autocomplete in comments and strings
            var b = st == TextStyle.MultilineStyle1 || st == TextStyle.MultilineStyle2 ||
                    st == TextStyle.Style6 || st == TextStyle.Style7;

            if (st == TextStyle.None && checkStr)
            {
                var lnn = sci.GetLineFromPosition(pos);
                var ln  = sci.GetLine(lnn);
                var col = sci.GetColumnFromPosition(pos);

                for (var i = col; i > -1; i--)
                {
                    if (sci.CharAt(sci.GetPositionByColumn(lnn, i)) == '"')
                    {
                        return(true);
                    }
                }
            }

            return(b);
        }
Esempio n. 3
0
        void ITextEditor.SelectText(int line, int col, int length)
        {
            var pos = sci.GetPositionByColumn(line, col);

            sci.Select(pos, length, SelectionFlags.MakeOnlySelection | SelectionFlags.ScrollToCaret);

            if (sci.CanSelect)
            {
                sci.Select();
            }
        }