Add --window flag for native GPU window mode

This commit is contained in:
Andrew Hamilton 2026-07-27 11:18:43 +10:00
parent aeb5d36802
commit f90b0a2cd6

View file

@ -36,6 +36,7 @@ Usage:
{PROJECT_NAME} --git <file-a>
{PROJECT_NAME} -h | --help
{PROJECT_NAME} --version
--window Use a native GPU window instead of the terminal.
Example:
# {PROJECT_NAME} project.py.bak project.py
@ -401,11 +402,11 @@ def check_arguments():
if path is not None and not os.path.isfile(path):
print("File does not exist:", path)
sys.exit(1)
return arguments["<file-a>"], arguments["<file-b>"], arguments["--git"]
return arguments["<file-a>"], arguments["<file-b>"], arguments["--git"], arguments["--window"]
def main():
path_a, path_b, is_git_mode = check_arguments()
path_a, path_b, is_git_mode, use_window = check_arguments()
if path_b is None:
if is_git_mode:
editor_ = DiffEditor.from_git(path_a)
@ -414,6 +415,9 @@ def main():
editor_.load(path_a)
else:
editor_ = DiffEditor(path_a, path_b)
if use_window:
asyncio.run(fill3.textgrid_tui(PROJECT_NAME, editor_))
else:
asyncio.run(fill3.tui(PROJECT_NAME, editor_))