Skip to content

Commit

Permalink
Use ternary for "italic" theme configuration (#305)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: Arctic Ice Studio <[email protected]>

[1]: https://vimhelp.org/builtin.txt.html#builtin.txt#get%28%29

GH-305
  • Loading branch information
jvoisin authored and svengreb committed May 14, 2022
1 parent dc6cc32 commit dd7666d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions colors/nord.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit dd7666d

Please sign in to comment.