> 
>    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  '? :')

This is just wrong. The first time through this part of the InsertChar function,
sent_space_message is set to true (regardless of whether the space message
is actually sent.

The setting of sent_space_message needs to accompany the actual sending
of the message (meaning, once for the "if" part and once for the "else"):

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

This horse is quickly approaching rigor mortis. ;-)

-- 
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

Reply via email to