Fix a bug, commandline -s works now as expected. Add "*y binding in

visual mode
This commit is contained in:
Julian Aron Prenner 2014-01-17 20:32:24 +01:00
parent 8b89bd7a1f
commit 88eae68987
2 changed files with 6 additions and 3 deletions

View file

@ -326,7 +326,7 @@ static int builtin_commandline(parser_t &parser, wchar_t **argv)
int opt = wgetopt_long(argc,
argv,
L"abijpctwforhI:CLS",
L"abijpctwforhI:CLSs",
long_options,
&opt_index);
if (opt == -1)
@ -477,8 +477,9 @@ static int builtin_commandline(parser_t &parser, wchar_t **argv)
if(reader_get_selection_pos(sel_start, sel_stop))
{
size_t len = std::min(sel_stop - sel_start + 1, wcslen(buffer));
wchar_t *selection = new wchar_t[len];
selection = wcsncpy(selection, current_buffer + sel_start, len);
wchar_t *selection = new wchar_t[len + 1];
selection[len] = L'\0';
selection = wcsncpy(selection, buffer + sel_start, len);
append_format(stdout_buffer, selection);
delete selection;

View file

@ -192,7 +192,9 @@ function fish_vi_key_bindings -d "vi-like key bindings for fish"
bind -M visual -k left backward-char
bind -M visual h backward-char
bind -M visual l forward-char
bind -M visual '"*y' "commandline -s | xsel -p"
bind -M visual -m default \cc end-selection force-repaint
bind -M visual -m default \e end-selection force-repaint
end