diff options
author | Julian Aron Prenner <julian@linux4you.it> | 2014-01-18 10:18:29 +0100 |
---|---|---|
committer | Julian Aron Prenner <julian@linux4you.it> | 2014-01-18 10:18:29 +0100 |
commit | 3728fc7dba0fd0e7f381b1cb909cd197a9e5254a (patch) | |
tree | 12668dd2fb2f7660dcefea8893c2614b23139748 /builtin_commandline.cpp | |
parent | 88eae68987863fbd34b34e12219c9a8c67c61d7b (diff) |
Add kill-selection function and visual binds for 'y' and 'd'
Diffstat (limited to 'builtin_commandline.cpp')
-rw-r--r-- | builtin_commandline.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin_commandline.cpp b/builtin_commandline.cpp index ad3cf0c8..fb1c5745 100644 --- a/builtin_commandline.cpp +++ b/builtin_commandline.cpp @@ -472,14 +472,13 @@ static int builtin_commandline(parser_t &parser, wchar_t **argv) if (selection_mode) { - size_t sel_start, sel_stop; + size_t start, len; const wchar_t *buffer = reader_get_buffer(); - if(reader_get_selection_pos(sel_start, sel_stop)) + if(reader_get_selection(start, len)) { - size_t len = std::min(sel_stop - sel_start + 1, wcslen(buffer)); wchar_t *selection = new wchar_t[len + 1]; selection[len] = L'\0'; - selection = wcsncpy(selection, buffer + sel_start, len); + selection = wcsncpy(selection, buffer + start, len); append_format(stdout_buffer, selection); delete selection; |