implement swap-selection-start-stop function

The swap-selection-start-stop function goes to the other end of the highlighted text, the equivalent of `o' for vim visual mode.

Add binding to the swap-selection-start-stop function, `o' when in visual
mode.

Document swap-selection-start-stop, begin-selection, end-selection, kill-selection.
This commit is contained in:
Federico Ferri
2016-03-20 02:08:23 +01:00
committed by Kurtis Rader
parent 879ee61a30
commit 168a156e58
5 changed files with 23 additions and 0 deletions

View File

@@ -4026,6 +4026,17 @@ const wchar_t *reader_readline(int nchars)
break;
}
case R_SWAP_SELECTION_START_STOP:
{
if (!data->sel_active) break;
size_t tmp = data->sel_begin_pos;
data->sel_begin_pos = data->command_line.position;
data->sel_start_pos = data->command_line.position;
editable_line_t *el = data->active_edit_line();
update_buff_pos(el, tmp);
break;
}
case R_END_SELECTION:
{
data->sel_active = false;