home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR36 / KEXX.ZIP / RINDENT.KML < prev    next >
Text File  |  1989-12-20  |  4KB  |  179 lines

  1. *
  2. *  Regular autoindenting support - Move the left margin with the TAB keys
  3. *
  4.  
  5. :TAB
  6. * Tab one stop forward and set left margin to resultant column
  7. 'Editv Getf Regular'; If Regular = "" Then Regular = 0
  8.  
  9. If Prefix()
  10.    Then Do
  11.       'SOS TabFieldF'
  12.       Exit
  13.    End
  14.  
  15. 'SOS Tab'
  16. If Regular
  17.    Then
  18.       'Set Margins' Cursor.4() '*'
  19.  
  20. Exit
  21.  
  22. :S-TAB
  23. * Tab one stop backward and set left margin to resultant column
  24. 'Editv Getf Regular'; If Regular = "" Then Regular = 0
  25.  
  26. If Prefix()
  27.    Then Do
  28.       'SOS TabFieldB'
  29.       Exit
  30.    End
  31.  
  32. If First()
  33.    Then
  34.       'SOS TabB'
  35.    Else Do
  36.       'SOS TabB'
  37.       If Regular
  38.          Then
  39.             'Set Margins' Cursor.4() '*'
  40.    End
  41.  
  42. Exit
  43.  
  44. :C-TAB
  45. * Move one tab stop backward and drag line (or block) contents along
  46. *  Left margin is set to final tab stop
  47. 'Editv Getf Regular'; If Regular = "" Then Regular = 0
  48.  
  49. If \Regular
  50.    Then
  51.       Exit
  52.  
  53. If First()
  54.    Then Do
  55.       * Do not drag the line back through first column
  56.       'SOS TabB'
  57.       Exit
  58.    End
  59.  
  60. 'SOS TabB'
  61. 'Set Margins' Cursor.4() '*'
  62.  
  63. If (Block()) & (Block.1() = "LINE")
  64.    Then Do
  65.       If (Block.2() = Cursor.3())
  66.          Then Do
  67.             * Shift the entire block if cursor in first block line
  68.             'SOS FirstChar'
  69.             Old = Cursor.4()
  70.             'SOS MarginL'
  71.             New = Cursor.4()
  72.             If New < Old
  73.                Then
  74.                   'Shift Left' (Old - New) 'Block'
  75.             If New > Old
  76.                Then
  77.                   'Shift Right' (New - Old) 'Block'
  78.          End
  79.          Else
  80.             'LeftAdjust'
  81.    End
  82.    Else
  83.       'LeftAdjust'
  84.  
  85. Exit
  86.  
  87. :A-TAB
  88. * Move one tab stop forward and drag line (or block) contents along
  89. *  Left margin is set to final tab stop
  90. 'Editv Getf Regular'; If Regular = "" Then Regular = 0
  91.  
  92. If \Regular
  93.    Then
  94.       Exit
  95.  
  96. 'SOS Tab'
  97. 'Set Margins' Cursor.4() '*'
  98. If (Block()) & (Block.1() = "LINE")
  99.    Then Do
  100.       If (Block.2() = Cursor.3())
  101.          Then Do
  102.             * Shift the entire block if cursor in first block line
  103.             'SOS FirstChar'
  104.             Old = Cursor.4()
  105.             'SOS MarginL'
  106.             New = Cursor.4()
  107.             If New < Old
  108.                Then
  109.                   'Shift Left' (Old - New) 'Block'
  110.             If New > Old
  111.                Then
  112.                   'Shift Right' (New - Old) 'Block'
  113.          End
  114.          Else
  115.             'LeftAdjust'
  116.    End
  117.    Else
  118.       'LeftAdjust'
  119.  
  120. Exit
  121.  
  122. :C-I
  123. * INDENT function -  sets left margin to the current cursor position
  124. 'Editv Getf Regular'; If Regular = "" Then Regular = 0
  125.  
  126. If \Regular
  127.    Then
  128.       Exit
  129.  
  130. 'Set Margins' Cursor.4() '*'
  131. Exit
  132.  
  133. :C-U
  134. * UNDENT function - undoes left margin setting and returns cursor to column 1
  135. 'Editv Getf Regular'; If Regular = "" Then Regular = 0
  136.  
  137. If \Regular
  138.    Then
  139.       Exit
  140.  
  141. 'Set Margins 1 *'
  142. 'SOS MarginL'
  143. Exit
  144.  
  145. :C-HOME
  146. * Move the current line (block) and the left margin setting to the current
  147. *  cursor position
  148. 'Editv Getf Regular'; If Regular = "" Then Regular = 0
  149.  
  150. If \Regular
  151.    Then
  152.       Exit
  153.  
  154. 'Set Margins' Cursor.4() '*'
  155.  
  156. If (Block()) & (Block.1() = "LINE")
  157.    Then Do
  158.       If (Block.2() = Cursor.3())
  159.          Then Do
  160.             * Shift the entire block if cursor in first block line
  161.             'SOS FirstChar'
  162.             Old = Cursor.4()
  163.             'SOS MarginL'
  164.             New = Cursor.4()
  165.             If New < Old
  166.                Then
  167.                   'Shift Left' (Old - New) 'Block'
  168.             If New > Old
  169.                Then
  170.                   'Shift Right' (New - Old) 'Block'
  171.          End
  172.          Else
  173.             'LeftAdjust'
  174.    End
  175.    Else
  176.       'LeftAdjust'
  177.  
  178. Exit
  179.