parent
0fbbd64681
commit
195b813b73
|
@ -950,6 +950,24 @@ public:
|
||||||
move(1_line);
|
move(1_line);
|
||||||
moved = true;
|
moved = true;
|
||||||
}
|
}
|
||||||
|
else if (key == Key::Home)
|
||||||
|
{
|
||||||
|
auto& selections = context().selections();
|
||||||
|
for (auto& sel : selections)
|
||||||
|
sel.anchor() = sel.cursor() = ByteCoord{sel.cursor().line, 0};
|
||||||
|
selections.sort_and_merge_overlapping();
|
||||||
|
}
|
||||||
|
else if (key == Key::End)
|
||||||
|
{
|
||||||
|
auto& buffer = context().buffer();
|
||||||
|
auto& selections = context().selections();
|
||||||
|
for (auto& sel : selections)
|
||||||
|
{
|
||||||
|
const LineCount line = sel.cursor().line;
|
||||||
|
sel.anchor() = sel.cursor() = buffer.clamp({line, buffer[line].length()});
|
||||||
|
}
|
||||||
|
selections.sort_and_merge_overlapping();
|
||||||
|
}
|
||||||
else if (key.modifiers == Key::Modifiers::None)
|
else if (key.modifiers == Key::Modifiers::None)
|
||||||
insert(key.key);
|
insert(key.key);
|
||||||
else if (key == ctrl('r'))
|
else if (key == ctrl('r'))
|
||||||
|
|
|
@ -1481,8 +1481,10 @@ static NormalCmdDesc cmds[] =
|
||||||
{ alt('B'), "extend to prevous WORD start", repeated<select<SelectMode::Extend, select_to_previous_word<WORD>>> },
|
{ alt('B'), "extend to prevous WORD start", repeated<select<SelectMode::Extend, select_to_previous_word<WORD>>> },
|
||||||
|
|
||||||
{ alt('l'), "select to line end", repeated<select<SelectMode::Replace, select_to_eol>> },
|
{ alt('l'), "select to line end", repeated<select<SelectMode::Replace, select_to_eol>> },
|
||||||
|
{ Key::End, "select to line end", repeated<select<SelectMode::Replace, select_to_eol>> },
|
||||||
{ alt('L'), "extend to line end", repeated<select<SelectMode::Extend, select_to_eol>> },
|
{ alt('L'), "extend to line end", repeated<select<SelectMode::Extend, select_to_eol>> },
|
||||||
{ alt('h'), "select to line begin", repeated<select<SelectMode::Replace, select_to_eol_reverse>> },
|
{ alt('h'), "select to line begin", repeated<select<SelectMode::Replace, select_to_eol_reverse>> },
|
||||||
|
{ Key::Home, "select to line begin", repeated<select<SelectMode::Replace, select_to_eol_reverse>> },
|
||||||
{ alt('H'), "extend to line begin", repeated<select<SelectMode::Extend, select_to_eol_reverse>> },
|
{ alt('H'), "extend to line begin", repeated<select<SelectMode::Extend, select_to_eol_reverse>> },
|
||||||
|
|
||||||
{ 'x', "select line", repeated<select<SelectMode::Replace, select_line>> },
|
{ 'x', "select line", repeated<select<SelectMode::Replace, select_line>> },
|
||||||
|
|
Loading…
Reference in New Issue
Block a user