From dd7666d8b06a1961dd931b9865749b1d38231fba Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Sun, 24 Apr 2022 09:28:35 +0200 Subject: [PATCH] Use ternary for "italic" theme configuration (#305) Instead of using a if/else block and empty variable declaration Vim's builtin `get` function [1] is now used to simplify the code. Co-authored-by: Sven Greb Co-authored-by: Arctic Ice Studio [1]: https://vimhelp.org/builtin.txt.html#builtin.txt#get%28%29 GH-305 --- colors/nord.vim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/colors/nord.vim b/colors/nord.vim index b95ac39..d07ffb9 100755 --- a/colors/nord.vim +++ b/colors/nord.vim @@ -81,10 +81,8 @@ let s:underline = (g:nord_underline == 0) ? "NONE," : "underline," let g:nord_italic = get(g:, "nord_italic", (has("gui_running") || $TERM_ITALICS == "true")) let s:italic = (g:nord_italic == 0) ? "" : "italic," -let s:italicize_comments = "" -if get(g:, "nord_italic_comments", 0) - let s:italicize_comments = s:italic -endif +let g:nord_italic_comments = get(g:, "nord_italic_comments", 0) +let s:italicize_comments = (g:nord_italic_comments == 0) ? "" : get(s:, "italic") let g:nord_uniform_status_lines = get(g:, "nord_uniform_status_lines", 0)