diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh index 0f9f83dc..e30fbabf 100644 --- a/src/parameters_parser.hh +++ b/src/parameters_parser.hh @@ -119,7 +119,7 @@ struct ParametersParser ConstArrayView positionals_from(size_t first) const { kak_assert(m_desc.flags & (ParameterDesc::Flags::SwitchesOnlyAtStart | ParameterDesc::Flags::SwitchesAsPositional)); - return m_params.subrange(m_positional_indices[first]); + return m_params.subrange(first < m_positional_indices.size() ? m_positional_indices[first] : -1); } iterator begin() const { return iterator(*this, 0); }