From 948d2e6e9c1bfad6a5357ef2adba5e1956417826 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Aug 2025 16:12:28 +0530 Subject: [PATCH] Spelling --- kitty/boss.py | 6 +++--- kitty/shaders.c | 2 +- kitty/utils.py | 2 +- kitty/window.py | 4 ++-- kitty_tests/datatypes.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kitty/boss.py b/kitty/boss.py index ab91614ac..4d32fe0ff 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -144,7 +144,7 @@ from .utils import ( parse_uri_list, platform_window_id, safe_print, - sanitize_url_for_dispay_to_user, + sanitize_url_for_display_to_user, shlex_split, startup_notification_handler, timed_debug_print, @@ -3160,8 +3160,8 @@ class Boss: pass mouse_discard_event = discard_event - def sanitize_url_for_dispay_to_user(self, url: str) -> str: - return sanitize_url_for_dispay_to_user(url) + def sanitize_url_for_display_to_user(self, url: str) -> str: + return sanitize_url_for_display_to_user(url) def on_system_color_scheme_change(self, appearance: ColorSchemes, is_initial_value: bool) -> None: theme_colors.on_system_color_scheme_change(appearance, is_initial_value) diff --git a/kitty/shaders.c b/kitty/shaders.c index 6b966e68c..91a4b5b5e 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -961,7 +961,7 @@ draw_hyperlink_target(OSWindow *os_window, Screen *screen, const CellRenderData Py_CLEAR(bd->last_drawn_title_object_id); const char *url = get_hyperlink_for_id(screen->hyperlink_pool, bd->hyperlink_id_for_title_object, true); if (url == NULL) url = ""; - bd->last_drawn_title_object_id = PyObject_CallMethod(global_state.boss, "sanitize_url_for_dispay_to_user", "s", url); + bd->last_drawn_title_object_id = PyObject_CallMethod(global_state.boss, "sanitize_url_for_display_to_user", "s", url); if (bd->last_drawn_title_object_id == NULL) { PyErr_Print(); return; } bd->needs_render = true; } diff --git a/kitty/utils.py b/kitty/utils.py index e8a32481a..8836ddc76 100644 --- a/kitty/utils.py +++ b/kitty/utils.py @@ -1021,7 +1021,7 @@ def sanitize_for_bracketed_paste(text: bytes) -> bytes: @lru_cache(maxsize=64) -def sanitize_url_for_dispay_to_user(url: str) -> str: +def sanitize_url_for_display_to_user(url: str) -> str: from urllib.parse import unquote, urlparse, urlunparse try: purl = urlparse(url) diff --git a/kitty/window.py b/kitty/window.py index 2a6297bcf..aa4434620 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -108,7 +108,7 @@ from .utils import ( sanitize_control_codes, sanitize_for_bracketed_paste, sanitize_title, - sanitize_url_for_dispay_to_user, + sanitize_url_for_display_to_user, shlex_split, ) @@ -1196,7 +1196,7 @@ class Window: if opts.allow_hyperlinks & 0b10: from kittens.tui.operations import styled boss.choose( - 'What would you like to do with this URL:\n' + styled(sanitize_url_for_dispay_to_user(url), fg='yellow'), + 'What would you like to do with this URL:\n' + styled(sanitize_url_for_display_to_user(url), fg='yellow'), partial(self.hyperlink_open_confirmed, url, cwd), 'o:Open', 'c:Copy to clipboard', 'n;red:Nothing', default='o', window=self, title=_('Hyperlink activated'), diff --git a/kitty_tests/datatypes.py b/kitty_tests/datatypes.py index d65cd007e..fbe55e5cf 100644 --- a/kitty_tests/datatypes.py +++ b/kitty_tests/datatypes.py @@ -30,7 +30,7 @@ from kitty.fast_data_types import ( ) from kitty.fast_data_types import Cursor as C from kitty.rgb import to_color -from kitty.utils import is_ok_to_read_image_file, is_path_in_temp_dir, sanitize_title, sanitize_url_for_dispay_to_user, shlex_split, shlex_split_with_positions +from kitty.utils import is_ok_to_read_image_file, is_path_in_temp_dir, sanitize_title, sanitize_url_for_display_to_user, shlex_split, shlex_split_with_positions from . import BaseTest, filled_cursor, filled_history_buf, filled_line_buf @@ -466,7 +466,7 @@ class TestDataTypes(BaseTest): if os.path.isdir('/dev/shm'): with tempfile.NamedTemporaryFile(dir='/dev/shm') as tf: self.assertTrue(is_ok_to_read_image_file(tf.name, tf.fileno()), fifo) - self.ae(sanitize_url_for_dispay_to_user( + self.ae(sanitize_url_for_display_to_user( 'h://a\u0430b.com/El%20Ni%C3%B1o/'), 'h://xn--ab-7kc.com/El NiƱo/') for x in ('~', '~/', '', '~root', '~root/~', '/~', '/a/b/', '~xx/a', '~~'): self.assertEqual(os.path.expanduser(x), expanduser(x), x)