]> git.lyx.org Git - lyx.git/blobdiff - src/minibuffer.C
improved comments in removeAutoInsets()
[lyx.git] / src / minibuffer.C
index 7583a803eb74f571964c36ff84fab08e1208e82b..7df08768eb12a69c3e495282c5bdf19e6bf79c9d 100644 (file)
@@ -100,6 +100,9 @@ void MiniBuffer::stored_set(string const & str)
 int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
 {
        switch (event) {
+       case FL_UNFOCUS:
+               deactivate();
+               break;
        case FL_KEYBOARD:
        {
                char const * tmp = fl_get_input(ob);
@@ -215,7 +218,9 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
                                // Return the inputted string
                                deactivate();
                                owner_->view()->focus(true);
-                               history_->push_back(input);
+                               if (!input.empty()) {
+                                       history_->push_back(input);
+                               }
                                stringReady.emit(input);
 # if 0
                        }
@@ -381,8 +386,11 @@ void MiniBuffer::redraw()
 
 void MiniBuffer::set_complete_input(string const & str)
 {
-       if (!str.empty())
-               set_input(str);
+       if (!str.empty()) {
+               // add a space so the user can type
+               // an argument immediately
+               set_input(str + " ");
+       }
 }