handle Delete key in insert mode properly

This commit is contained in:
Josh Holtrop 2017-01-15 21:38:37 -05:00
parent 62e127d400
commit 3d090b0f32

View File

@ -415,7 +415,7 @@ void BufferPane::insert_code_point(uint32_t code_point)
{
if (insert_mode())
{
if (code_point == '\b')
if (code_point == '\b') /* Backspace */
{
Buffer::Iterator i = *m_iterator;
i.go_back();
@ -424,6 +424,10 @@ void BufferPane::insert_code_point(uint32_t code_point)
m_buffer->erase_code_point(i);
}
}
else if (code_point == 127) /* Delete */
{
m_buffer->erase_code_point(*m_iterator);
}
else
{
if (code_point == '\r')