🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10336

Re: Scroll bars for word-wrapped text?

#10336
From: Marco Papa
Date: Tue, 22 Nov 1988 03:39
29 lines
2225 bytes
In article <17332@agate.BERKELEY.EDU| mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) writes:
|I've been doing that. In fact, I had that working perfectly. Until I
|added one last feature (which was mentioned in the original article):
|
|<|The problem is the word wrapping - I don't
|<|know how many lines (or characters) will fit in the window until after
|<|I've displayed it.
|
|Given that I've got the window size in lines & characters, and I want
|to display the "end" of the text. Assume I've got four lines to
|display. One will wrap to fit perfectly on three display lines, one
|fits on one line, leaving most of the display line blank, and the last
|one needs two 1/2 lines bcause it breaks a _long_ word onto the next
|line, leaving most of the first one blank. Now, for various window
|heights (1, 2, ... 7 lines) how do I correctly determine which line to
|start the display on? Now resize horizontally to make things
|different, and repeat.

Sorry I misunderstood your problem.  This has nothing to do with the 
Amiga per se, but is a general problem that has been solved by
a variety of editor writers.    Your best bet is to have either 
Unipress Emacs or Gnu Emacs sources around and take a look at the 
algorithm they use.  Very likely there is more than one way of doing it.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <13587@oberon.USC.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!super!udel!rochester!rutgers!cmcl2!nrl-cmf!ames!mailrus!wasatch!cs.utexas.edu!sm.unisys.com!oberon!pollux.usc.edu!papa
References: <17286@agate.BERKELEY.EDU| <13556@oberon.USC.EDU| <17332@agate.BERKELEY.EDU|

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!super!udel!rochester!rutgers!cmcl2!nrl-cmf!ames!mailrus!wasatch!cs.utexas.edu!sm.unisys.com!oberon!pollux.usc.edu!papa
From: papa@pollux.usc.edu (Marco Papa)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Scroll bars for word-wrapped text?
Message-ID: <13587@oberon.USC.EDU>
Date: 22 Nov 88 03:39:00 GMT
References: <17286@agate.BERKELEY.EDU| <13556@oberon.USC.EDU| <17332@agate.BERKELEY.EDU|
Sender: news@oberon.USC.EDU
Reply-To: papa@pollux.usc.edu (Marco Papa)
Organization: Felsina Software, Los Angeles, CA
Lines: 29