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;
Mit freundlichen Grüßen
Christian
--
Ich erziehe Kinder nicht zu etwas, sondern in etwas.
-- Jean Paul
--
--
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.