Changeset

11639:ad39528e647d

util.stanza: Remove Windows "support" (disabling ANSI color pretty printing) Always enable pretty printing if util.termcolours is available util.termcolours can be nooped out to disable pretty printing.
author Kim Alvefur <zash@zash.se>
date Sat, 07 Nov 2020 21:39:36 +0100
parents 11638:5f4a657136bc
children 11640:51598e46e136
files util/stanza.lua
diffstat 1 files changed, 2 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/util/stanza.lua	Tue Jun 15 23:24:23 2021 +0200
+++ b/util/stanza.lua	Sat Nov 07 21:39:36 2020 +0100
@@ -22,20 +22,10 @@
 local s_gsub        =   string.gsub;
 local s_sub         =    string.sub;
 local s_find        =   string.find;
-local os            =            os;
 
 local valid_utf8 = require "util.encodings".utf8.valid;
 
-local do_pretty_printing = not os.getenv("WINDIR");
-local getstyle, getstring;
-if do_pretty_printing then
-	local ok, termcolours = pcall(require, "util.termcolours");
-	if ok then
-		getstyle, getstring = termcolours.getstyle, termcolours.getstring;
-	else
-		do_pretty_printing = nil;
-	end
-end
+local do_pretty_printing, termcolours = pcall(require, "util.termcolours");
 
 local xmlns_stanzas = "urn:ietf:params:xml:ns:xmpp-stanzas";
 
@@ -500,6 +490,7 @@
 end
 
 if do_pretty_printing then
+	local getstyle, getstring = termcolours.getstyle, termcolours.getstring;
 	local style_attrk = getstyle("yellow");
 	local style_attrv = getstyle("red");
 	local style_tagname = getstyle("red");