771 input.remove (g_cursor, input.length() - g_cursor); |
771 input.remove (g_cursor, input.length() - g_cursor); |
772 g_needInputRender = true; |
772 g_needInputRender = true; |
773 } |
773 } |
774 break; |
774 break; |
775 |
775 |
|
776 case 'W' - 'A' + 1: // readline ^W - delete from previous word bounary to current |
|
777 { |
|
778 int start = interface_find_previous_word(); |
|
779 |
|
780 if (start != g_cursor) |
|
781 { |
|
782 mutable_current_input().remove (start, g_cursor - start); |
|
783 g_cursor = start; |
|
784 g_needInputRender = true; |
|
785 } |
|
786 } |
|
787 break; |
|
788 |
776 case '\n': |
789 case '\n': |
777 case KEY_ENTER: |
790 case KEY_ENTER: |
778 switch (g_inputState) |
791 switch (g_inputState) |
779 { |
792 { |
780 case INPUTSTATE_CONFIRM_DISCONNECTION: |
793 case INPUTSTATE_CONFIRM_DISCONNECTION: |
841 case 'F': |
854 case 'F': |
842 // readline alt-f - move one word to the right |
855 // readline alt-f - move one word to the right |
843 g_cursor = interface_find_next_word(); |
856 g_cursor = interface_find_next_word(); |
844 g_needInputRender = true; |
857 g_needInputRender = true; |
845 break; |
858 break; |
|
859 |
|
860 case 'd': |
|
861 case 'D': |
|
862 // readline alt-d - delete from here till next word boundary |
|
863 mutable_current_input().remove (g_cursor, interface_find_next_word() - g_cursor); |
|
864 g_needInputRender = true; |
|
865 break; |
846 } |
866 } |
847 } |
867 } |
848 else |
868 else |
849 { |
869 { |
850 // No alt-key, handle pure escape |
870 // No alt-key, handle pure escape |