private int GetCurrentColumnIndex()
        {
            var textDocument           = _textEditor.Document;
            var offset                 = _textEditor.CaretOffset;
            var affectedLocation       = textDocument.GetLocation(offset);
            var columnNumberWithOffset = _elementGenerator.GetColumn(affectedLocation);

            return(columnNumberWithOffset.Index);
        }
        public void AddColumn()
        {
            var textDocument = _textEditor.Document;
            var linesCount   = textDocument.LineCount;
            var offset       = _textEditor.CaretOffset;

            var affectedLocation       = textDocument.GetLocation(offset);
            var columnNumberWithOffset = _elementGenerator.GetColumn(affectedLocation);

            var columnsCount = _elementGenerator.ColumnCount;
            var newLine      = _elementGenerator.NewLine;

            var columnLenght = columnNumberWithOffset.Length;
            var columnOffset = columnNumberWithOffset.OffsetInLine;

            var lineIndex   = affectedLocation.Line - 1;
            var columnIndex = columnNumberWithOffset.ColumnNumber + 1;

            if (affectedLocation.Column == columnOffset)
            {
                var oldText = textDocument.Text;
                var newText = oldText.InsertCommaSeparatedColumn(columnIndex, linesCount, columnsCount, newLine);

                UpdateText(newText);
                Goto(lineIndex, columnIndex);

                return;
            }

            if (affectedLocation.Column == columnOffset - columnLenght + 1)
            {
                columnIndex--;

                var oldText = textDocument.Text;
                var newText = oldText.InsertCommaSeparatedColumn(columnIndex, linesCount, columnsCount, newLine);

                UpdateText(newText);
                Goto(lineIndex, columnIndex);
            }
        }