Find and Replace

Help
2009-09-04
2012-11-10
  • Hi,

    Great plugin for a badly missed bit of functionality...

    Anyway -- I'm trying to write a macro that selects the whole current line of a java file, replaces and double quotes ( " ) with a backslash escaped double quote ( \" ). Everything but the actual replace works.

    --If I change the find/replace to NOT only include selected text, it works. However, I only want the replace to happen for the currently selected line.

    --if I try the same macro on a file that is NOT a java file (plain text) everything works as expected. I suppose it has something to do with how the java editor in eclipse works?

    Any ideas as to what I'm doing wrong?

    Thanks

     
    • Ernest
      Ernest
      2009-09-04

      I'm not sure. The following macro definition seems to work for me in a .java file. I tried in Eclipse 3.4.2.

      <macroDefinition><![CDATA[<EditorMacros>

      <Macro id="" lastUsed="1252097088392" name="User-defined macro 1" runAsCompound="true">

      <description/>

      <Command commandID="org.eclipse.ui.edit.text.select.lineEnd" type="EclipseCommand"/>

      <Command caseSensitive="false" forward="true" matchWord="false" regexp="false" replaceAll="true" selectionScope="true" type="MacroFindCommand" wrapSearch="false">

      <searchString><![CDATA["]]]]><![CDATA[></searchString>

      <replaceString><![CDATA[\&quot;]]]]><![CDATA[></replaceString>

      </Command>

      </Macro>

      </EditorMacros>

      ]]></macroDefinition>

       


Anonymous


Cancel   Add attachments