diff --git a/kitty/options/parse.py b/kitty/options/parse.py index 948267f54..b9bcd51b1 100644 --- a/kitty/options/parse.py +++ b/kitty/options/parse.py @@ -938,12 +938,12 @@ class Parser: def cursor_trail(self, val: str, ans: dict[str, typing.Any]) -> None: ans['cursor_trail'] = positive_int(val) - def cursor_trail_decay(self, val: str, ans: dict[str, typing.Any]) -> None: - ans['cursor_trail_decay'] = cursor_trail_decay(val) - def cursor_trail_color(self, val: str, ans: dict[str, typing.Any]) -> None: ans['cursor_trail_color'] = to_color_or_none(val) + def cursor_trail_decay(self, val: str, ans: dict[str, typing.Any]) -> None: + ans['cursor_trail_decay'] = cursor_trail_decay(val) + def cursor_trail_start_threshold(self, val: str, ans: dict[str, typing.Any]) -> None: ans['cursor_trail_start_threshold'] = positive_int(val) diff --git a/kitty/options/to-c-generated.h b/kitty/options/to-c-generated.h index fcfaf231d..788312c05 100644 --- a/kitty/options/to-c-generated.h +++ b/kitty/options/to-c-generated.h @@ -226,19 +226,6 @@ convert_from_opts_cursor_trail_decay(PyObject *py_opts, Options *opts) { Py_DECREF(ret); } -static void -convert_from_python_cursor_trail_color(PyObject *val, Options *opts) { - cursor_trail_color(val, opts); -} - -static void -convert_from_opts_cursor_trail_color(PyObject *py_opts, Options *opts) { - PyObject *ret = PyObject_GetAttrString(py_opts, "cursor_trail_color"); - if (ret == NULL) return; - convert_from_python_cursor_trail_color(ret, opts); - Py_DECREF(ret); -} - static void convert_from_python_cursor_trail_start_threshold(PyObject *val, Options *opts) { opts->cursor_trail_start_threshold = PyLong_AsLong(val); @@ -252,6 +239,19 @@ convert_from_opts_cursor_trail_start_threshold(PyObject *py_opts, Options *opts) Py_DECREF(ret); } +static void +convert_from_python_cursor_trail_color(PyObject *val, Options *opts) { + cursor_trail_color(val, opts); +} + +static void +convert_from_opts_cursor_trail_color(PyObject *py_opts, Options *opts) { + PyObject *ret = PyObject_GetAttrString(py_opts, "cursor_trail_color"); + if (ret == NULL) return; + convert_from_python_cursor_trail_color(ret, opts); + Py_DECREF(ret); +} + static void convert_from_python_scrollback_indicator_opacity(PyObject *val, Options *opts) { opts->scrollback_indicator_opacity = PyFloat_AsFloat(val); @@ -1224,10 +1224,10 @@ convert_opts_from_python_opts(PyObject *py_opts, Options *opts) { if (PyErr_Occurred()) return false; convert_from_opts_cursor_trail_decay(py_opts, opts); if (PyErr_Occurred()) return false; - convert_from_opts_cursor_trail_color(py_opts, opts); - if (PyErr_Occurred()) return false; convert_from_opts_cursor_trail_start_threshold(py_opts, opts); if (PyErr_Occurred()) return false; + convert_from_opts_cursor_trail_color(py_opts, opts); + if (PyErr_Occurred()) return false; convert_from_opts_scrollback_indicator_opacity(py_opts, opts); if (PyErr_Occurred()) return false; convert_from_opts_scrollback_pager_history_size(py_opts, opts); diff --git a/kitty/options/types.py b/kitty/options/types.py index a6e857164..4a5db05c5 100644 --- a/kitty/options/types.py +++ b/kitty/options/types.py @@ -336,8 +336,8 @@ option_names = ( 'cursor_stop_blinking_after', 'cursor_text_color', 'cursor_trail', - 'cursor_trail_decay', 'cursor_trail_color', + 'cursor_trail_decay', 'cursor_trail_start_threshold', 'cursor_underline_thickness', 'default_pointer_shape', @@ -520,8 +520,8 @@ class Options: cursor_stop_blinking_after: float = 15.0 cursor_text_color: kitty.fast_data_types.Color | None = Color(17, 17, 17) cursor_trail: int = 0 - cursor_trail_decay: tuple[float, float] = (0.1, 0.4) cursor_trail_color: kitty.fast_data_types.Color | None = None + cursor_trail_decay: tuple[float, float] = (0.1, 0.4) cursor_trail_start_threshold: int = 2 cursor_underline_thickness: float = 2.0 default_pointer_shape: choices_for_default_pointer_shape = 'beam' @@ -1053,6 +1053,7 @@ defaults.mouse_map = [ nullable_colors = frozenset({ 'cursor', 'cursor_text_color', + 'cursor_trail_color', 'visual_bell_color', 'active_border_color', 'tab_bar_background', @@ -1062,5 +1063,4 @@ nullable_colors = frozenset({ }) -secret_options = ('remote_control_password', 'file_transfer_confirmation_bypass') - +secret_options = ('remote_control_password', 'file_transfer_confirmation_bypass') \ No newline at end of file diff --git a/tools/cmd/at/set_colors.go b/tools/cmd/at/set_colors.go index e82cbda32..6557cfe1d 100644 --- a/tools/cmd/at/set_colors.go +++ b/tools/cmd/at/set_colors.go @@ -18,6 +18,7 @@ var nullable_colors = map[string]bool{ "active_border_color": true, "cursor": true, "cursor_text_color": true, + "cursor_trail_color": true, "selection_background": true, "selection_foreground": true, "tab_bar_background": true, diff --git a/tools/themes/collection.go b/tools/themes/collection.go index f5c368e16..f03db45ed 100644 --- a/tools/themes/collection.go +++ b/tools/themes/collection.go @@ -298,6 +298,7 @@ var AllColorSettingNames = map[string]bool{ // {{{ "color99": true, "cursor": true, "cursor_text_color": true, + "cursor_trail_color": true, "foreground": true, "inactive_border_color": true, "inactive_tab_background": true,