I’d like to make a Sublime Text 3 plugin that replaces some text in the current selection. To do this, I’m calling self.view.replace, which, according to the documentation, takes three arguments: replace(edit, region, string), returns None, and “replaces the contents of the region with the given string”. I’m confused about the first argument. The docs say that “edit objects are passed to TextCommands, and are not user createable” [1].
Let’s say I wanted to replace the selections with upper case versions. What can I replace “???” with below to make it work?
for r in self.view.sel():
self.view.replace(???, r, self.view.substr(r).upper())