# HG changeset patch # User Teemu Piippo # Date 1418672194 -7200 # Node ID 693d7751fff01dec95b83c3195ebd9d0cb6ee4fb # Parent 0bc07f54f522515c49932e58da410452079bc0be - added readline alt-d and ^w support (delete till word boundaries) diff -r 0bc07f54f522 -r 693d7751fff0 sources/interface.cpp --- a/sources/interface.cpp Mon Dec 15 21:28:24 2014 +0200 +++ b/sources/interface.cpp Mon Dec 15 21:36:34 2014 +0200 @@ -773,6 +773,19 @@ } break; + case 'W' - 'A' + 1: // readline ^W - delete from previous word bounary to current + { + int start = interface_find_previous_word(); + + if (start != g_cursor) + { + mutable_current_input().remove (start, g_cursor - start); + g_cursor = start; + g_needInputRender = true; + } + } + break; + case '\n': case KEY_ENTER: switch (g_inputState) @@ -843,6 +856,13 @@ g_cursor = interface_find_next_word(); g_needInputRender = true; break; + + case 'd': + case 'D': + // readline alt-d - delete from here till next word boundary + mutable_current_input().remove (g_cursor, interface_find_next_word() - g_cursor); + g_needInputRender = true; + break; } } else