From bd426869fa1685c89c847f3821d335474798341e Mon Sep 17 00:00:00 2001 From: David Widmann Date: Wed, 14 Apr 2021 22:40:56 +0200 Subject: [PATCH] Fix compilation error on Julia 1.3 (#687) --- .github/workflows/ci.yml | 2 +- Project.toml | 4 ++-- src/conversions.jl | 2 +- src/figureplotting.jl | 4 ++-- src/figures.jl | 4 ++-- src/makielayout/mousestatemachine.jl | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebd0fd93a..d379df9c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: matrix: version: - '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia. - - '1.4' + - '1.3' - 'nightly' os: - ubuntu-latest diff --git a/Project.toml b/Project.toml index 5dc993068..061d9a4c6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ -authors = ["Simon Danisch", "Julius Krumbiegel"] name = "AbstractPlotting" uuid = "537997a7-5e4e-5d89-9595-2241ea00577e" -version = "0.17.0" +authors = ["Simon Danisch", "Julius Krumbiegel"] +version = "0.17.1" [deps] Animations = "27a7e980-b3e6-11e9-2bcd-0b925532e340" diff --git a/src/conversions.jl b/src/conversions.jl index 2d552fffe..fe0d1e7ab 100644 --- a/src/conversions.jl +++ b/src/conversions.jl @@ -757,7 +757,7 @@ function line_diff_pattern(ls_str::AbstractString, gaps = :normal) pattern = Float64[] for i in 1:length(ls_str) curr_char = ls_str[i] - next_char = i == lastindex(ls_str) ? ls_str[begin] : ls_str[i+1] + next_char = i == lastindex(ls_str) ? ls_str[firstindex(ls_str)] : ls_str[i+1] # push dash or dot if curr_char == '-' push!(pattern, dash) diff --git a/src/figureplotting.jl b/src/figureplotting.jl index ebbd48068..935896353 100644 --- a/src/figureplotting.jl +++ b/src/figureplotting.jl @@ -89,7 +89,7 @@ function plot!(P::PlotFunc, fp::FigurePosition, args...; kwargs...) if !(length(c) == 1 && c[1] isa Union{Axis, LScene}) error("There needs to be a single axis at $(fp.gp.span), $(fp.gp.side) to plot into.\nUse a non-mutating plotting command to create an axis implicitly.") end - ax = only(c) + ax = first(c) plot!(P, ax, args...; kwargs...) end @@ -141,6 +141,6 @@ function plot!(P::PlotFunc, fsp::FigureSubposition, args...; kwargs...) if !(length(c) == 1 && c[1] isa Union{Axis, LScene}) error("There is not just one axis at $(gp).") end - ax = only(c) + ax = first(c) plot!(P, ax, args...; kwargs...) end diff --git a/src/figures.jl b/src/figures.jl index b724a6b78..f6323da09 100644 --- a/src/figures.jl +++ b/src/figures.jl @@ -147,7 +147,7 @@ function get_layout_at!(fp::FigurePosition; createmissing = false) if isempty(layouts) && createmissing fp.gp[] = GridLayoutBase.GridLayout() elseif length(layouts) == 1 - only(layouts)::GridLayoutBase.GridLayout + first(layouts)::GridLayoutBase.GridLayout else nothing end @@ -167,7 +167,7 @@ function get_layout_at!(fsp::FigureSubposition; createmissing = false) if isempty(layouts) && createmissing gp[] = GridLayoutBase.GridLayout() elseif length(layouts) == 1 - only(layouts)::GridLayoutBase.GridLayout + first(layouts)::GridLayoutBase.GridLayout else nothing end diff --git a/src/makielayout/mousestatemachine.jl b/src/makielayout/mousestatemachine.jl index 58e36cab6..365058add 100644 --- a/src/makielayout/mousestatemachine.jl +++ b/src/makielayout/mousestatemachine.jl @@ -220,7 +220,7 @@ function addmouseevents!(scene, elements...) # we also only react if one button is pressed, because otherwise things go crazy (pressed left button plus clicks from other buttons in between are not allowed, e.g.) if mousedrag == Mouse.down if length(pressed_buttons) == 1 - button = only(pressed_buttons) + button = first(pressed_buttons) mouse_downed_button[] = button if mouse_was_inside[]