Merge branch 'feat-underline' of https://github.com/page-down/kitty

This commit is contained in:
Kovid Goyal 2022-01-22 09:28:13 +05:30
commit d17757cc84
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 7 additions and 11 deletions

View File

@ -166,11 +166,8 @@ def scroll_screen(amt: int = 1) -> str:
return '\033[' + str(abs(amt)) + ('T' if amt < 0 else 'S') return '\033[' + str(abs(amt)) + ('T' if amt < 0 else 'S')
STANDARD_COLORS = {name: i for i, name in enumerate( STANDARD_COLORS = {'black': 0, 'red': 1, 'green': 2, 'yellow': 3, 'blue': 4, 'magenta': 5, 'cyan': 6, 'gray': 7, 'white': 7}
'black red green yellow blue magenta cyan gray'.split())} UNDERLINE_STYLES = {'straight': 1, 'double': 2, 'curly': 3, 'dotted': 4, 'dashed': 5}
STANDARD_COLORS['white'] = STANDARD_COLORS['gray']
UNDERLINE_STYLES = {name: i + 1 for i, name in enumerate(
'straight double curly'.split())}
ColorSpec = Union[int, str, Color] ColorSpec = Union[int, str, Color]

View File

@ -360,7 +360,7 @@ opt('url_color', '#0087bd',
option_type='to_color', ctype='color_as_int', option_type='to_color', ctype='color_as_int',
long_text=''' long_text='''
The color and style for highlighting URLs on mouse-over. :code:`url_style` can The color and style for highlighting URLs on mouse-over. :code:`url_style` can
be one of: none, single, double, curly be one of: none, straight, double, curly, dotted, dashed
''' '''
) )

View File

@ -500,15 +500,14 @@ def scrollback_pager_history_size(x: str) -> int:
return min(ans, 4096 * 1024 * 1024 - 1) return min(ans, 4096 * 1024 * 1024 - 1)
# "single" for backwards compat
url_style_map = {'none': 0, 'single': 1, 'straight': 1, 'double': 2, 'curly': 3, 'dotted': 4, 'dashed': 5}
def url_style(x: str) -> int: def url_style(x: str) -> int:
return url_style_map.get(x, url_style_map['curly']) return url_style_map.get(x, url_style_map['curly'])
url_style_map = {
v: i for i, v in enumerate('none single double curly'.split())
}
def url_prefixes(x: str) -> Tuple[str, ...]: def url_prefixes(x: str) -> Tuple[str, ...]:
return tuple(a.lower() for a in x.replace(',', ' ').split()) return tuple(a.lower() for a in x.replace(',', ' ').split())