Author Topic: Back Button Navigation Within a File  (Read 5833 times)

AmazingDisgrace

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Back Button Navigation Within a File
« on: February 05, 2008, 09:47:41 PM »
I just switched to SlickEdit from Visual Studio, and the one thing I really miss is the ability to use the Back Button to jump to the last selected line within the same file. With SlickEdit, the Back button always takes me out of my current file to the most recent one. Is there a way to make it work the way it does in VS? I've looked into writing a macro for it, but I don't know if there's any way to tell what lines have been visited within the file.

Phil Barila

  • Senior Community Member
  • Posts: 745
  • Hero Points: 61
Re: Back Button Navigation Within a File
« Reply #1 on: February 05, 2008, 09:54:27 PM »
Undo includes cursor movements, so ^Z becomes a really useful way to get back to where you were.  Of course, if you move, edit, then want to get back, undo doesn't help.

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
Re: Back Button Navigation Within a File
« Reply #2 on: February 06, 2008, 08:48:50 AM »
I just switched to SlickEdit from Visual Studio, and the one thing I really miss is the ability to use the Back Button to jump to the last selected line within the same file. With SlickEdit, the Back button always takes me out of my current file to the most recent one. Is there a way to make it work the way it does in VS? I've looked into writing a macro for it, but I don't know if there's any way to tell what lines have been visited within the file.

I don't know what you mean by "jump to last selected line" but I posted some code here
http://community.slickedit.com/index.php?topic=2222.msg9230#msg9230
thst uses a half second timer interrupt to keep a history of where I've been i.e. line# and file.  This allows me to retrace my steps and I use it a lot because I often need to go back to where I've been and don't have a pushed bookmark to get there.  The file GFilemanGoback.e has the code that records the goback history and GFileman.e has the timer interrupt that calls  GFH_maintain_line_buffer_goback_history in GFilemanGoback.  Go back history is stored on a per project basis but there's also a "global" goback.  The goback mechanism uses "chunks" with the current chunk size set to 24 lines  e.g. if the cursor is currently on line one and you press down arrow 100 times, then you get a new goback entry at line 25,49,73,97 or something (i.e. 4 or 5 entries in the goback history rather than 100).  If you want to change the "chunk size", look for the line
GFH_goback_hist_max_line_range = 24;

If you want to change the size of the goback history list, look for the lines
   GFH_goback_datasets[k].steps.max_entries = 30;
   GFH_goback_datasets[k].steps_no_dup.max_entries = 30;
and change the "30" values to something else.
If you want all the goback history saved to disk when slick closes, set def_goback_persistent_history to one (use the set-var command on the command line).

Graeme