mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Fix #9083
This commit is contained in:
@@ -17,6 +17,7 @@ from typing import (
|
||||
Any,
|
||||
BinaryIO,
|
||||
NamedTuple,
|
||||
NoReturn,
|
||||
Optional,
|
||||
cast,
|
||||
)
|
||||
@@ -580,6 +581,15 @@ def get_editor(opts: Options | None = None, path_to_edit: str = '', line_number:
|
||||
return ans
|
||||
|
||||
|
||||
def edit_file(path: str = '') -> NoReturn:
|
||||
' This exists for: map whatever launch kitty +runpy "from kitty.utils import *; edit_file()" to edit kitty config '
|
||||
from .config import prepare_config_file_for_editing
|
||||
editor = get_editor()
|
||||
path = path or prepare_config_file_for_editing()
|
||||
editor.append(path)
|
||||
os.execlp(editor[0], *editor)
|
||||
|
||||
|
||||
def is_path_in_temp_dir(path: str) -> bool:
|
||||
if not path:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user