vi, long lines, tabs, and terminals with insert (corrected reposting)
Arthur David Olson
ado at elsie.UUCP
Wed Jul 17 06:41:55 AEST 1985
Index: ucb/ex/ex_vput.c
Description:
Insertions into long lines with tabs can get botched on terminals with
insert mode.
Repeat-By:
Get on a terminal that supports ANSI-style insert mode (a CIT-101e,
for example). Create a file with 79 'x' characters, a tab character,
and a 'y' character. Start up vi on the file; position the cursor on
the tab; tap the 'i' key to go into insert mode; insert eight 'z'
characters; ask yourself "Where did the 'y' go?"
Fix:
The trade secret status of the code involved prevents a clearer posting.
This is almost surely not the best fix. It's to the function "vishft"
in "ex_vput.c". First, a previously reported change:
.
.
.
#ifdef OLDVERSION
for (j = DEPTH(vcline) - 1; j > (tabend + shft) / WCOLS; j--) {
#else
for (j = DEPTH(vcline) - 1; j > (tabend+shft-1) / WCOLS; j--) {
#endif
.
.
.
And second, a "new" change:
.
.
.
#ifdef OLDVERSION
vigotoCL(tabstart);
i = shft - (inssiz - doomed);
#else
if ((tabstart / WCOLS) == (tabend / WCOLS)) {
vigotoCL(tabstart);
i = shft - (inssiz - doomed);
} else {
vigotoCL(tabend);
i = shft;
}
#endif
.
.
.
--
Bugs is a Warner Brothers trademark.
--
UUCP: ..decvax!seismo!elsie!ado ARPA: elsie!ado at seismo.ARPA
DEC, VAX and Elsie are Digital Equipment and Borden trademarks
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list