From 84cb34005ebe0e8d5536ed66dada2f28fff15252 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Wed, 29 Jun 2022 00:09:55 +1000 Subject: [PATCH] Coding style - Use if-expressions where possible. --- diff_edit/editor.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/diff_edit/editor.py b/diff_edit/editor.py index 367a16e..02c04ad 100755 --- a/diff_edit/editor.py +++ b/diff_edit/editor.py @@ -45,10 +45,9 @@ def is_bright_theme(theme): def highlight_line(line, theme=None): - if theme is not None and is_bright_theme(theme): - return highlight_str(line, termstr.Color.black, 0.8) - else: - return highlight_str(line, termstr.Color.white, 0.8) + blend_color = (termstr.Color.black if theme is not None and is_bright_theme(theme) + else termstr.Color.white) + return highlight_str(line, blend_color, 0.8) NATIVE_STYLE = pygments.styles.get_style_by_name("paraiso-dark")