Menu

set cursor to mark not working?

2010-10-01
2012-11-10
  • Nobody/Anonymous

    hey there,

    first, thanks for doing this. I want to do something pretty simple, I think:

    mark where the cursor is
    find some other thing and copy it to the clipboard
    come back to where I marked where the cursor was
    paste what's in the clipboard

    so I did:

    set mark
    find…
    set cursor at mark
    paste…

    but the cursor isnt returned to the marked location, it goes to the top of the
    file, a few chars in from the left

    any thoughts?

    thanks

     
  • Ernest

    Ernest - 2010-10-02

    It's been a while since I've looked at this, but I think I see what's going on
    here.

    You used the command "set mark", which is an Eclipse command. What you need to
    is use is "mark selection start" (or end) instead, which is the companion to
    "set cursor at mark". You should be able to just go in and edit the macro to
    switch the command.

    A tip for the future: it is sometimes helpful to select the checkbox: "show
    only user defined macros and macro support commands" when you have to manually
    add commands of this kind to filter out a lot of extra Eclipse commands.

    Here's one I recorded that searches for 'horizontal':
    <macrodefinition><![CDATA[<editormacros> </editormacros></macrodefinition>

    <macro id="user-content-CopyToMark" lastused="1286034343300" name="SearchAndCopy" runascompound="true"> </macro>

    <description> </description>

    <searchstring><![CDATA]]]><![CDATA[></searchstring>

    ]]>

     
  • Nobody/Anonymous

    hey, thanks for the help

    ok, so mark selection start gives me a marker wherever the cursor is, if
    nothing is selected

     
  • Ernest

    Ernest - 2010-10-03

    Yes, I believe if there is no selection, then the selection start is the same
    as the selection end, and both are the same as the cursor position.

     

Anonymous
Anonymous

Add attachments
Cancel