On Mon, May 07, 2001 at 08:14:01AM -0700, Kayvan A. Sylvan wrote:
> +                     static bool sent_space_message = false;
> +                     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;
> +                     }

Why not

   static bool sent_space_message = false;
   if (!sent_space_message)
      if (cursor.pos() == 0)
         bview->owner()->message(...)
      else
         bview->owner()->message(...)
   sent_space_message = true

(and the inner if can be repalced by  '? :')

Reply via email to