"Kayvan A. Sylvan" <[EMAIL PROTECTED]> writes:

| > 
| >    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"):

why? sent_space_message = true is going to be exectued regardless of
the branch.
 
|     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
|        }
|

        static bool send_space_message = false;
        if (!sent_space_message) {
                if (cursor.pos() == 0) {
                        bview->owner()->message(...):
                } else {
                        bview->owner()->message(...);
                }
                sent_space_message = true;
        }
 
| This horse is quickly approaching rigor mortis. ;-)

Let's kill it first.

-- 
        Lgb

Reply via email to