Event handler to rehighlight JSON on pressing Enter key
(self, event)
| 296 | text_widget.tag_add(tag, start_idx, end_idx) |
| 297 | |
| 298 | def rehighlight_json_on_enter(self, event): |
| 299 | """Event handler to rehighlight JSON on pressing Enter key""" |
| 300 | text_widget = event.widget |
| 301 | try: |
| 302 | json_content = text_widget.get("1.0", tk.END) |
| 303 | parsed_json = json.loads(json_content) |
| 304 | formatted_json = json.dumps(parsed_json, indent=4) |
| 305 | self.highlight_json(text_widget, formatted_json) |
| 306 | except json.JSONDecodeError: |
| 307 | pass |
| 308 | |
| 309 | def update_treeview_from_json(self, text_widget): |
| 310 | """Updates the treeview from JSON in the text widget""" |
nothing calls this directly
no test coverage detected