mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Fix #9083
This commit is contained in:
@@ -17,6 +17,7 @@ from typing import (
|
|||||||
Any,
|
Any,
|
||||||
BinaryIO,
|
BinaryIO,
|
||||||
NamedTuple,
|
NamedTuple,
|
||||||
|
NoReturn,
|
||||||
Optional,
|
Optional,
|
||||||
cast,
|
cast,
|
||||||
)
|
)
|
||||||
@@ -580,6 +581,15 @@ def get_editor(opts: Options | None = None, path_to_edit: str = '', line_number:
|
|||||||
return ans
|
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:
|
def is_path_in_temp_dir(path: str) -> bool:
|
||||||
if not path:
|
if not path:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user