git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
digraphs: mkdigraphs-vim: escape mnemonics
[sheet.git]
/
tools
/
mkdigraphs-vim
diff --git
a/tools/mkdigraphs-vim
b/tools/mkdigraphs-vim
index a94812fe942f52a8eb4a513e3c28906e3ffa6fc5..5386010dd9c4479c551f5772a75fe093da8e97cc 100755
(executable)
--- a/
tools/mkdigraphs-vim
+++ b/
tools/mkdigraphs-vim
@@
-7,7
+7,11
@@
vim -e -c'echo version' -cdigraphs -cq | perl -CSD -nE '
say "# digraphs list from vim version ", s/\s*\z//r;
say "+{";
} else { # body
say "# digraphs list from vim version ", s/\s*\z//r;
say "+{";
} else { # body
- say "q{$1} => $3," while /\G(\S\S) (.[^ ]*) +([0-9]+)\s+/g;
+ while (/\G(\S\S) (.[^ ]*) +([0-9]+)\s+/g) {
+ my ($mnem, $chr, $cp) = ($1, $2, $3);
+ $mnem =~ s/(?=[\\}])/\\/g; # escape string delimiter
+ say "q{$mnem} => $cp,";
+ }
} END { # foot
say "}";
exit warn "only $. lines of :digraphs output\n" if $. < 6;
} END { # foot
say "}";
exit warn "only $. lines of :digraphs output\n" if $. < 6;