static bool Replace(ViBuilderContext ctx) { ctx.RunAction((ViEditor e) => e.SetMode(ViEditorMode.Replace)); ctx.SuppressCompleted(); ctx.Builder = ViBuilders.InsertBuilder(insertActions); return(true); }
static ViBuilderContext() { normalBuilder = ViBuilders.RegisterBuilder( ViBuilders.MultiplierBuilder( ViBuilders.First(normalActions.Builder, motions.Builder, nonCharMotions.Builder))); insertActions = ViBuilders.First(nonCharMotions.Builder, insertEditActions.Builder); }
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); } }); }
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); } }); }