MCPcopy Index your code
hub / github.com/chasingboy/Xtools / run

Method run

xtools.py:283–296  ·  view source on GitHub ↗
(self, edit)

Source from the content-addressed store, hash-verified

281
282class ReplaceKeyToValueCommand(sublime_plugin.TextCommand):
283 def run(self, edit):
284 text = get_buffer_text(self.view)
285 mapstr = get_console_text(self.view).strip('\n').replace(' => ','=>').split('\n')
286 if len(mapstr) == 0:
287 sublime.message_dialog('[error] Please select input text and input mapping strings(eg: a=>b)')
288 return
289
290 for line in mapstr:
291 if '=>' in line:
292 key, value = line.split('=>')
293 if key == '': continue
294 text = text.replace(key,value)
295
296 new_view(self.view, edit, text)
297
298
299class ReplaceValueToKeyCommand(sublime_plugin.TextCommand):

Callers

nothing calls this directly

Calls 3

get_buffer_textFunction · 0.85
get_console_textFunction · 0.85
new_viewFunction · 0.85

Tested by

no test coverage detected