Add <c-s> for saving current selection in the jump list
This commit is contained in:
parent
307fc228d2
commit
6331fb5a61
|
@ -173,6 +173,17 @@ view.
|
||||||
* _vk_: scroll the window count line upward
|
* _vk_: scroll the window count line upward
|
||||||
* _vl_: scroll the window count columns right
|
* _vl_: scroll the window count columns right
|
||||||
|
|
||||||
|
Jump list
|
||||||
|
---------
|
||||||
|
|
||||||
|
Some commands, like the goto commands, buffer switch or search commands,
|
||||||
|
push the previous selections to the client's jump list. It is possible
|
||||||
|
to forward or backward in the jump list using:
|
||||||
|
|
||||||
|
* _control-i_: Jump forward
|
||||||
|
* _control-o_: Jump backward
|
||||||
|
* _control-s_: save current selections
|
||||||
|
|
||||||
Multi Selection
|
Multi Selection
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,12 @@ const DynamicSelectionList& Context::jump_forward()
|
||||||
|
|
||||||
const DynamicSelectionList& Context::jump_backward()
|
const DynamicSelectionList& Context::jump_backward()
|
||||||
{
|
{
|
||||||
|
if (m_current_jump != m_jump_list.end() and
|
||||||
|
*m_current_jump != editor().selections())
|
||||||
|
{
|
||||||
|
push_jump();
|
||||||
|
return *--m_current_jump;
|
||||||
|
}
|
||||||
if (m_current_jump != m_jump_list.begin())
|
if (m_current_jump != m_jump_list.begin())
|
||||||
{
|
{
|
||||||
if (m_current_jump == m_jump_list.end())
|
if (m_current_jump == m_jump_list.end())
|
||||||
|
|
|
@ -746,6 +746,13 @@ void jump(Context& context)
|
||||||
context.editor().select(SelectionList{ jump });
|
context.editor().select(SelectionList{ jump });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void save_selections(Context& context)
|
||||||
|
{
|
||||||
|
context.push_jump();
|
||||||
|
context.print_status({ "saved " + to_string(context.editor().selections().size()) +
|
||||||
|
" selections", get_color("Information") });
|
||||||
|
}
|
||||||
|
|
||||||
template<bool insert_at_begin>
|
template<bool insert_at_begin>
|
||||||
void align(Context& context)
|
void align(Context& context)
|
||||||
{
|
{
|
||||||
|
@ -941,6 +948,7 @@ KeyMap keymap =
|
||||||
|
|
||||||
{ { Key::Modifiers::Control, 'i' }, jump<Forward> },
|
{ { Key::Modifiers::Control, 'i' }, jump<Forward> },
|
||||||
{ { Key::Modifiers::Control, 'o' }, jump<Backward> },
|
{ { Key::Modifiers::Control, 'o' }, jump<Backward> },
|
||||||
|
{ { Key::Modifiers::Control, 's' }, save_selections },
|
||||||
|
|
||||||
{ { Key::Modifiers::Alt, 'r' }, rotate_selections },
|
{ { Key::Modifiers::Alt, 'r' }, rotate_selections },
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user