warpPointsGenerator top-level property

FigGenerator warpPointsGenerator
final

Implementation

final FigGenerator warpPointsGenerator = FigGenerator(
  script: (List<String> tokens, FigGeneratorContext? ctx) {
    final home = ctx?.getEnv('HOME') ?? '';
    return ['cat', '$home/.warprc'];
  },
  postProcess: (String out, [List<String>? tokens]) {
    final RegExp exp = RegExp(r'^(\w+)', multiLine: true);
    return exp
        .allMatches(out)
        .map((m) => FigSuggestion(
              name: m.group(1)!,
              description: 'Warp point',
              icon: '🔘',
              priority: 76,
            ))
        .toList();
  },
);