1
0
forked from aniani/vim

patch 8.0.0519: character classes are not well tested

Problem:    Character classes are not well tested. They can differ between
            platforms.
Solution:   Add tests.  In the documentation make clear which classes depend
            on what library function.  Only use :cntrl: and :graph: for ASCII.
            (Kazunobu Kuriyama, Dominique Pelle, closes #1560)
            Update the documentation.
This commit is contained in:
Bram Moolenaar
2017-03-29 15:31:20 +02:00
parent c6cd8409c2
commit 0c078fc7db
5 changed files with 91 additions and 33 deletions

View File

@@ -2555,17 +2555,17 @@ collection:
regc('\t');
break;
case CLASS_CNTRL:
for (cu = 1; cu <= 255; cu++)
for (cu = 1; cu <= 127; cu++)
if (iscntrl(cu))
regmbc(cu);
break;
case CLASS_DIGIT:
for (cu = 1; cu <= 255; cu++)
for (cu = 1; cu <= 127; cu++)
if (VIM_ISDIGIT(cu))
regmbc(cu);
break;
case CLASS_GRAPH:
for (cu = 1; cu <= 255; cu++)
for (cu = 1; cu <= 127; cu++)
if (isgraph(cu))
regmbc(cu);
break;