Initiated by yesterdays padlines discussion in the "Converting, Translating" conference
I enhanced the original PADLINES.VDM.
The dialog features are now available also via commandline.
So Steven's request for padding to the longest line by calling Vedit via commandline
is possible this way now:
VPW -N0 -X PADLINES filename
- added: check for TAB characters and offering Detabbing if any TAB found
- added: N-option and optional -u options (see below)
- added: button: [Squeeze] to remove trailing whitespace
- fixed: Scan longest line was one character too long
- removed restriction to -N > 8 (what has that been for?)
- removed (commented out) restriction to >20 (what has that been for?)
- removed/commented out one usage of #104 in loop(what has that been for?)
So the long description now reads:
Description: Checks for TABs in the file and offers to convert them to spaces.
Prompts for the desired line length, which should be equal
to or greater than the longest line in the file. It then
adds spaces at the end of each line to pad it to the
desired length. All lines will then have the same length.
The Windows version can "Scan" the current file to
determine the longest line; the suggested value will then
pad all lines to this length.
And it can "Squeeze" the lines by removing trailing whitespace.
A warning is given if an existing line is longer than the
desired column number; you are then prompted to ignore it,
truncate the line, or to stop.
From OS: VPW -Nn [-w] -X PADLINES filename [-u [squeeze] [detab] [truncate]]
The line length 'n' is specified by the parameter -Nn.
If n=0 the file is padded to the longest line length.
The optional parameters after -u are doing the following:
squeeze: trailing whitespace is removed before the padding is done.
detab: possible existing TAB characters are converted
to spaces before the padding is done.
truncate: if there are lines longer than 'n' they are silently
truncated to 'n' characters. Otherwise there will
be a message window.
When the end of file is reached, the file is saved and
The optional parameter "-w" hides the File Selector window.