On 9/6/2004 4:03:10 PM, Ted Green wrote:
>At 03:10 PM 9/6/2004, you
>wrote:
>>NO-wrapping should be the default IMHO.
>>
>>Why not create a "WRAP" option:
>
>OK, I was thinking either a
>"NOWRAP" or a "WRAP" option.
>It is surprising complex to
>determine how best to do this.
>
>VEDIT internally has 4
>critical routines, call them
>NextLine(), PreviousLine(),
>AtBOL() and AtEOL(). First I
>tried changing them to check
>for word-wrap only in Visual
>mode and ignore word-wrap in
>Command mode.
>
>First problem was that any
>functions internally
>implemented as Command macros
>no longer worked in word-wrap.
>For example, printing no
>longer wrapped.
>
>Then I extended it to check
>for word-wrap if the macro was
>run from Visual mode. However
>this would cause macros to
>behave differently depending
>upon how they were invoked.
>
>I tried other variations, but
>in all cases the new problems
>were worse than the original
>problem.
>
>Back to NOWRAP or WRAP.
>
>Should the Line() and Type()
>commands check for word-wrap?
>I think so; they currently do.
>(And they must for internal
>macros.) Therefore, they might
>need a NOWRAP option. I don't
>want to have both WRAP and
>NOWRAP options.
>
>Since this is so complex, the
>first simple step might be to
>implement
>new "|^" and "|&" search
>patterns which check for
>word-wrap.
>
>Ted.
Since Christian pointed out the problem I include the following in my macros which may be affected:-
Config( D_DSP_WRAP, 0,LOCAL ) // Needed to capture end of long lines
If I was really serious I would save & restore D_DSP_WRAP, but this is not needed in most of my bulk macros.
This is far easier than putting a NOWRAP in all affected commands.
The most important thing is to document the behavior - including the help file.
The new search patterns could be handy, but really only of use if the macro is dependent on what is displayed on screen.
|
|