> I suppose truncation is never useful. How about changing the NUL (0x00)
> into SOH (0x01)? SOH hardly ever appears, thus it can still be
> recognized as probably having been a NUL.
I would like to see readsystem() function in addition to system() one in order
to cope with the problem in the plugins with the output similar to readfile().
The SOH/STX pair is known to be used as a replacement for bash \[\] or zsh %{%}
in ipython (which uses readline) and thus may appear in source code. From my
point of view using raw control characters in source code is a bad idea, but I
have seen a number of developers that do not think so.
It is also the reason why I want readsystem(): while I do not use something
that writes binary data to stdout I still must handle the cases when developer
put control characters (including NUL) in his source code which I get by
reading `hg cat` or `hg diff` output. Currently I have to either use python in
this case or use something like
let tmpfile=tempname()
call system('hg cat …'.(stridx(&shellredir,
'%s')==-1?(&shellredir.tmpfile):(substitute(&shellredir, '%s', tmpfile, '')))
let r=readfile(tmpfile)
call delete(tmpfile)
(:read and :! are not an options because they do not handle newlines correctly
(correctly=without ever transforming anything like adding trailing newline when
there is no or replacing \r\n with \n)).
--
--
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/groups/opt_out.