From cd36e3b3143f3d88a4010139806c5b8c3a04381b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Jun 2018 15:24:05 +0530 Subject: [PATCH] oops --- docs/conf.py | 2 +- kitty/conf/definition.py | 14 ++++++++------ kitty/config_data.py | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 8e5d844e0..f1dde8e18 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -373,7 +373,7 @@ def render_conf(conf_name, all_options): current_group = None all_options = list(all_options) for i, opt in enumerate(all_options): - if not opt.long_text or not opt.add_to_default: + if not opt.long_text or not opt.add_to_docs: continue if opt.group is not current_group: if current_group and current_group.end_text: diff --git a/kitty/conf/definition.py b/kitty/conf/definition.py index 66b2ef9f4..c9a67dcd2 100644 --- a/kitty/conf/definition.py +++ b/kitty/conf/definition.py @@ -23,13 +23,14 @@ class Group: class Option: - __slots__ = 'name', 'group', 'long_text', 'option_type', 'defval_as_string', 'add_to_default' + __slots__ = 'name', 'group', 'long_text', 'option_type', 'defval_as_string', 'add_to_default', 'add_to_docs' - def __init__(self, name, group, defval, option_type, long_text, add_to_default): + def __init__(self, name, group, defval, option_type, long_text, add_to_default, add_to_docs): self.name, self.group = name, group self.long_text, self.option_type = long_text.strip(), option_type self.defval_as_string = defval self.add_to_default = add_to_default + self.add_to_docs = add_to_docs def option( @@ -39,7 +40,8 @@ def option( defval, long_text='', option_type=to_string, - add_to_default=True + add_to_default=True, + add_to_docs=True ): is_multiple = name.startswith('+') if is_multiple: @@ -59,7 +61,7 @@ def option( key = name if is_multiple: key = name + ' ' + defval.partition(' ')[0] - ans = Option(name, group[0], defval, option_type, long_text, add_to_default) + ans = Option(name, group[0], defval, option_type, long_text, add_to_default, add_to_docs) all_options[key] = ans return ans @@ -78,7 +80,7 @@ def merged_opts(all_options, opt, i): yield opt for k in range(i + 1, len(all_options)): q = all_options[k] - if not q.long_text and q.add_to_default: + if not q.long_text and q.add_to_docs: yield q else: break @@ -109,7 +111,7 @@ def as_conf_file(all_options): current_group = None all_options = list(all_options) for i, opt in enumerate(all_options): - if not opt.long_text: + if not opt.long_text or not opt.add_to_docs: continue if opt.group is not current_group: if current_group: diff --git a/kitty/config_data.py b/kitty/config_data.py index 5eb7a9411..a28aca90e 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -135,7 +135,7 @@ o, g, all_groups = option_func(all_options, { _('''\ The 16 terminal colors. There are 8 basic colors, each color has a dull and bright version. You can also set the remaining colors from the 256 color table -as color16 to color256.''') +as color16 to color255.''') ], 'advanced': [_('Advanced')], 'os': [_('OS specific tweaks')], @@ -507,7 +507,7 @@ o('color15', '#ffffff', option_type=to_color) dfctl = defines.default_color_table() for i in range(16, 256): k = 'color{}'.format(i) - o(k, color_as_sharp(color_from_int(dfctl[i])), option_type=to_color, add_to_default=False) + o(k, color_as_sharp(color_from_int(dfctl[i])), option_type=to_color, add_to_docs=False) # }}} @@ -598,7 +598,7 @@ Hide the kitty window from running tasks (:kbd:`Option+Tab`) on macOS. # }}} -g('shortcuts') # {{ +g('shortcuts') # {{{ o('kitty_mod', 'ctrl+shift', option_type=to_modifiers, long_text=_(''' The value of :code:`kitty_mod` is used as the modifier for all default shortcuts, you