SublimeJira icon indicating copy to clipboard operation
SublimeJira copied to clipboard

Update command from selected text

Open nexeh opened this issue 8 years ago • 0 comments

When the update command runs it selects the entire document and sends it to Jira. It would be a useful feature to also be able to make a selection in a document and have it update with just the selection. Consider the scenario of have multiple jira issues in a single document.

I just tried my theory out and it works. Maybe it could be a new command on the pallet if you want to leave the existing code

class UpdateJiraIssueCommand(sublime_plugin.TextCommand):
  def run(self, edit):

    # If the user has something selected then lets use that 
    if (len(self.view.substr(self.view.sel()[0])) == 0):
      self.view.run_command('select_all')

    text = self.view.substr(self.view.sel()[0])
    print ("text:", text)
    UpdateIssueApiCall(text, callback=self.put_result).start()

nexeh avatar Oct 08 '15 19:10 nexeh