Hi All,
I am working on a little enhancement for a plugin, here is what I am trying to do
- User invokes a command which opens a
show_quick_panelwith a list of options (1, 2, 3…) - Once the user picks an option from I pass an
idto the myon_donecallback - Inside
on_doneI am trying to update the view based on user option selection which is mostly replacing content in the view - when I try to use
editfrom thecallbackI get an error sayingedit cannot be used outside of runI assumeon_donecallback runs at a later time without access to theeditobject - Now how can I replace content I also explored looking into
run_commandwithreplace_text - I tried doing
self.view.run_command('replace_text', { "region": sublime.Region(0, 10), "text": "some super stuff" } )I got an error message sayingTypeError: Value requirednot sure what I did wrong
What is the idiomatic way to do this? ideally I would like to access the edit object inside my callback since I already have a helper method which updates the view in other places so I could use the same
Lastly I looked into edit.py which creates a reference to the view for later use? when I tried using it I see a new copy of the view and my replace still doesn’t happen
I need help 