Home Download Buy Blog Forum Support

Changing the focus of the Replace panel

Changing the focus of the Replace panel

Postby wledoux on Fri Aug 19, 2011 10:12 am

Hi,

I would like to create a command that would open the Replace panel, and then immediately change the focus to the "Replace With" field.
I tried the code below, it opens the panel correctly, but the focus remains unchanged

Code: Select all
import sublime,sublime_plugin
class replacePanelCommand(sublime_plugin.WindowCommand):
   def run(self):
      view = self.window.active_view()
      self.window.run_command("show_panel",{"panel": "replace"})
      self.window.run_command("next_field")


Thank you for your help.
William
wledoux
 
Posts: 17
Joined: Wed Mar 23, 2011 5:29 pm

Re: Changing the focus of the Replace panel

Postby adzenith on Fri Aug 19, 2011 6:40 pm

next_field is a view command, I believe, and not a window command, which may pose a problem. Also, I think it only has to do with snippets and not with the find dialog. I think the find dialog tabbing might be hardcoded? I don't see a keybinding related to that, and if I delete the next_field keybinding I can still tab through the find dialog.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Changing the focus of the Replace panel

Postby wledoux on Tue Aug 23, 2011 7:44 am

adzenith wrote:next_field is a view command, I believe, and not a window command, which may pose a problem. Also, I think it only has to do with snippets and not with the find dialog. I think the find dialog tabbing might be hardcoded? I don't see a keybinding related to that, and if I delete the next_field keybinding I can still tab through the find dialog.

Indeed, you're right !
So nobody has an idea about how to achieve this ?
I looked into the py sources of my package repository, but could not find any reference to something getting close to "self.window.active_panel()".
wledoux
 
Posts: 17
Joined: Wed Mar 23, 2011 5:29 pm

Re: Changing the focus of the Replace panel

Postby jps on Tue Aug 23, 2011 7:52 am

It's not presently possible to do this from the API
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 23 guests