SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: frank_lv on September 24, 2008, 05:12:13 AM

Title: Navigate Backward and Navigate Forward
Post by: frank_lv on September 24, 2008, 05:12:13 AM
I real do not know the function Navigate Backward & Navigate Forward how to work.
I feel it is jump randomness, no any rules.
I should how to use it!
Title: Re: Navigate Backward and Navigate Forward
Post by: chrisant on September 24, 2008, 05:41:45 AM
I can't find a command called "navigate-backward", and I can't find a menu command "Navigate Backward".

Can you explain what you're referring to?
Title: Re: Navigate Backward and Navigate Forward
Post by: Graeme on September 24, 2008, 12:01:21 PM
Do you mean the forward and back commands bound to the green arrows buttons on the standard toolbar.

The navigate section of the help file says they're the same as next-buffer prev-buffer but that's incorrect.

The help file info for forward says
Quote
Go to the next viewed file and cursor location like a web browser. This function is only available after using the back command.

which does seem to be correct.
So if you start slick, then visit buffers a,b,c,d,e, the forward button is still greyed out (coz you haven't used back yet), use back once and you're at buffer d, use back again and you're at c,
then
forward -> d
forward -> e
back -> d
back -> c
back -> b
Now go to buffer z using file tabs toolbar.
back -> b
forward -> z
back -> b
back -> a

just like a web browser.

Graeme
Title: Re: Navigate Backward and Navigate Forward
Post by: frank_lv on September 25, 2008, 02:31:46 PM
Yes , I mean is the forward and back commands.
I found use it is too terrible.
Does slick has an another forward and backward commands than back to cursor position last time or forward to the next cursor position. Most edit has this function as ultraedit ,sourceinsight, vc assist
Title: Re: Navigate Backward and Navigate Forward
Post by: Graeme on September 26, 2008, 12:44:28 AM
See this thread
http://community.slickedit.com/index.php?topic=2573.0 (http://community.slickedit.com/index.php?topic=2573.0)

Graeme
Title: Re: Navigate Backward and Navigate Forward
Post by: frank_lv on September 27, 2008, 01:39:17 PM
Graeme,Thanks,I read it.
It is seem discussed switch between the file buffer.
Not related to back to cursor position in one buffer or more buffers. I want to back or forward as the cursor path.
I think it is should be a base option.
Title: Re: Navigate Backward and Navigate Forward
Post by: Graeme on September 27, 2008, 11:19:51 PM
Well there's undo_cursor but it doesn't let you go backwards and forwards and it undoes text changes as well as cursor movement.

Actually I've been working on a macro to retrace the cursor path for the last few weeks.  I don't get enough time to work on it but it'll be finished one of these days, soon... 

hmm, just remembered I already posted some code that does this, sort of
http://community.slickedit.com/index.php?topic=2610.0 (http://community.slickedit.com/index.php?topic=2610.0)
but my new code is better.

Graeme
Title: Re: Navigate Backward and Navigate Forward
Post by: frank_lv on September 28, 2008, 04:29:26 PM
tks,Graeme.
Good news,so waiting for your's code.
Title: Re: Navigate Backward and Navigate Forward
Post by: tomerg on February 08, 2009, 08:58:59 AM

Anything new with this issue?
I'm trying to move from VS and this is one of them that makes it difficult.

thanks.
Title: Re: Navigate Backward and Navigate Forward
Post by: Graeme on February 08, 2009, 10:27:49 AM
I just posted some code in the macro forum here - it doesn't look like SE 14 has this feature.
http://community.slickedit.com/index.php?topic=4358.msg17914#msg17914 (http://community.slickedit.com/index.php?topic=4358.msg17914#msg17914)

Don't know if it's what you want though.  What does Visual Studio do for this?

Graeme
Title: Re: Navigate Backward and Navigate Forward
Post by: tomerg on February 08, 2009, 02:23:08 PM

you have the functionality but if I could bind
xretrace_cursor_steps->next_item/prev_item to keys, then thats it.
Title: Re: Navigate Backward and Navigate Forward
Post by: Graeme on February 08, 2009, 11:16:09 PM
Not sure I follow what you want.

Say the cursor has visited locations A B C D E F in that order.  So now if you go xretrace_cursor, the cursor goes to E.  xretrace_cursor again and the cursor goes back to F ...

If instead you go xretrace_cursor_steps, then LEFT LEFT RIGHT  -  it goes E D C D.

So suppose that the key you have bound to xretrace_cursor_steps is F1 and you press F1 F1 F1 F1  -  you want to go E D C B  - is that right?  The first F1 initiates the event loop and goes to E and the rest of the F1 keys are processed by the event loop and you have to escape out of it.  Supposing that's what you want then lets say F1 corresponds to retrace-prev   -  what would retrace-next do when you're not already in the event loop  - go to the first item in the list (A) ??  This would mean dedicating a "root level" key to retrace-next that probably doesn't get used a lot.  So to make retrace-next in the event loop allow a user selected key, I probably need to make this a configurable option, rather than use whatever key is bound to retrace-next?

Is that roughly what you want - if not, can you explain some more?

Graeme

Title: Re: Navigate Backward and Navigate Forward
Post by: tomerg on February 09, 2009, 08:39:58 AM

the use of retrace_prev is right as you described,
now lets say I retraced back to B the retrace_next will take me to C D E F for each press

Title: Re: Navigate Backward and Navigate Forward
Post by: Graeme on February 09, 2009, 09:14:02 AM
ok, it sounds like you can get what you want by changing the source code and re-compiling it

In xretrace.e, look for the function retrace_steps_event_loop2() and the following lines
         case 'C-LEFT' :
         case 'LEFT' :
         case ' ' :

If you have say, F1, bound to xretrace_cursor_steps, then add

          case 'F1' :
to the list of case options.  Similarly with
         case 'C-RIGHT' :
         case 'RIGHT' :
         case 'C- ' :

add say
       case 'S-F1' :
to the list.

If that doesn't do what you want, let me know.  I'll try and add configuration options to change the key binding without re-building the macro source sometime.

Graeme
Title: Re: Navigate Backward and Navigate Forward
Post by: tomerg on February 10, 2009, 05:18:23 PM

It should work but I see some problems trying it,
I think its related to the fact that the event loop tries to display the popup or something like that

I dont think you need to add configuration option to change the key binding
what you should do is create additional commands like
xretrace_cursor_steps_next
xretrace_cursor_steps_prev
so that the user will be able to bind the keys from the standard SE options menu
I would bind the mouse back/forward and get the VS alike feature.
Title: Re: Navigate Backward and Navigate Forward
Post by: Graeme on February 10, 2009, 08:56:57 PM
What problems do you see?  Unless you give some detail, there's nothing I can do.  I doubt if it's the popup, but you can turn the popup off if you want.

xretrace_cursor_steps_prev already exists - it's xretrace_cursor_steps  - I would just have to figure out how to find what key it's bound to, probably not hard.  What would xretrace_cursor_steps_next do when used from outside the event loop?

Graeme