717 case KEY_NPAGE: |
717 case KEY_NPAGE: |
718 g_outputScroll -= min (g_pageSize, LINES / 2); |
718 g_outputScroll -= min (g_pageSize, LINES / 2); |
719 g_needOutputRender = true; |
719 g_needOutputRender = true; |
720 break; |
720 break; |
721 |
721 |
|
722 case '\t': |
|
723 { |
|
724 int space = current_input().find (" "); |
|
725 |
|
726 if (g_inputState == INPUTSTATE_NORMAL |
|
727 and g_cursor > 0 |
|
728 and (space == -1 or space >= g_cursor)) |
|
729 { |
|
730 RCONSession::get_session()->request_tab_complete (current_input().mid (0, g_cursor)); |
|
731 } |
|
732 } |
|
733 break; |
|
734 |
722 case '\n': |
735 case '\n': |
723 case KEY_ENTER: |
736 case KEY_ENTER: |
724 switch (g_inputState) |
737 switch (g_inputState) |
725 { |
738 { |
726 case INPUTSTATE_CONFIRM_DISCONNECTION: |
739 case INPUTSTATE_CONFIRM_DISCONNECTION: |
924 if (length() % cols != 0) |
939 if (length() % cols != 0) |
925 rows++; |
940 rows++; |
926 |
941 |
927 return max (rows, 1); |
942 return max (rows, 1); |
928 } |
943 } |
|
944 |
|
945 // ------------------------------------------------------------------------------------------------- |
|
946 // |
|
947 FUNCTION |
|
948 Interface::tab_complete (const String& part, String complete) -> void |
|
949 { |
|
950 String& input = mutable_current_input(); |
|
951 |
|
952 if (input.starts_with (part)) |
|
953 { |
|
954 if (input[part.length()] != ' ') |
|
955 complete += ' '; |
|
956 |
|
957 input.replace (0, part.length(), complete); |
|
958 g_cursor = complete.length(); |
|
959 g_needInputRender = true; |
|
960 } |
|
961 } |