The global settings has a setting called - "-editor format string-" It uses 3 "tokens" to describe how to invoke the editor in a way that starts at a specific line # :param file_to_edit: :type file_to_edit: str :param edit_format_string:
(file_to_edit, line_number, edit_format_string)
| 23403 | |
| 23404 | |
| 23405 | def _create_full_editor_command(file_to_edit, line_number, edit_format_string): |
| 23406 | """ |
| 23407 | The global settings has a setting called - "-editor format string-" |
| 23408 | It uses 3 "tokens" to describe how to invoke the editor in a way that starts at a specific line # |
| 23409 | <editor> <file> <line> |
| 23410 | |
| 23411 | :param file_to_edit: |
| 23412 | :type file_to_edit: str |
| 23413 | :param edit_format_string: |
| 23414 | :type edit_format_string: str |
| 23415 | :return: |
| 23416 | :rtype: |
| 23417 | """ |
| 23418 | |
| 23419 | command = edit_format_string |
| 23420 | command = command.replace('<editor>', '') |
| 23421 | command = command.replace('<file>', file_to_edit) |
| 23422 | command = command.replace('<line>', str(line_number) if line_number is not None else '') |
| 23423 | return command |
| 23424 | |
| 23425 | |
| 23426 | def execute_get_editor(): |