diff --git a/docs/overview.rst b/docs/overview.rst index a918f3fd6..e05977c9b 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -198,7 +198,7 @@ The scrollback buffer |kitty| supports scrolling back to view history, just like most terminals. You can use either keyboard shortcuts or the mouse scroll wheel to do so. |kitty| -displays an interactive :opt:`scrollbar ` along the right edge +displays an interactive :opt:`scrollbar` along the right edge of the window that shows your current position in the scrollback. You can click and drag the scrollbar to quickly navigate through the history. diff --git a/kitty/debug_config.py b/kitty/debug_config.py index 1ea22ee3a..f546abd03 100644 --- a/kitty/debug_config.py +++ b/kitty/debug_config.py @@ -22,7 +22,7 @@ from .constants import extensions_dir, is_macos, is_wayland, kitty_base_dir, kit from .fast_data_types import Color, SingleKey, current_fonts, glfw_get_system_color_theme, gpu_driver_version_string, num_users, wayland_compositor_data from .options.types import Options as KittyOpts from .options.types import defaults, secret_options -from .options.utils import KeyboardMode, KeyDefinition +from .options.utils import KeyboardMode, KeyDefinition, ScrollbarSettings from .rgb import color_as_sharp, color_from_int from .types import MouseEvent, Shortcut, mod_to_names from .utils import shlex_split @@ -91,7 +91,7 @@ def compare_opts(opts: KittyOpts, global_shortcuts: dict[str, SingleKey] | None, continue val = getattr(opts, f) if isinstance(val, dict): - print(title(f'{f}:')) + print(f'{f}:') if f == 'symbol_map': for k in sorted(val): print(f'\tU+{k[0]:04x} - U+{k[1]:04x} → {val[k]}') @@ -100,6 +100,10 @@ def compare_opts(opts: KittyOpts, global_shortcuts: dict[str, SingleKey] | None, print(' ', val[k]) else: print(pformat(val)) + elif isinstance(val, ScrollbarSettings): + print(f'{f}:') + for ssd in ScrollbarSettings().differences(val): + print(f'\t{ssd}') else: val = getattr(opts, f) if isinstance(val, Color): diff --git a/kitty/options/definition.py b/kitty/options/definition.py index e172fe6c7..f8a229f5b 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -442,10 +442,9 @@ is changed it will only affect newly created windows, not existing ones. ''' ) -opt( - 'scrollbar', '', - option_type='scrollbar', ctype='!scrollbar', +opt('scrollbar', '', option_type='scrollbar', ctype='!scrollbar', long_text=''' +TODO: this writeup ''') opt('scrollback_pager', 'less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER', diff --git a/kitty/options/utils.py b/kitty/options/utils.py index 0622520d0..87dfea1e8 100644 --- a/kitty/options/utils.py +++ b/kitty/options/utils.py @@ -1719,6 +1719,11 @@ class ScrollbarSettings(NamedTuple): jump_on_track_click: bool = True visible_when: int = 1 + def differences(self, other: 'ScrollbarSettings') -> Iterator[str]: + for key in self._fields: + if getattr(self, key) != (o := getattr(other, key)): + yield f'{key}: {o}' + default_scrollbar = ScrollbarSettings()