#11079
Stefan
Participant

.

Yutaka pointed me to the right direction. Thanks Yutaka!

Stefan:
** Navigation: GoBack/GoForward in edit history is missed.

Yutaka wrote:

Back and Forward commands are already included in EmEditor.
You can display these commands as the Toolbar, and also you can
use the default shortcut keys (ALT + LEFT and ALT + RIGHT).

I have searched the help and found this:

EmEditor Home – EmEditor Help – Command Reference – Edit category > Forward command
Description: Moves the cursor to the next position.
Default Keyboard Shortcut: ALT + RIGHT

EmEditor Home – EmEditor Help – Command Reference – Edit category > Back command
Description: Moves the cursor to the previous position.
Default Keyboard Shortcut: ALT + LEFT

I don’t had this shortcuts assigned?!
I think it is because I only update
with new files but still use my old settings?

Anyway, I have now assigned shortcut keys my own and tested this feature.

So long I have found:

1) I miss a gui to preview the last line numbers and line text.

2) Also I miss a visible indicator to see the cursor after moving.

3) Next I am not sure if I like that this feature works global
for all open documents instead of the current working doc only.

For my first two points I have created a script
(based on “build-in” snippet “Clipboard History” to help my self:


//Moves the cursor to the previous position.
//Script to collect the last ten positions and provide a menu to go there.
//Based on Yutakas' snippet "Clipboard History"
// NOTE: THIS DOES NOT WORK reliable yet, I have to investigate more.
menu = CreatePopupMenu();
i = 0;
LastLinesArray = [];
do {
editor.ExecuteCommandByID(4597);//Moves cursor to prev pos.
yPos = document.selection.GetActivePointY( eePosLogical );
LastLinesArray[i] = yPos;
str = document.GetLine( yPos );
str = str.substr( 0, 40 );
menu.Add( yPos + ':t' + str, i + 100 );
i++;
} while( i < 11 );

result = menu.Track( 0 );
if( result != 0 ) {
yPos = LastLinesArray[result -100];
document.selection.SetActivePoint( eePosLogical, 1, yPos );
document.selection.WordRight( 1 ); //visible indicator only
}

But it doesn’t work 100\% correctly.

** for each call it provides other (elders?) results
** it jumps between open documents
** I don’t know how far back the history goes
and what the script will do if I call an empty entry.
** I jumps only backwards, forwards is not implemented yet in my script.

More research to do ;-)

.