From b5e5bd397452bd114638e3fe413387bc1c104075 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 12 Mar 2015 16:59:07 +0900 Subject: [PATCH] Add workaround for windows console --- box.go | 7 ------- box_others.go | 10 ++++++++++ box_windows.go | 10 ++++++++++ chart.go | 4 ---- chart_others.go | 7 +++++++ chart_windows.go | 7 +++++++ 6 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 box_others.go create mode 100644 box_windows.go create mode 100644 chart_others.go create mode 100644 chart_windows.go diff --git a/box.go b/box.go index 1af6047..fc4e0b6 100644 --- a/box.go +++ b/box.go @@ -1,12 +1,5 @@ package termui -const TOP_RIGHT = '┐' -const VERTICAL_LINE = '│' -const HORIZONTAL_LINE = '─' -const TOP_LEFT = '┌' -const BOTTOM_RIGHT = '┘' -const BOTTOM_LEFT = '└' - type border struct { X int Y int diff --git a/box_others.go b/box_others.go new file mode 100644 index 0000000..f69f4f6 --- /dev/null +++ b/box_others.go @@ -0,0 +1,10 @@ +// +build !windows + +package termui + +const TOP_RIGHT = '┐' +const VERTICAL_LINE = '│' +const HORIZONTAL_LINE = '─' +const TOP_LEFT = '┌' +const BOTTOM_RIGHT = '┘' +const BOTTOM_LEFT = '└' diff --git a/box_windows.go b/box_windows.go new file mode 100644 index 0000000..2df56a1 --- /dev/null +++ b/box_windows.go @@ -0,0 +1,10 @@ +// +build windows + +package termui + +const TOP_RIGHT = '+' +const VERTICAL_LINE = '|' +const HORIZONTAL_LINE = '-' +const TOP_LEFT = '+' +const BOTTOM_RIGHT = '+' +const BOTTOM_LEFT = '+' diff --git a/chart.go b/chart.go index c2831c8..a0cece3 100644 --- a/chart.go +++ b/chart.go @@ -2,10 +2,6 @@ package termui import "fmt" -const VDASH = '┊' -const HDASH = '┈' -const ORIGIN = '└' - // only 16 possible combinations, why bother var braillePatterns = map[[2]int]rune{ [2]int{0, 0}: '⣀', diff --git a/chart_others.go b/chart_others.go new file mode 100644 index 0000000..c593557 --- /dev/null +++ b/chart_others.go @@ -0,0 +1,7 @@ +// +build !windows + +package termui + +const VDASH = '┊' +const HDASH = '┈' +const ORIGIN = '└' diff --git a/chart_windows.go b/chart_windows.go new file mode 100644 index 0000000..1e92cf8 --- /dev/null +++ b/chart_windows.go @@ -0,0 +1,7 @@ +// +build windows + +package termui + +const VDASH = '|' +const HDASH = '-' +const ORIGIN = '+'