From 2ea1755cf22dd4025a961f4a2266d4851a801405 Mon Sep 17 00:00:00 2001 From: Alexey Lebedeff Date: Tue, 2 Aug 2016 14:06:37 +0300 Subject: [PATCH 1/2] Add `compile` target to Makefile To make it usable with stock version of `erlang.mk`. I'm trying to use `cf` from withing erlang.mk-based project, but it fails to properly autopatch it. erlang.mk magic works properly when Makefile contains some references to `rebar`. Proper fix will be available within https://github.com/ninenines/erlang.mk/issues/586 But currently it's far more easier to add single target to this project, than to delve into shell script/make spaghetti =) --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e07afeb..8a7d568 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,10 @@ termcap.erl: clean: [ -f termtypes.master ] && rm termtypes.master || true [ -f termtypes.master.clean ] && rm termtypes.master.clean || true - + +compile: + rebar3 compile + termtypes.master.clean: termtypes.master cat termtypes.master | grep -v '^#' | grep -v '^\s*$$' > termtypes.master.clean From 2bcf00402db9ca5a4790de7f82c8139baaf8856c Mon Sep 17 00:00:00 2001 From: "Heinz N. Gies" Date: Wed, 14 Jun 2017 21:57:32 +0200 Subject: [PATCH 2/2] Fix hiding truecolor --- src/cf.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cf.erl b/src/cf.erl index ceb350d..bc1f0e7 100644 --- a/src/cf.erl +++ b/src/cf.erl @@ -118,16 +118,17 @@ cfmt(S) -> cfmt(S, Enabled) -> lists:flatten(cfmt_(S, Enabled)). +cfmt_([$~, $!, $#, _R1, _R2, _G1, _G2, _B1, _B2 | S], false) -> + cfmt_(S, false); +cfmt_([$~, $#, $#, _R1, _R2, _G1, _G2, _B1, _B2 | S], false) -> + cfmt_(S, false); + cfmt_([$~, $!, $_, _C | S], false) -> cfmt_(S, false); cfmt_([$~, $#, _C | S], false) -> cfmt_(S, false); cfmt_([$~, $!, _C | S], false) -> cfmt_(S, false); -cfmt_([$~, $!, $#, _R1, _R2, _G1, _G2, _B1, _B2 | S], false) -> - cfmt_(S, false); -cfmt_([$~, $#, $#, _R1, _R2, _G1, _G2, _B1, _B2 | S], false) -> - cfmt_(S, false); cfmt_([$~, $!, $#, R1, R2, G1, G2, B1, B2 | S], Enabled) -> R = list_to_integer([R1, R2], 16),