From: Eric Stork
At 03:43 PM 6/25/97 -0400, Jim Sewall offered a solution for:
> If you have
>ever accidentally WrapPara'd your C program then this is for you. Many
>times my fingers do what they want and hit wrong keys and I really hate
>paragraph-wrapped programs!
>
Jim's solution looks good as far as it goes -- but one can have this problem
with _any_ file, not just with ".c", ".cpp", ".s", ".si", ".ui" files. For
that reason, since QEDIT days. I've used the following pair of macros: The
first saves my file _before_ wrapping a paragraph, and the second lets me
restore that file as it was just prior to an undesired wrap. The key
assignments are the one's I use; change to suit you.
/
/
proc mReformPara() // mapped to @Grey*
SaveFile()
WrapPara()
ScrollToRow(Query(WindowRows)/2) // MakeCtrOfScreen
end mReformPara_Plain
/
/
proc mRestoreFile() // mapped to @[
BegFile()
MarkLine()
EndFile()
MarkLine()
DelBlock()
InsertFile(CurrFilename())
UnMarkBlock()
end mRestoreFile
/
/
The below is Jim's approach, for reference:
>proc mWrapPara()
> string ext[25]
>
> ext=CurrExt()
> case (Lower(ext))
> when ".c", ".cpp", ".s", ".si", ".ui"
> return()
> endcase
>
> WrapPara()
>end
>
> mWrapPara()
>
Eric
----------
Eric Stork
e-mail address: estork@erols.com
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|