home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
utilities
/
editors
/
ced-programs
/
leftshift.ced
< prev
next >
Wrap
Text File
|
1994-06-23
|
1KB
|
66 lines
/*
* LeftShift.ced
*
* Shift the current block to the left, according to tabsize setting.
*
* Author: Stefan Winterstein (winter@cs.uni-sb.de)
* Status: Public Domain
*
*/
LF = '0A'X
TAB = '09'X
options results /* Allow CygnusEd to pass status variables */
address 'rexx_ced' /* Tell ARexx to talk to CygnusEd */
status 8
tabsize = result
if (tabsize < 1) & (tabsize > 10) then do
okay1 "Cannot shift with that Tab size."
exit
end
status 47 /* get current line number */
start = result
status 69 /* get start of block */
end = result
if end = -1 then do /* No block marked */
end = start+1 /* then work on current line */
end
if start > end then do /* swap start with end */
t = start
start = end
end = t
end
'jump to line' start+1 /* goto start of block */
'beg of line'
do line = start while line < end
'beg of line'
'delete'
status 65
character = result
if (character = ' ') then do
do for tabsize-1
'delete'
end
'down'
end
else
if (character ~= TAB) then do
'undo'
if (character ~= LF) then 'down'
end
else 'down'
end
'beg of line'
exit