Example #1
0
        static bool Replace(ViBuilderContext ctx)
        {
            ctx.RunAction((ViEditor e) => e.SetMode(ViEditorMode.Replace));
            ctx.SuppressCompleted();

            ctx.Builder = ViBuilders.InsertBuilder(insertActions);
            return(true);
        }
Example #2
0
 static ViBuilderContext()
 {
     normalBuilder =
         ViBuilders.RegisterBuilder(
             ViBuilders.MultiplierBuilder(
                 ViBuilders.First(normalActions.Builder, motions.Builder, nonCharMotions.Builder)));
     insertActions = ViBuilders.First(nonCharMotions.Builder, insertEditActions.Builder);
 }
Example #3
0
 public static ViBuilder RegisterBuilder(ViBuilder nextBuilder)
 {
     return((ViBuilderContext ctx) => {
         var k = ctx.LastKey;
         if (k.Char == '"')
         {
             ViBuilders.StartRegisterBuilder(ctx, nextBuilder);
             return true;
         }
         else
         {
             ctx.Builder = nextBuilder;
             return ctx.Builder(ctx);
         }
     });
 }
Example #4
0
 public static ViBuilder MultiplierBuilder(ViBuilder nextBuilder)
 {
     return((ViBuilderContext ctx) => {
         var k = ctx.LastKey;
         if (char.IsDigit(k.Char))
         {
             ViBuilders.StartMultiplierBuilder(ctx, nextBuilder);
             return true;
         }
         else
         {
             ctx.Builder = nextBuilder;
             return ctx.Builder(ctx);
         }
     });
 }