Topic: 'Smart' paragraph reformat keystroke macro (1 of 2), Read 132 times
Conf: VEDIT Macro Library
From: Deleted User
Date: Thursday, March 04, 1999 10:15 AM

This keystroke macro is what I call a "smart" paragraph reformatting
macro. Its main feature is that it figures out the current LEFT margin
of the paragraph you are reformatting, and uses it in the reformat,
thereby preserving the indentation of the paragraph. You don't have to
set the left margin yourself (Config->Preferences, etc).

The macro does NOT try to determine the current RIGHT margin setting for the paragraph. It uses whatever you currently have set. This makes it
handy for widening successive paragraphs, while preserving their
indentation levels - just set a higher number for the right margin and
keep hitting the hot key as the cursor jumps from paragraph to
paragraph.

The cursor does not have to be positioned at the beginning of a
paragraph - anywhere inside the paragraph will do.

[VISUAL EXIT]CF(W_WORD_WRAP,1)Do_Visual(/\NW\\NW\\PP\/) VM(8) Line(0)
if (Cur_Char==32){ Do_Visual(/\NW\/) VM(8) }Format_Para(Win_Hor)

 


Topic: 'Smart' paragraph reformat keystroke macro (2 of 2), Read 138 times
Conf: VEDIT Macro Library
From: Deleted User
Date: Tuesday, March 09, 1999 07:59 AM

Jay Sage sent me an email with a better version of my macro, as shown
below. It uses EOL instead of several DOV("\NW\")s to make sure it is at
the beginning of the paragraph. It also eliminates all the VM(8)
commands that I had. These were necessary at one point because of a bug
in Vedit that has since been corrected.

[VISUAL EXIT]
CF(W_WORD_WRAP,1)
EOL
Do_Visual("\PP\")
IF (Cur_Char==32){
Do_Visual("\NW\")
}
Format_Para(Cur_Col)