(instance: PythonScriptingInstance, old_value: Any, new_value: Any)
| 1384 | |
| 1385 | |
| 1386 | def _set_current_comment(instance: PythonScriptingInstance, old_value: Any, new_value: Any): |
| 1387 | if instance.interpreter.active_view is None: |
| 1388 | return |
| 1389 | |
| 1390 | if instance.interpreter.active_func is None: |
| 1391 | instance.interpreter.active_view.set_comment_at(instance.interpreter.active_addr, new_value) |
| 1392 | else: |
| 1393 | if instance.interpreter.active_view.get_comment_at(instance.interpreter.active_addr) != '': |
| 1394 | # Prefer editing active view comment if one exists |
| 1395 | instance.interpreter.active_view.set_comment_at(instance.interpreter.active_addr, new_value) |
| 1396 | else: |
| 1397 | instance.interpreter.active_func.set_comment_at(instance.interpreter.active_addr, new_value) |
| 1398 | |
| 1399 | |
| 1400 | PythonScriptingProvider.register_magic_variable( |
nothing calls this directly
no test coverage detected