Sublime Forum

Changing the focus of the Replace panel

#1

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

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

0 Likes

#2

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.

0 Likes

#3

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()”.

0 Likes

#4

It’s not presently possible to do this from the API

0 Likes