diff --git a/src/input.cpp b/src/input.cpp index 45f0df8..4f0d436 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -92,6 +92,19 @@ string get_line_with_hist(vector history, int line_num) { if (input_index < (int)input.size()) cout << "\033[" << input.size() - input_index << "D"; } + break; + } case 'H': { //* Begin + if (input_index > 0) { + cout << "\033[" << input_index << "D"; // Go left input_index + input_index = 0; + } + break; + } case 'F': { //* End + if (input_index < (int)input.size()) { + cout << "\033[" << (input.size() - input_index) << "C"; // Go right input.size() - input_index + input_index = input.size(); + } + break; } } } else if (ch == '\b' || ch == 127) { //* Backspace