Fix caret cmds

This commit is contained in:
Florian Bruhin 2018-11-30 16:51:55 +01:00
parent a0dca95310
commit d484d9363e

View File

@ -168,24 +168,28 @@ def move_to_end_of_prev_block(tab: apitypes.Tab, count: int = 1):
@cmdutils.register(modes=[cmdutils.KeyMode.caret])
@cmdutils.argument('tab', value=cmdutils.Value.cur_tab)
def move_to_start_of_document(tab: apitypes.Tab):
"""Move the cursor or selection to the start of the document."""
tab.caret.move_to_start_of_document()
@cmdutils.register(modes=[cmdutils.KeyMode.caret])
@cmdutils.argument('tab', value=cmdutils.Value.cur_tab)
def move_to_end_of_document(tab: apitypes.Tab):
"""Move the cursor or selection to the end of the document."""
tab.caret.move_to_end_of_document()
@cmdutils.register(modes=[cmdutils.KeyMode.caret])
@cmdutils.argument('tab', value=cmdutils.Value.cur_tab)
def toggle_selection(tab: apitypes.Tab):
"""Toggle caret selection mode."""
tab.caret.toggle_selection()
@cmdutils.register(modes=[cmdutils.KeyMode.caret])
@cmdutils.argument('tab', value=cmdutils.Value.cur_tab)
def drop_selection(tab: apitypes.Tab):
"""Drop selection and keep selection mode enabled."""
tab.caret.drop_selection()