Code:
- --- Came wiffling through the eclipsey wood ---
- /*
- * Menu: RPG > Fix D Specs
- * Kudos: Joe Pluta
- * License: EPL 1.0
- * DOM: http://download.eclipse.org/technology/das\
- h/update/org.eclipse.eclipsemonkey.lang.javascript
- */
-
- function main() {
- var editor = editors.activeEditor;
-
- // get range of lines in the selection (or at th\
- e cursor position)
- var range = editor.selectionRange;
- var startLine = editor.getLineAtOffset(range.star\
- tingOffset);
- var endLine = editor.getLineAtOffset(range.ending\
- Offset);
-
- editor.beginCompoundChange();
-
- for (var i = startLine; i <= endLine; i++) {
- var offset = editor.getOffsetAtLine(i);
- var offset2 = editor.getOffsetAtLine(i + 1);
- var length = (offset2 - offset) - 1;
- var line = editor.source.substring(offset, offse\
- t2);
- // Substring starting at zero based offset posit\
- ion 17
- // the second number is the character position a\
- fter the
- // ending character I want.
- if ( (line.substring(17,18) == "D") && (line.sub\
- string(18,19) != "*") &&
- (line.substring(51,52) == "B")) {
- editor.applyEdit(offset + 51, 1, "I");
- }
- }
- editor.endCompoundChange();
- }
- --- And burbled as it ran! ---
|
|