facelessuser wrote:Spent about 15 minutes doing a little research. This opens an input panel and takes a string. It then displays says hello to whatever input you give it in the status bar.
- Code: Select all
import sublime
import sublime_plugin
def display_hello(value):
sublime.active_window().active_view().set_status("hello", "Hello " + value + "!")
class HelloWorldCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.window().show_input_panel(
"Hello:",
"World",
display_hello,
None,
None
)
Thanks man! I've got it working. I may package this up and post it on announcements...but then again maybe not, its very hacky and dangerous because it uses exec()