Skip to content

add home/end shortcuts to memory viewer #274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions ReClass.NET/Controls/MemoryViewControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)

return true;
}
if ((key == Keys.Down || key == Keys.Up) && selectionCaret != null && selectionAnchor != null)
if ((key == Keys.Down || key == Keys.Up || key == Keys.Home || key == Keys.End) && selectionCaret != null && selectionAnchor != null)
{
HotSpot toSelect;
bool isAtEnd;
Expand All @@ -489,7 +489,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
toSelect = temp.FirstOrDefault();
isAtEnd = toSelect != null && toSelect == temp.LastOrDefault();
}
else
else if (key == Keys.Up)
{
var temp = query
.TakeWhile(h => h.Node != selectionCaret.Node)
Expand All @@ -498,7 +498,23 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
toSelect = temp.LastOrDefault();
isAtEnd = toSelect != null && toSelect == temp.FirstOrDefault();
}
else if (key == Keys.Home)
{
var temp = query
.Skip(1) // skip top-level class node
.ToList();

toSelect = temp.FirstOrDefault();
isAtEnd = toSelect != null && toSelect == temp.FirstOrDefault();
}
else
{
var temp = query.ToList();

toSelect = temp.LastOrDefault();
isAtEnd = toSelect != null && toSelect == temp.LastOrDefault();
}

if (toSelect != null && !(toSelect.Node is ClassNode))
{
if (modifier != Keys.Shift)
Expand Down