# Keyboard shortcut for moving to last edit location/cell

When you have long notebook with hundreds of cells, you sometimes need to scroll/jump manually to your last edited cell. I dind't find any shortcut for doing that. Any ideas?

-
I don't think there is any. But maybe you can construct one by scanning the CellChangeTimes of all the cells and picking out the latest one. – Silvia Mar 28 '14 at 14:11

I don't think there is any shortcut for that. But we can always construct one by scanning the CellChangeTimes of all the cells and picking out the latest one.

Here is a quick solution:

Button[
"Find me\nthe last edit!",
{#, CurrentValue[#, CellChangeTimes]} & /@
Cells[SelectedNotebook[], CellStyle -> {"Input"}] //
DeleteCases[#, {CellObject[_], {}}] & //
# /. {co_CellObject, timestamp_List} :> {co, Flatten[timestamp][[-1]]} & //
SortBy[#, Last][[-1, 1]] & //
SelectionMove[#, All, Cell] &
]


Select the generated button, and from the menu bar, select Palettes -> Generate Palette from Selection:

It should find the last edited "Input"-style cell in the current selected notebook.

Note: In order to use this solution, the notebook history tracking option should be enabled:

-
It doesn't work for me. I get an Part::partw: "Part -1 of {} does not exist" error message. This may be due to the fact that CellChangeTimes sometimes contains a list with a list of values and sometimes a list with a single value. – Sjoerd C. de Vries Mar 28 '14 at 15:04
@SjoerdC.deVries I noticed that, too. But I've Flattened the list before doing the Part :( I'm investigating. – Silvia Mar 28 '14 at 15:07
@SjoerdC.deVries It seems some Cells doesn't include a CellChangeTimes option or thay're empty as Kuba said. Will fix it soon. – Silvia Mar 28 '14 at 15:11
@SjoerdC.deVries Kuba Have fixed the code. Cells without CellChangeTimes have been abandoned before Sorting. – Silvia Mar 28 '14 at 15:34
@Silvia Since you are around, please take a look, maybe you have something new to say: mathematica.stackexchange.com/q/44588/5478 – Kuba Mar 28 '14 at 16:11