Exemple #1
0
        /// <summary>
        /// Extends selection the the beginning and end of the lines.
        /// </summary>
        public void SelectFullLines(vsStartOfLineOptions startOptions, out EditPoint topPoint, out EditPoint bottomPoint)
        {
            topPoint = selection.TopPoint.CreateEditPoint();
            topPoint.StartOfLine();

            // move to the first word on the right:
            if (startOptions == vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
            {
                topPoint.WordRight(1);
            }

            bottomPoint = selection.BottomPoint.CreateEditPoint();
            bottomPoint.EndOfLine();

            selection.MoveToPoint(topPoint, false);
            selection.MoveToPoint(bottomPoint, true);
        }
 public void StartOfLine(vsStartOfLineOptions Where = vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, bool Extend = false)
 {
     throw new NotImplementedException();
 }
Exemple #3
0
        private void OnMoveBeginningOfLine()
        {
            if (prevCommand == "MoveBeginningOfLine") {
                if (prevStartOfLineOptions == vsStartOfLineOptions.vsStartOfLineOptionsFirstText) {
                    prevStartOfLineOptions = vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn;
                } else {
                    prevStartOfLineOptions = vsStartOfLineOptions.vsStartOfLineOptionsFirstText;
                }
            } else {
                prevStartOfLineOptions = vsStartOfLineOptions.vsStartOfLineOptionsFirstText;
            }
            var oldPos = Selection.ActivePoint.AbsoluteCharOffset;
            Selection.StartOfLine(prevStartOfLineOptions, emacsSelectionActive);

            // if we were already at the beginnig of the text, move to the beginning of the line
            if (oldPos == Selection.ActivePoint.AbsoluteCharOffset) {
                if (prevStartOfLineOptions == vsStartOfLineOptions.vsStartOfLineOptionsFirstText && !Selection.ActivePoint.AtStartOfLine) {
                    prevStartOfLineOptions = vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn;
                    Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, emacsSelectionActive);
                } else if (prevStartOfLineOptions == vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn) {
                    prevStartOfLineOptions = vsStartOfLineOptions.vsStartOfLineOptionsFirstText;
                    Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText);
                }
            }
        }
 public void StartOfLine(vsStartOfLineOptions Where = vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, bool Extend = false)
 {
     throw new NotImplementedException();
 }