(self, edit)
| 281 | |
| 282 | class 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 | |
| 299 | class ReplaceValueToKeyCommand(sublime_plugin.TextCommand): |
nothing calls this directly
no test coverage detected