From f4b65f4e96241493241b74a73a7f4c7ada9a4a88 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 10 Jul 2007 12:20:00 +0000 Subject: [PATCH] * Text3.cpp (doDispatch): fix the behaviour of word-delete-forward, word-delete-backward and line-delete when there is a selection. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19025 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text3.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index ee6cf0af00..1b9618654a 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -79,7 +79,6 @@ using cap::cutSelection; using cap::pasteFromStack; using cap::pasteClipboard; using cap::replaceSelection; -using cap::saveSelection; using support::isStrUnsignedInt; using support::token; @@ -436,20 +435,26 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_WORD_DELETE_FORWARD: - cur.clearSelection(); - deleteWordForward(cur); + if (cur.selection()) { + cutSelection(cur, true, false); + } else + deleteWordForward(cur); finishChange(cur, false); break; case LFUN_WORD_DELETE_BACKWARD: - cur.clearSelection(); - deleteWordBackward(cur); + if (cur.selection()) { + cutSelection(cur, true, false); + } else + deleteWordBackward(cur); finishChange(cur, false); break; case LFUN_LINE_DELETE: - cur.clearSelection(); - deleteLineForward(cur); + if (cur.selection()) { + cutSelection(cur, true, false); + } else + deleteLineForward(cur); finishChange(cur, false); break;