home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1997-1998 - Modelworks Software
-
- /**
- @Tool: slashStarComment~comments a selection
- with the Java/JavaScript multiline comment /* ... */.
- @EndTool:
- @Summary: slashStarComment~wraps a selection with a multiline comment
- */
-
- function DoCommand()
- {
- var output = getOutput()
- var editor = getActiveEditor();
- if (editor)
- {
- var range = editor.getSelection();
-
- if (range.empty()) return; //dv20000416
-
- // Clear selection
- editor.select(range.startLineIndex, range.startCharIndex,
- range.startLineIndex, range.startCharIndex);
-
- // Don't include the last line if no characters are selected on the line
- if (range.endCharIndex == 0)
- {
- range.endLineIndex -= 1;
- range.endCharIndex = 32000;
- }
-
- var endRange =
- editor.insert(range.endLineIndex, range.endCharIndex, "*/");
- var startRange =
- editor.insert(range.startLineIndex, range.startCharIndex, "/*");
-
- range.startCharIndex = startRange.startCharIndex;
- range.endCharIndex = endRange.endCharIndex;
-
- editor.select(range);
- editor.setActive();
- }
- }
-
- !!/Script
-