]> git.lyx.org Git - features.git/commitdiff
Preserve the font when erasing a newline char.
authorDekel Tsur <dekelts@tau.ac.il>
Thu, 1 Feb 2001 21:32:14 +0000 (21:32 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Thu, 1 Feb 2001 21:32:14 +0000 (21:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1438 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text.C

index defc66ccb51a495a67e6522e939467ea2d26807c..90ebe67e58aaa79b57227430106df895e18d07c3 100644 (file)
@@ -1,5 +1,9 @@
 2001-02-01  Dekel Tsur  <dekelts@tau.ac.il>
 
+       * text.C (Backspace): Preserve the font when changing newline char
+       with a space.
+       (BreakParagraph): If the cursor is before a space, delete the space.
+
        * lyx_cb.C (QuitLyX): Do not save files when running with no gui.
 
 2001-01-31  Dekel Tsur  <dekelts@tau.ac.il>
index 002d7c7ed6b3e11f4cec04036aca492edc7aae36..8bae8d4abc0e14a9fb0276715b5d926006365b85 100644 (file)
@@ -1749,11 +1749,14 @@ void LyXText::BreakParagraph(BufferView * bview, char keep_layout)
 #endif
           ); 
 
-   // please break always behind a space
+   // Always break behind a space
+   //
+   // It is better to erase the space (Dekel)
    if (cursor.pos() < cursor.par()->Last()
        && cursor.par()->IsLineSeparator(cursor.pos()))
-     cursor.pos(cursor.pos() + 1);
-   
+          cursor.par()->Erase(cursor.pos());
+           // cursor.pos(cursor.pos() + 1);
+
    // break the paragraph
    if (keep_layout)
      keep_layout = 2;
@@ -2883,6 +2886,8 @@ void LyXText::Backspace(BufferView * bview)
                        
                        if (cursor.pos() < cursor.par()->Last() && !cursor.par()->IsSeparator(cursor.pos())) {
                                cursor.par()->InsertChar(cursor.pos(), ' ');
+                               SetCharFont(bview->buffer(), cursor.par(), 
+                                           cursor.pos(), current_font);
                                // refresh the positions
                                tmprow = row;
                                while (tmprow->next() && tmprow->next()->par() == row->par()) {