From a0aef34642e0fc6661e34273c6997ed188dee776 Mon Sep 17 00:00:00 2001 From: Philip Wellnitz Date: Tue, 16 Mar 2021 04:16:20 +0900 Subject: [PATCH] add center seperators --- powerline/colorscheme.py | 6 +++--- powerline/config_files/themes/ascii.json | 4 ++++ powerline/config_files/themes/powerline.json | 4 ++++ powerline/config_files/themes/powerline_terminus.json | 4 ++++ powerline/config_files/themes/powerline_unicode7.json | 4 ++++ powerline/config_files/themes/unicode.json | 4 ++++ .../config_files/themes/unicode_terminus_condensed.json | 4 ++++ powerline/renderer.py | 2 +- 8 files changed, 28 insertions(+), 4 deletions(-) diff --git a/powerline/colorscheme.py b/powerline/colorscheme.py index 928c6157..d1788fe7 100644 --- a/powerline/colorscheme.py +++ b/powerline/colorscheme.py @@ -112,7 +112,7 @@ class Colorscheme(object): def get_gradient(self, gradient, gradient_level): if gradient in self.gradients: # cterm, hex - col = pick_gradient_value(self.gradients[gradient], gradient_level, is_hsv = (self. gradient_types[gradient] == "hsv")) + col = pick_gradient_value(self.gradients[gradient], gradient_level, is_hsv = (self.gradient_types[gradient] == "hsv")) return (cterm_color(*hex_to_rgb(col)), col) else: return self.colors[gradient] @@ -157,9 +157,9 @@ class Colorscheme(object): raise KeyError('Highlighting groups not found in colorscheme: ' + ', '.join(groups)) if gradient_level is None: - pick_color = lambda str: (hex_to_cterm(str), int(add_transparency(str), 16)) if str. startswith('0x') or str.startswith('0X') else self.colors[str] + pick_color = lambda str: (hex_to_cterm(str), int(add_transparency(str), 16)) if str.startswith('0x') or str.startswith('0X') else self.colors[str] else: - pick_color = lambda str: (hex_to_cterm(str), int(add_transparency(str), 16)) if str. startswith('0x') or str.startswith('0X') else self.get_gradient(str, gradient_level) + pick_color = lambda str: (hex_to_cterm(str), int(add_transparency(str), 16)) if str.startswith('0x') or str.startswith('0X') else self.get_gradient(str, gradient_level) # attrs and click are optional return { diff --git a/powerline/config_files/themes/ascii.json b/powerline/config_files/themes/ascii.json index 0ea05e75..5587b637 100644 --- a/powerline/config_files/themes/ascii.json +++ b/powerline/config_files/themes/ascii.json @@ -5,6 +5,10 @@ "hard": " ", "soft": "| " }, + "center": { + "hard": " ", + "soft": "| " + }, "right": { "hard": " ", "soft": " |" diff --git a/powerline/config_files/themes/powerline.json b/powerline/config_files/themes/powerline.json index 366a7ea4..404314e4 100644 --- a/powerline/config_files/themes/powerline.json +++ b/powerline/config_files/themes/powerline.json @@ -4,6 +4,10 @@ "hard": " ", "soft": " " }, + "center": { + "hard": " ", + "soft": "│ " + }, "right": { "hard": " ", "soft": " " diff --git a/powerline/config_files/themes/powerline_terminus.json b/powerline/config_files/themes/powerline_terminus.json index e5fb1c8c..b57a62cb 100644 --- a/powerline/config_files/themes/powerline_terminus.json +++ b/powerline/config_files/themes/powerline_terminus.json @@ -4,6 +4,10 @@ "hard": " ", "soft": " " }, + "center": { + "hard": " ", + "soft": "│ " + }, "right": { "hard": " ", "soft": " " diff --git a/powerline/config_files/themes/powerline_unicode7.json b/powerline/config_files/themes/powerline_unicode7.json index bd628267..7be08a0a 100644 --- a/powerline/config_files/themes/powerline_unicode7.json +++ b/powerline/config_files/themes/powerline_unicode7.json @@ -4,6 +4,10 @@ "hard": " ", "soft": " " }, + "center": { + "hard": " ", + "soft": "│ " + }, "right": { "hard": " ", "soft": " " diff --git a/powerline/config_files/themes/unicode.json b/powerline/config_files/themes/unicode.json index 08028523..a9fee0f6 100644 --- a/powerline/config_files/themes/unicode.json +++ b/powerline/config_files/themes/unicode.json @@ -4,6 +4,10 @@ "hard": "▌ ", "soft": "│ " }, + "center": { + "hard": " ", + "soft": "│ " + }, "right": { "hard": " ▐", "soft": " │" diff --git a/powerline/config_files/themes/unicode_terminus_condensed.json b/powerline/config_files/themes/unicode_terminus_condensed.json index 421f5c88..90ad341c 100644 --- a/powerline/config_files/themes/unicode_terminus_condensed.json +++ b/powerline/config_files/themes/unicode_terminus_condensed.json @@ -4,6 +4,10 @@ "hard": "▌", "soft": "│" }, + "center": { + "hard": "", + "soft": "│" + }, "right": { "hard": "▐", "soft": "│" diff --git a/powerline/renderer.py b/powerline/renderer.py index 3989b7e0..a3f16f95 100644 --- a/powerline/renderer.py +++ b/powerline/renderer.py @@ -582,7 +582,7 @@ class Renderer(object): side = segment['side'] if not segment['literal_contents'][1]: if segment is not last_segment: - compare_segment = next(iter(( + next_segment = next(iter(( segment for segment in segments[index + 1:] if not segment['literal_contents'][1]