Closed stayliv3 closed 9 years ago
@stayliv3 OK, no problem, I'll try to explain it.
Firstly, how sublime search tab opening works (I found out it experimentally):
So I decided to rename the tab to trick the Sublime.
I change tab's name to 'Find Results ' (with space as it reads the same by human but it's not the same thing for the editor) on on_activated
hook:
def on_activated(self, view):
if view.name() == DEFAULT_NAME: # DEFAULT_NAME == 'Find Results'
view.set_name(ALT_NAME) # ALT_NAME == 'Find Results '
That's how it's basically work.
Then I found out that other plugins (in my case it was BetterFindBuffer) also detected search tab by its name so I decided to set back name 'Find Results' on on_text_command
hook so the plugins can execute their text command on the correctly named tab; After that execution post_text_command
again sets it to name with a space.
I see that it's not 100% reliable but that's the best way I've figured out to do that.
thanks for your kind help.
@stayliv3 You're welcome!
everyonesdesign:
hello,i want to use the function in my own plugin, i have the same need for open a new tab for search result .I can not understand your code though it is very simple .can u explain something for me .
thanks.