From 5afa7fd2694585c96a2ce5e9b6803507f8cfe1b4 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 23 Mar 2017 00:18:48 +0100 Subject: [PATCH] digraphs: ignore ansi commands in vim version output Recent versions of Vim v7.4 prepend the expected version number by various escapes (probably terminal-dependent), causing an unreadable result of: \e[?1049h\e[?1h\e=\e[1;63r\e[?25h\e[?25h\e[?25l\e[63;1H704 Assume nothing is put after the wanted number, so capture only that. --- tools/mkdigraphs-vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mkdigraphs-vim b/tools/mkdigraphs-vim index b9ab426..c1dcbe4 100755 --- a/tools/mkdigraphs-vim +++ b/tools/mkdigraphs-vim @@ -1,6 +1,6 @@ #!/bin/sh -VERSION=1.01 +VERSION=1.02 if [ "$#" -ne 0 ] then @@ -11,7 +11,7 @@ fi vim -e -c'echo version' -cdigraphs -cq | perl -CSD -nE ' if ($. == 1) { # head - say "# digraphs list from vim version ", s/\s*\z//r; + say "# digraphs list from vim version ", m/(\d+)\s*\z/; say "+{"; } else { # body while (/\G(\S\S) (.[^ ]*) +([0-9]+)\s+/g) { -- 2.30.0