text: Hi, guys:In my plugin, i call the show_input_panel to show a input panel for me. in this time, i may select a word in main editor, so the panel's text would be the same as the word I selection.
  how do i do this?
  thanks.
  The input panel doesn't support updating the text dynamically, but it might be possible to hack around this a little bit.
  What you'd do is something like this:
  Show input panel with initial selection when command is run
  Set some variable indicating that you are "running" (probably class-level or module-level so that it stays after the command has been run)
  Have an event listener which reacts to on_selection_modified and calls another input panel with the new word (thus discarding the first panel). Only do this while "running" is True
  When the panel is selected or cancelled, set the "running" variable from step 2 to False
  I tried implementing this, but it's pretty nasty. It kind of works, but i would personally stay far away from it, since it violates the way people are accustomed to interacting with the input panel:
  from functools import partial
  import sublime
  from sublime_plugin import WindowCommand, EventListener
  class Running(object):
  is_running = False
  def stop_running(*args, **kwargs):
  Running.is_running = False
  def noop(*args, **kargs):
  pass
  class TestSublimeStuffCommand(WindowCommand):
  def run(self):
  Running.is_running = True
  self.window.show_input_panel('test', '1', stop_running, noop, stop_running)
  class TestEventListener(EventListener):
  def on_selection_modified(self, view):
  if Running.is_running:
  sublime.set_timeout(partial(self.update_input_panel, view, view.window()), 50)
  def update_input_panel(self, view, window):
  word = view.substr(view.sel()[0])
  if window and word:
  window.show_input_panel('test', word, stop_running, noop, stop_running)
  Note that you need to do some callbacks and stuff to make sure you manage when it's running and not, and you need to give the command enough time for the selection to change (i.e. if you double click - thats what the 50 ms are for).
  But again... Please don't use it, at least not without THOROUGH testing.
  I think you could modify the input panel dynamically. After all, window.show_input_panel returns a view. Of course, that's just speculation, haven't actually tried anything.
  Hadn't seen that. Using the returned view would make it the solution above slightly less hacky. But it'd still break user expectations about how it works, so it'd need to be well-documented.