mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-11 18:32:12 +02:00
Add pointer shape enum to kittens
This commit is contained in:
@@ -134,6 +134,11 @@ def main(args: List[str]=sys.argv) -> None:
|
||||
patch_file('glfw/cocoa_window.m', 'glfw to cocoa', '\n'.join(f' {x}' for x in glfw_cocoa_map.values()))
|
||||
patch_file('docs/pointer-shapes.rst', 'list of shape css names', '\n'.join(
|
||||
f'#. {x}' if x else '' for x in [''] + sorted(css_names) + ['']), start_marker='.. ', end_marker='')
|
||||
patch_file('tools/tui/loop/mouse.go', 'pointer shape enum', '\n'.join(
|
||||
f'\t{x} PointerShape = {i}' for i, x in enumerate(enum_to_glfw_map)), start_marker='// ', end_marker='')
|
||||
patch_file('tools/tui/loop/mouse.go', 'pointer shape tostring', '\n'.join(
|
||||
f'''\tcase {x}: return "{x.lower().rpartition('_')[0].replace('_', '-')}"''' for x in enum_to_glfw_map), start_marker='// ', end_marker='')
|
||||
|
||||
subprocess.check_call(['glfw/glfw.py'])
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import os
|
||||
import string
|
||||
import subprocess
|
||||
import sys
|
||||
from pprint import pformat
|
||||
from typing import Any, Dict, List, Union
|
||||
@@ -249,6 +250,8 @@ def patch_file(path: str, what: str, text: str, start_marker: str = '/* ', end_m
|
||||
f.seek(0)
|
||||
f.truncate(0)
|
||||
f.write(raw)
|
||||
if path.endswith('.go'):
|
||||
subprocess.check_call(['go', 'fmt', path])
|
||||
|
||||
|
||||
def serialize_dict(x: Dict[Any, Any]) -> str:
|
||||
|
||||
Reference in New Issue
Block a user