home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Misc / replaceSpacesWithTabs.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  624 b   |  28 lines

  1. !!Script
  2.  
  3. /**
  4. @Tool: replaceSpacesWithTabs~replaces spaces with tabs for all 
  5. indented lines. This script can be used to replace spaces 
  6. in files opened without conversion of spaces to tabs.
  7. @EndTool: 
  8. @Summary: replaceSpacesWithTabs~replaces spaces with tabs
  9. */
  10.  
  11. function DoCommand()
  12. {
  13.   var editor = getActiveEditor();
  14.   if (editor)
  15.   {
  16.     var lineCount = editor.getLineCount();
  17.     for (var i = 0; i < lineCount; i++)
  18.     {
  19.       var indentLevel = editor.getIndentLevel(i);
  20.       editor.setIndentLevel(i, indentLevel);
  21.     }
  22.     editor.setActive("Replace spaces with tabs");
  23.   }
  24. }
  25.  
  26. !!/Script
  27.  
  28.