Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site elsie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!teddy!panda!talcott!harvard!seismo!umcp-cs!cvl!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: net.bugs.4bsd Subject: 4.?bsd vi insert bug on long lines with tabs on smart terminals (w/fix) Message-ID: <5013@elsie.UUCP> Date: Mon, 21-Jan-85 13:19:23 EST Article-I.D.: elsie.5013 Posted: Mon Jan 21 13:19:23 1985 Date-Received: Wed, 23-Jan-85 06:08:59 EST Organization: NIH-LEC, Bethesda, MD Lines: 28 Index: cmd/ex/ex_vput.c Description: When using "vi" to edit a file with long lines containing tabs, characters may disappear if you insert characters and are using a terminal that has "insert mode". Repeat-By: Creating a file with a single line that has 71 'a's, a tab character, and four 'b's. Then use "vi" on the file. Position the cursor on the tab character (by, for example, tapping the 'f' key and then the tab key). Then tap the 'i' key to go into insert mode, and tap the 'c' to insert a 'c'. Now ask yourself: "Where did those 'b's go?" Fix: ed ex_vput.c /^vishft/;/(tabend + shft) \/ WCOLS/c #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 . w q -- ..decvax!seismo!elsie!ado (country code 1)(301) 496-5688 DEC, VAX and Elsie are Digital Equipment and Borden trademarks