Path: utzoo!attcan!uunet!mcsun!ukc!sys.uea!jrk From: jrk@sys.uea.ac.uk (Richard Kennaway) Newsgroups: comp.sys.mac.programmer Subject: Re: Need Help! Tabs 'n TextEdit Message-ID: <1023@sys.uea.ac.uk> Date: 3 Dec 89 13:38:48 GMT References: <1989Nov30.044549.24362@ug.cs.dal.ca> Reply-To: jrk@uea-sys.UUCP (Richard Kennaway) Organization: University of East Anglia, Norwich Lines: 34 In article <1989Nov30.044549.24362@ug.cs.dal.ca> johnston@ug.cs.dal.ca (Bruce Johnston) writes: >I realize that Inside Mac explicitly states that TextEdit does not support the >use of tabs. (at least IM I does) Anyway I would really like implement some >sort of tab system. It wouldn't have to be very complicated.... a fixed length >tab would be fine. > >Has anyone had any experience in doing this or any ideas. I thought about >checking for a tab before I go into TEKey and if I find a tab then I would >change the call into a specified number of spaces by repeatedly calling TEKey >with a space value. That's exactly how I did tabs in a little TextEdit-based editor I have, originally based on one of the TransSkel demos. The users seem to like it. >But this would be a real, and I mean REAL, ugly hack and Ugly? It avoids assembler and patches - good enough for me :-). >it wouldn't help with back tabbing. So anybody got any neat ideas? For back tabbing, I defined option-backspace to delete spaces back to the last tab stop (mutatis mutandis when there isnt a run of spaces back to the last tab stop). Remember to handle not just tab keystrokes, but every other way of inserting tabs, e.g. pasting, reading a file, search/replace, undo. Of course, the real answer is for someone to reimplement TextEdit to handle tabs, large buffers, and low memory, and make it public domain. Any takers? (Don't ask me, I'm just a hobbyist.) -- Richard Kennaway SYS, University of East Anglia, Norwich, U.K. Internet: kennaway@sys.uea.ac.uk uucp: ...mcvax!ukc!uea-sys!jrk