diff --git a/src/input_handler.cc b/src/input_handler.cc index f12a8854..bf363d69 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -138,7 +138,7 @@ public: --m_cursor_pos; } } - else if (key == Key::Erase) + else if (key == Key::Delete) { if (m_cursor_pos != m_line.char_length()) m_line = m_line.substr(0, m_cursor_pos) @@ -675,7 +675,7 @@ public: buffer.erase(utf8::previous(pos), pos); } } - else if (key == Key::Erase) + else if (key == Key::Delete) { for (auto& sel : context().selections()) { diff --git a/src/keys.cc b/src/keys.cc index f21f93ec..2caef9a7 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -34,6 +34,7 @@ static const KeyAndName keynamemap[] = { { "home", Key::Home }, { "end", Key::End }, { "backtab", Key::BackTab }, + { "del", Key::Delete }, }; KeyList parse_keys(StringView str) diff --git a/src/keys.hh b/src/keys.hh index d64cee2e..262603d8 100644 --- a/src/keys.hh +++ b/src/keys.hh @@ -22,7 +22,7 @@ struct Key { // use UTF-16 surrogate pairs range Backspace = 0xD800, - Erase, + Delete, Escape, Up, Down, diff --git a/src/ncurses.cc b/src/ncurses.cc index f48ef7ee..67f73951 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -359,7 +359,7 @@ Key NCursesUI::get_key() else switch (c) { case KEY_BACKSPACE: case 127: return Key::Backspace; - case KEY_DC: return Key::Erase; + case KEY_DC: return Key::Delete; case KEY_UP: return Key::Up; case KEY_DOWN: return Key::Down; case KEY_LEFT: return Key::Left;