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


 - 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()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.