}
     }
 
-    if (c->config.incsearch && key != KEY_CR) {
-        gtk_text_buffer_get_bounds(buffer, &start, &end);
-        text = gtk_text_buffer_get_text(buffer, &start, &end, false);
-        if (text && (*text == '/' || *text == '?')) {
-            command_search(c, &((Arg){0, NULL})); /* stop last search */
-            command_search(c, &((Arg){*text == '/' ? 1 : -1, (char*)text + 1}));
-        }
-    }
-
     /* if the user deleted some content of the inputbox we check if the
      * inputbox is empty - if so we switch back to normal like vim does */
     if (check_empty) {
         case 'g':
             /* TODO create hints */
             break;
+        case '/': /* fall through */
+        case '?':
+            if (c->config.incsearch) {
+                command_search(c, &((Arg){0, NULL})); /* stop last search */
+                command_search(c, &((Arg){*text == '/' ? 1 : -1, (char*)text + 1}));
+            }
+            break;
     }
 }