diff --git a/doc/pages/keys.asciidoc b/doc/pages/keys.asciidoc index f55b58428..7f66d3d50 100644 --- a/doc/pages/keys.asciidoc +++ b/doc/pages/keys.asciidoc @@ -679,40 +679,40 @@ The following keys are recognized by this mode to help with editing (See <*:: abandon without -**, **:: +**, **:: move cursor to previous character -**, **:: +**, **:: move cursor to next character -**:: +**, **:: move cursor to first character -**:: +**, *:: move cursor past the last character -**, **:: +**, **:: erase character before cursor -**, **:: +**, **:: erase character under cursor -**:: +**:: advance to next word begin -**:: +**:: advance to next WORD begin -**:: +**:: go back to previous word begin -**:: +**:: go back to previous WORD begin -**:: +**:: advance to next word end -**:: +**:: advance to next word end **, **:: diff --git a/src/input_handler.cc b/src/input_handler.cc index 260dbf308..df63933c8 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -437,21 +437,21 @@ public: void handle_key(Key key) { - if (key == Key::Left or key == alt('h')) + if (key == Key::Left or key == ctrl('b')) { if (m_cursor_pos > 0) --m_cursor_pos; } - else if (key == Key::Right or key == alt('l')) + else if (key == Key::Right or key == ctrl('f')) { if (m_cursor_pos < m_line.char_length()) ++m_cursor_pos; } - else if (key == Key::Home) + else if (key == Key::Home or key == ctrl('a')) m_cursor_pos = 0; - else if (key == Key::End) + else if (key == Key::End or key == ctrl('e')) m_cursor_pos = m_line.char_length(); - else if (key == Key::Backspace or key == alt('x')) + else if (key == Key::Backspace or key == ctrl('h')) { if (m_cursor_pos != 0) { @@ -461,23 +461,23 @@ public: --m_cursor_pos; } } - else if (key == Key::Delete or key == alt('d')) + else if (key == Key::Delete or key == ctrl('d')) { if (m_cursor_pos != m_line.char_length()) m_line = m_line.substr(0, m_cursor_pos) + m_line.substr(m_cursor_pos+1); } - else if (key == ctrl('w')) + else if (key == alt('f')) to_next_word_begin(m_cursor_pos, m_line); - else if (key == ctrl(alt('w'))) + else if (key == alt('W')) to_next_word_begin(m_cursor_pos, m_line); - else if (key == ctrl('b')) + else if (key == alt('b')) to_prev_word_begin(m_cursor_pos, m_line); - else if (key == ctrl(alt('b'))) + else if (key == alt('B')) to_prev_word_begin(m_cursor_pos, m_line); - else if (key == ctrl('e')) + else if (key == alt('e')) to_next_word_end(m_cursor_pos, m_line); - else if (key == ctrl(alt('e'))) + else if (key == alt('E')) to_next_word_end(m_cursor_pos, m_line); else if (key == ctrl('k')) m_line = m_line.substr(0_char, m_cursor_pos).str();