(self, edit)
| 298 | |
| 299 | class ReplaceValueToKeyCommand(sublime_plugin.TextCommand): |
| 300 | def run(self, edit): |
| 301 | text = get_buffer_text(self.view) |
| 302 | mapstr = get_console_text(self.view).strip('\n').replace(' => ','=>').split('\n') |
| 303 | if len(mapstr) == 0: |
| 304 | sublime.message_dialog('[error] Please select input text and input mapping strings(eg: a=>b)') |
| 305 | return |
| 306 | |
| 307 | for line in mapstr: |
| 308 | if '=>' in line: |
| 309 | key,values = line.split('=>') |
| 310 | values = values.split(',') |
| 311 | |
| 312 | for value in values: |
| 313 | if value == '': continue |
| 314 | text = text.replace(value,key) |
| 315 | |
| 316 | new_view(self.view, edit, text) |
| 317 | |
| 318 | |
| 319 | class SortAndUniqueTextCommand(sublime_plugin.TextCommand): |
nothing calls this directly
no test coverage detected