diff --git a/src/plugins/fakevim/fakevim_test.cpp b/src/plugins/fakevim/fakevim_test.cpp index 75878432464c16ae5fcf2eff8f0c52826444a7d0..1e9019055b300fc254d9845724b99d6b12fad1fe 100644 --- a/src/plugins/fakevim/fakevim_test.cpp +++ b/src/plugins/fakevim/fakevim_test.cpp @@ -536,6 +536,14 @@ void FakeVimPlugin::test_vim_insert() KEYS("2iX<delete>Y<esc>", "XYX" X "Yc" N "def"); KEYS("0j.", "XYXYc" N "XYX" X "Yf"); + data.setText("abc" N "def"); + KEYS("i<delete>XY", "XY" X "bc" N "def"); + KEYS("0j.", "XYbc" N "X" X "Yef"); + + data.setText("ab" X "c" N "def"); + KEYS("i<bs>XY", "aXY" X "c" N "def"); + KEYS("j.", "aXYc" N "dX" X "Yf"); + // insert in visual block mode data.setText("abc" N "d" X "ef" N "jkl" N "mno" N "pqr"); KEYS("<c-v>2j" "2I" "XYZ<esc>", "abc" N "d" X "XYZXYZef" N "jXYZXYZkl" N "mXYZXYZno" N "pqr"); diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index bb4ce54319ec40f8c4f65bc143d11893c08eec03..30b75efab829cd947de527daf73a165d5c1f2a51 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -4253,9 +4253,10 @@ EventResult FakeVimHandler::Private::handleInsertMode(const Input &input) insert = _("<BS>"); endEditBlock(); } else if (input.isKey(Key_Delete)) { - setAnchor(); + joinPreviousEditBlock(); cursor().deleteChar(); insert = _("<DELETE>"); + endEditBlock(); } else if (input.isKey(Key_PageDown) || input.isControl('f')) { removeAutomaticIndentation(); moveDown(count() * (linesOnScreen() - 2));