From 933b3ebd0a8bd3adfa32065fafbadc65cab1a7d9 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 3 Feb 2019 12:33:19 +0100 Subject: fix array index for fish 3.0.0 array[01..n] fails for fish shell version 3.0.0. This change makes sure we always index without leading zeros. --- mark.fish | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mark.fish b/mark.fish index 865becb..086dc58 100644 --- a/mark.fish +++ b/mark.fish @@ -1,3 +1,6 @@ +# Copyright (c) 2017-2019 Florian Fischer. All rights reserved. +# Use of this source code is governed by a MIT license found in the LICENSE file. + function __mark_print_block -d "prints block from mark_store" -a block file set c (string match -r "#$block#[^#]*" (echo (cat $file))) set c (string replace "#$block#" "" $c) @@ -90,7 +93,7 @@ function __mark_get --description 'extract information from a mark_store' \ set marks (string split "" $range_marks) - set marks $marks[$start_d[3]..(math $start_d[3] + $range)] + set marks $marks[(math $start_d[3])..(math $start_d[3] + $range)] echo (string join "" $marks) else -- cgit v1.2.3