From 5f190ceac96600203464e000cf5fbfb490950997 Mon Sep 17 00:00:00 2001 From: Vincent Vermeulen Date: Fri, 9 Mar 2018 16:45:25 +0100 Subject: [PATCH] Highlight previous search so typing overwrites it (#191) * Highlight previous search so typing overwrites it When set to remember the last search, on next opening the menu it would display the last search and put the cursor at the end of it. If you wanted to do a new search you would first have to delete your previous search. More convenient if you starting typing it overwrites the last search and only if you place the cursor with arrow keys or mouse it switches to insert / append text to the last search. There was existing code that did in fact do that but it was in the wrong place. This patch puts it in the right place. Fixes #86. * Remove code to set position at end Because it doesn't do anything when you select all the text. --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 79678bd..c6f588c 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -504,7 +504,6 @@ class pluginclass( object ): else: self.changeTab( 1 ) - self.searchEntry.select_region( 0, -1 ) if self.rememberFilter and self.searchEntry.get_text().strip() != "": self.Filter(self.activeFilter[2], self.activeFilter[1]) @@ -546,7 +545,7 @@ class pluginclass( object ): # of the existing text, that's the most likely candidate anyhow self.searchEntry.grab_focus() if self.rememberFilter or not clear: - self.searchEntry.set_position(-1) + self.searchEntry.select_region( 0, -1 ) else: self.searchEntry.set_text("")