Commits

Anonymous committed 9b17814

Ending searching if the focus goes out of the editor

Comments (0)

Files changed (3)

   * Kill line; C-k
   * Select all; C-x h
   * Go to line
+  * Fixed places for StatusTexts
 
 
 * Enhancing auto indentation @ 1

docs/workingon.txt

 - Showing status while searching
 - Separate module for StatusBarManager
 - create_status, get_status
-
-* What if the editor goes out of focus while searching
-* Fixed places for status texts
+- What if the editor goes out of focus while searching
 
 * Extract listbox; duplicates in editor and core
     ? uihelpers module
         self.text.bind('<Any-KeyPress>', self._search_handler)
         self.text.bind('<BackSpace>', backspace, '+')
         self.text.bind('<Alt-slash>', lambda event: self._show_completion_window());
+        self.text.bind('<FocusOut>', lambda event: self._focus_went_out())
 
 
+    def _focus_went_out(self):
+        if self.searcher.is_searching():
+            self.searcher.end_searching()
+
     def _show_completion_window(self):
         result = self.code_assist.complete_code(self.get_text(), self.get_current_offset())
         toplevel = Toplevel()