From 0b3dafcd1891cd2df95189d633c0a98324de9986 Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Tue, 9 Apr 2019 17:50:19 +0200 Subject: [PATCH] fix plotattr `plotattr` would fail when the description did not have a period (`.`) in it, e.g. for `ticks`. This seemed safer than to edit the argument descriptions --- src/plotattr.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plotattr.jl b/src/plotattr.jl index fb7170e4..d695d16e 100644 --- a/src/plotattr.jl +++ b/src/plotattr.jl @@ -50,8 +50,13 @@ function plotattr(attrtype::Symbol, attribute::AbstractString) desc = get(_arg_desc, attribute, "") first_period_idx = findfirst(isequal('.'), desc) - typedesc = desc[1:first_period_idx-1] - desc = strip(desc[first_period_idx+1:end]) + if isnothing(first_period_idx) + typedesc = "" + desc = strip(desc) + else + typedesc = desc[1:first_period_idx-1] + desc = strip(desc[first_period_idx+1:end]) + end als = keys(filter(x->x[2]==attribute, _keyAliases)) |> collect |> sort als = join(map(string,als), ", ") def = _attribute_defaults[attrtype][attribute]