The branch, 2.0.x, has been updated.

- Log -----------------------------------------------------------------

commit 0bcef7f8742fc6cd227d3e8733133cfe2abba7b0
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Mon Jan 21 14:49:45 2013 +0100

    Consider deleted text when inserting quote inset.
    
    This bug was reported against the ubuntu build:
      https://bugs.launchpad.net/bugs/1100046
    
    Additionally, some extra code for avoiding double undo entries has
    been removed, since this is handled by grouped undo now.

diff --git a/src/Text3.cpp b/src/Text3.cpp
index d0f8981..a889b8b 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -909,15 +909,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_NEWLINE_INSERT: {
                InsetNewlineParams inp;
                docstring arg = cmd.argument();
-               // this avoids a double undo
-               // FIXME: should not be needed, ideally
-               if (!cur.selection())
-                       cur.recordUndo();
-               cap::replaceSelection(cur);
                if (arg == "linebreak")
                        inp.kind = InsetNewlineParams::LINEBREAK;
                else
                        inp.kind = InsetNewlineParams::NEWLINE;
+               cap::replaceSelection(cur);
+               cur.recordUndo();
                cur.insert(new InsetNewline(inp));
                cur.posForward();
                moveCursor(cur, false);
@@ -1356,14 +1353,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_QUOTE_INSERT: {
-               // this avoids a double undo
-               // FIXME: should not be needed, ideally
-               if (!cur.selection())
-                       cur.recordUndo();
                cap::replaceSelection(cur);
+               cur.recordUndo();
 
                Paragraph const & par = cur.paragraph();
                pos_type pos = cur.pos();
+               // Ignore deleted text before cursor
+               while (pos > 0 && par.isDeleted(pos - 1))
+                       --pos;
 
                BufferParams const & bufparams = bv->buffer().params();
                bool const hebrew = 
diff --git a/status.20x b/status.20x
index a7074b9..abf1cc7 100644
--- a/status.20x
+++ b/status.20x
@@ -115,6 +115,8 @@ What's new
   
 - Allow arguments in PassThru environments (bug 7646).
 
+- Consider deleted text when inserting quote inset.
+
 - Fix a few selection bugs in tabular (bugs 4981, 7988).
 
 - Show the output of configure.py while the LaTeX packages are being checked

-----------------------------------------------------------------------

Summary of changes:
 src/Text3.cpp |   15 ++++++---------
 status.20x    |    2 ++
 2 files changed, 8 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to