Christian wrote: > On Di, 10 Jun 2014, Ingo Karkat wrote: > > > Hello Vim developers, > > > > a question on Super User > > (http://superuser.com/questions/766817/hide-non-printable-characters-in-vim/) > > asks to show all non-printable (control) characters with a single > > display cell. One (hacky, and arguably not perfect) way to do this is by > > including all ASCII characters in 'isprint': > > > > :set isprint=0-255 > > > > However, this yields "E474: Invalid argument". It only works by > > excluding ^@ = 0 (via :set isprint=1-255). Also, other variants such as > > :set isprint^=0 and :set isprint=0,1-255 and :set > > isprint=<C-v><C-@>,1-255 do not work (verified up to current version > > 7.4.316). > > > > The same applies to the similar 'isfname' setting, even though its > > documentation (and 'isprint' refers to that, too) explicitly mentions > > the number 0: > > > > ,----[ :help 'isfname' excerpt ]---- > > | The format of this option is a list of parts, separated with commas. > > | Each part can be a single character number or a range. A range is two > > | character numbers with '-' in between. A character number can be a > > | decimal number between 0 and 255 or the ASCII character itself (does > > | not work for digits). > > `---- > > > > I see this as a bug in the :set command, or, if technical reasons > > prevent the use of ^@ in those option values, a bug in the > > documentation. (Preferably, to address the issue in the mentioned > > question, the first. :-) > > I don't know if it is a bug or it was done intentionally and I even > don't know what :set isprint=0-255 is supposed to be doing. But here is > a patch: > > diff --git a/src/charset.c b/src/charset.c > --- a/src/charset.c > +++ b/src/charset.c > @@ -197,7 +197,7 @@ buf_init_chartab(buf, global) > #endif > c2 = *p++; > } > - if (c <= 0 || c >= 256 || (c2 < c && c2 != -1) || c2 >= 256 > + if (c < 0 || c >= 256 || (c2 < c && c2 != -1) || c2 >= 256 > || !(*p == NUL || *p == ',')) > return FAIL;
Well, this allows having a zero in the option value, but I very much doubt it actually works. In C the zero is used to terminate a string, thus sending a zero to the terminal just won't work. If you want to *display* control characters you need to do something else anyway, since sending a BS or other control character won't result in displaying anything. -- The greatest lies of all time: (1) The check is in the mail. (2) We have a really challenging assignment for you. (3) I love you. (4) All bugs have been fixed. (5) This won't hurt a bit. (6) Honey, I just need to debug this program and be home in 5 minutes. (7) I have just sent you an e-mail about that. (8) Of course I'll respect you in the morning. (9) I'm from the government, and I'm here to help you. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
