vi eats control-Ds in sourced files
Wayne Krone
wk at hpirs.HP.COM
Sat Apr 2 08:45:23 AEST 1988
Re, my earlier comment:
> Is this really a problem that needs fixing? Quote the ctrl-D with a
> ctrl-V and it works without the fix. The following line entered either
> interactively or via a .exrc file will accomplish the desired result:
>
> map! ^V^D foo
My apologies. I fixed HP's implementation some months ago and only
remembered how it works, not that I had modified it, when I made the
above posting.
I have a different fix from Chris because I wanted to keep the .exrc
input the same as the interactive input (i.e., to map ctrl-D from
within vi you must precede the ctrl-D with ctrl-V so I reasoned input
from the .exrc file should also have a ctrl-V preceding the ctrl-D).
Is this line of reasoning incorrect?
Alternate fix: In the routine mapcmd() in ex_cmdsub.c the following
appears twice:
if (c == CTRL(v)) {
c = getchar();
The fix is to change "getchar" to be "getcd" in both places.
Again, I apologize for my forgetfulness.
Wayne Krone
Hewlett-Packard
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list