MCPcopy
hub / github.com/facelessuser/BracketHighlighter / run_command

Method run_command

bh_plugin.py:171–199  ·  view source on GitHub ↗

Load arguments into plugin and run.

(self, view, name, left, right, selection)

Source from the content-addressed store, hash-verified

169 return self.enabled
170
171 def run_command(self, view, name, left, right, selection):
172 """Load arguments into plugin and run."""
173
174 nobracket = False
175 refresh_match = False
176 Payload.status = False
177 Payload.plugin = self.plugin()
178 setattr(Payload.plugin, "left", left)
179 setattr(Payload.plugin, "right", right)
180 setattr(Payload.plugin, "view", view)
181 setattr(Payload.plugin, "selection", selection)
182 setattr(Payload.plugin, "nobracket", False)
183 setattr(Payload.plugin, "refresh_match", False)
184 self.args["edit"] = None
185 self.args["name"] = name
186 Payload.args = self.args
187
188 # Call a `TextCommand` to run the plugin so it can feed in the `Edit` object
189 view.run_command("bracket_plugin_run")
190
191 if Payload.status:
192 left = Payload.plugin.left
193 right = Payload.plugin.right
194 selection = Payload.plugin.selection
195 nobracket = Payload.plugin.nobracket
196 refresh_match = Payload.plugin.refresh_match
197 Payload.clear()
198
199 return left, right, selection, nobracket, refresh_match
200
201
202class BracketPluginCommand(object):

Callers 10

swap_bracketsMethod · 0.80
wrap_bracketsMethod · 0.80
on_navigate_unmatchedMethod · 0.80
showMethod · 0.80
remove_bracketsMethod · 0.80
on_navigateMethod · 0.80
runMethod · 0.80
runMethod · 0.80
run_pluginMethod · 0.80
runMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected