On Fri, May 04, 2001 at 09:01:54PM +1000, Allan Rae wrote:
> On 4 May 2001, Lars Gullik [iso-8859-1] Bjønnes wrote:
> 
> > Allan Rae <[EMAIL PROTECTED]> writes:
> >
> > | > Why not output the message only once per session?
> > |
> > | I already suggested that!  You can either say "I agree." or suggest
> > | something different.  Rewording an existing suggestion isn't a valid
> > | option!
> >
> > so where's the patch then?
> >
> > prttbbttr!
> 
> You want me to implement these ideas as well!?
> 

Here's the patch. Though it is obscured by the presence of an unrelated bug
that exists in the current CVS: When you type space at the beginning of a
paragraph or after another space, the message flashes across but is
immediately replaced by the message "Unknown action". 

-- 
Kayvan A. Sylvan                   | Proud husband of      | Father to my kids:
Sylvan Associates, Inc.            | Laura Isabella Sylvan | Katherine Yelena
http://www.successlinks.com/kayvan | Reach your goals now! | Robin Gregory
Index: src/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/ChangeLog,v
retrieving revision 1.157
diff -u -r1.157 ChangeLog
--- src/ChangeLog       2001/05/04 10:36:34     1.157
+++ src/ChangeLog       2001/05/04 18:55:10
@@ -1,3 +1,9 @@
+2001-05-04  Kayvan A. Sylvan  <[EMAIL PROTECTED]>
+
+       * text.C (InsertChar): Added trivial patch to only send the "you
+       can not do multiple spaces this way" message once during a
+       session.
+
 2001-05-04  Lars Gullik Bjønnes  <[EMAIL PROTECTED]>
 
        * minibuffer.C (peek_event): temporarily reduce the functionality
Index: src/text.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/text.C,v
retrieving revision 1.147
diff -u -r1.147 text.C
--- src/text.C  2001/05/03 14:31:31     1.147
+++ src/text.C  2001/05/04 18:55:10
@@ -1772,16 +1772,21 @@
 
        bool jumped_over_space = false;
    
+       static bool sent_space_message = false;
+
        if (!freeSpacing && IsLineSeparatorChar(c)) {
                if ((cursor.pos() > 0 
                     && cursor.par()->IsLineSeparator(cursor.pos() - 1))
                    || (cursor.pos() > 0
                        && cursor.par()->IsNewline(cursor.pos() - 1))
                    || (cursor.pos() == 0)) {
-                       if (cursor.pos() == 0 )
-                               bview->owner()->message(_("You cannot insert a space 
at the beginning of a paragraph.  Please read the Tutorial."));
-                       else
-                               bview->owner()->message(_("You cannot type two spaces 
this way.  Please read the Tutorial."));
+                       if (cursor.pos() == 0) {
+                               if (!sent_space_message) 
+bview->owner()->message(_("You cannot insert a space at the beginning of a paragraph. 
+ Please read the Tutorial."));
+                               sent_space_message = true;
+                       } else {
+                               if (!sent_space_message) 
+bview->owner()->message(_("You cannot type two spaces this way.  Please read the 
+Tutorial."));
+                               sent_space_message = true;
+                       }
                        charInserted();
                        return;
                }

Reply via email to