From c2083203b37d18c37746f4b8b39a73f5b089938b Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 24 Jul 2020 08:31:05 +0300 Subject: [PATCH] v.util: fix util.emanager.set_support_color --- vlib/v/builder/builder.v | 5 ++--- vlib/v/util/errors.v | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/vlib/v/builder/builder.v b/vlib/v/builder/builder.v index 6ba346eef5..d4bbccba6c 100644 --- a/vlib/v/builder/builder.v +++ b/vlib/v/builder/builder.v @@ -33,11 +33,10 @@ pub fn new_builder(pref &pref.Preferences) Builder { compiled_dir := if os.is_dir(rdir) { rdir } else { os.dir(rdir) } table := table.new_table() if pref.use_color == .always { - // TODO - //util.emanager.set_support_color(true) + util.emanager.set_support_color(true) } if pref.use_color == .never { - //util.emanager.set_support_color(false) + util.emanager.set_support_color(false) } msvc := find_msvc() or { if pref.ccompiler == 'msvc' { diff --git a/vlib/v/util/errors.v b/vlib/v/util/errors.v index 660fb18180..ed65b382cb 100644 --- a/vlib/v/util/errors.v +++ b/vlib/v/util/errors.v @@ -39,8 +39,11 @@ pub fn new_error_manager() &EManager { } } -pub fn (mut e EManager) set_support_color(b bool) { - e.support_color = b +pub fn (e &EManager) set_support_color(b bool) { + unsafe { + mut me := e + me.support_color = b + } } fn bold(msg string) string {