From 168a156e5896fcaaf82a1b36587cde948f1765be Mon Sep 17 00:00:00 2001 From: Federico Ferri Date: Sun, 20 Mar 2016 02:08:23 +0100 Subject: 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. --- src/reader.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/reader.cpp') diff --git a/src/reader.cpp b/src/reader.cpp index a7e8ec7e..50c8c93d 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -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; -- cgit v1.2.3