Ejemplo n.º 1
0
        internal static Pos WordRight(EditorControl ctx, Selection sel)
        {
            var caret = sel.Caret;
            var line  = ctx.Buffer.Document.Lines[caret.Line];

            if (caret.Col < line.Length - 1)
            {
                var seps  = ctx.AffinityManager.GetAffinity(caret).GetNonWordSymbols(ctx);
                var c     = line.CharAt(caret.Col);
                var strat = SelectWordCommand.GetStrategy(seps, c);
                var pos   = SelectWordCommand.FindBoundRight(seps, line, caret.Col, strat);
                return(new Pos(caret.Line, pos));
            }
            else
            {
                return(RightCommand.MoveRight(ctx, sel));
            }
        }
Ejemplo n.º 2
0
 protected override Pos Select(Selection sel) => RightCommand.MoveRight(Ed, sel);