From f7ea77a21f4d9e860a275a5dde54c5af28ae4492 Mon Sep 17 00:00:00 2001 From: t-bltg Date: Mon, 20 Dec 2021 14:03:51 +0100 Subject: [PATCH] make image() throw --- .github/workflows/ci.yml | 19 ++++--------------- Project.toml | 2 +- src/UnicodePlots.jl | 2 +- src/canvas/imgcanvas.jl | 4 +++- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae689dff..70c6b6f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,41 +1,30 @@ name: CI -on: - pull_request: - branches: - - master - push: - branches: - - master - tags: '*' +on: [push, pull_request] + jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: version: - - '1.6' # LTS + - '1.0' # oldest supported in Project.toml - '1' # latest stable - 'nightly' os: - ubuntu-latest - arch: - - x64 include: # spare windows/macos CI credits - os: windows-latest version: '1' - arch: x64 - os: macOS-latest version: '1' - arch: x64 steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - uses: actions/cache@v1 env: cache-name: cache-artifacts diff --git a/Project.toml b/Project.toml index ee8fadad..12d2eb28 100644 --- a/Project.toml +++ b/Project.toml @@ -14,7 +14,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] -ColorTypes = "0.9 - 0.11" +ColorTypes = "0.9, 0.10, 0.11" Crayons = "4.0" Requires = "1" StatsBase = "0.32, 0.33" diff --git a/src/UnicodePlots.jl b/src/UnicodePlots.jl index 623390cb..79f74f57 100644 --- a/src/UnicodePlots.jl +++ b/src/UnicodePlots.jl @@ -84,7 +84,7 @@ include("interface/heatmap.jl") include("interface/spy.jl") include("interface/boxplot.jl") -image(args...; kwargs...) = @warn "not implemented, did you forget 'using ImageInTerminal' ?" +image(args...; kwargs...) = error("not implemented, did you forget 'using ImageInTerminal' ?") function __init__() @require ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254" begin diff --git a/src/canvas/imgcanvas.jl b/src/canvas/imgcanvas.jl index 671510a5..4cfd5c27 100644 --- a/src/canvas/imgcanvas.jl +++ b/src/canvas/imgcanvas.jl @@ -15,7 +15,9 @@ function render(c::ImgCanvas) if (c.sixel[] = ImageInTerminal.use_sixel(c.img)) h, w = size(c.img) # determine the terminal carret size, in pixels - char_pixels = ImageInTerminal.Sixel.TerminalTools.query_terminal("\e[16t", r"\e\[6;(\d+);(\d+)t", stdout) + char_pixels = ImageInTerminal.Sixel.TerminalTools.query_terminal( + "\e[16t", r"\e\[6;(\d+);(\d+)t", stdout + ) char_h, char_w = length(char_pixels) > 1 ? parse.(Int, char_pixels) : (15, 7) lines = String[] io = IOBuffer()