Author Topic: Automatic bookmark at the point of last edit  (Read 1773 times)

dpurdie

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Automatic bookmark at the point of last edit
« on: December 02, 2013, 08:34:14 AM »
I would like an automatic bookmark at the point of last edit for each file being edited and a command/button to goto that point.

Usage: edit, edit, edit.
I want to cut and past some code from a few pages up. Scroll up, cut.
Now I need to get back to my point of last edit.
If I could push a button it would be simple. At the moment I need to scroll down looking for the place that I last edited.

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
Re: Automatic bookmark at the point of last edit
« Reply #1 on: December 02, 2013, 12:22:57 PM »
I would like an automatic bookmark at the point of last edit for each file being edited and a command/button to goto that point.

Usage: edit, edit, edit.
I want to cut and past some code from a few pages up. Scroll up, cut.
Now I need to get back to my point of last edit.
If I could push a button it would be simple. At the moment I need to scroll down looking for the place that I last edited.

You could try the xretrace macro  - see the first and second posts in that thread for usage.
http://community.slickedit.com/index.php/topic,4693.msg36784.html#msg36784

However, if you have "color modified lines" enabled you might not want to enable the "track modified lines" option  because it clears the modified line flags - however, these flags can be restored.  See the comments at the start of xretrace.e for more detail.
Try the command xretrace_modified_line  - it will take you back to the last "region" where you modified something - which might be in another file.  You can't go back to the last modified place in the current buffer unless that was the last actual modification you did  - but xretrace_modified_line_steps will let you step a whole buffer at a time using alt-left and alt-right.

In the example you give - you modify something, go somewhere else and "cut" something, you've now made two modifications.  If they're within a few lines of each other (i.e. within the same region), xretrace_modified_line probably doesn't remember the first one - but otherwise, it alternates between the last two regions where you did a modification  (I think!).  Even if you don't want to track modified lines, you can still use the xretrace_cursor or xretrace_cursor_steps command to re-visit where you've been.


evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: Automatic bookmark at the point of last edit
« Reply #2 on: December 02, 2013, 07:52:55 PM »
I would like an automatic bookmark at the point of last edit for each file being edited and a command/button to goto that point.

Usage: edit, edit, edit.
I want to cut and past some code from a few pages up. Scroll up, cut.
Now I need to get back to my point of last edit.
If I could push a button it would be simple. At the moment I need to scroll down looking for the place that I last edited.

I use 'push-bookmark' all the time for that exact purpose. I'm going along, edit edit edit, when I realize I need to copy from somewhere else. I 'push-bookmark' (I have it bound to Alt+/), navigate where I want, copy what I need, and then 'pop-bookmark' (I have it bound to Alt+,) to go back to where I was.