From 9ebf7e4ac5ae4a90c40a874745387182707330a2 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Fri, 29 Jul 2022 21:33:38 +0200 Subject: [PATCH] 0.0.33 --- Changes | 8 +++++++- META6.json | 2 +- lib/App/Rak.rakumod | 18 ++++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index 77d40ac..a1864ea 100644 --- a/Changes +++ b/Changes @@ -2,8 +2,14 @@ Revision history for App-Rak {{$NEXT}} +0.0.33 2022-07-29T21:33:26+02:00 + - Fix issue with multiple matches inside the same paragraph with + --paragraph-context + - Fix issue with #raku, #text and #perl extension groups + 0.0.32 2022-07-29T17:23:05+02:00 - - Add "paragraph-context" option to show paragraph around match + - Add "paragraph-context" option to show paragraph around match, + Eric de Hont++ for the suggestion 0.0.31 2022-07-28T23:46:56+02:00 - Bump dependency on Git::Blame::File to get latest fixes diff --git a/META6.json b/META6.json index 04f681a..2bb9195 100644 --- a/META6.json +++ b/META6.json @@ -50,5 +50,5 @@ ], "test-depends": [ ], - "version": "0.0.32" + "version": "0.0.33" } diff --git a/lib/App/Rak.rakumod b/lib/App/Rak.rakumod index b8e624f..8e19450 100644 --- a/lib/App/Rak.rakumod +++ b/lib/App/Rak.rakumod @@ -18,11 +18,11 @@ my constant %exts = '#c' => , '#c++' => , '#markdown' => , - '#perl' => ('', ).flat, + '#perl' => ('', ).flat.List, '#python' => , - '#raku' => ('', ).flat, + '#raku' => ('', ).flat.List, '#ruby' => , - '#text' => ('', ).flat, + '#text' => ('', ).flat.List, '#yaml' => , ; @@ -151,12 +151,12 @@ my sub add-paragraph($io, @initially-selected) { my int $last-linenr = @lines.end; my int8 @seen; - my @selected = @initially-selected.map: { + my @selected is List = @initially-selected.map: { my int $linenr = .key; my int $pos = $linenr; my $selected := IterationBuffer.CREATE; while --$pos - && !@seen.AT-POS($pos) + && !(@seen.AT-POS($pos)++) && @lines.AT-POS($pos) -> $line { $selected.unshift: Pair.new($pos, $line but delimiter('-')); } @@ -167,13 +167,14 @@ my sub add-paragraph($io, @initially-selected) { if $linenr < $last-linenr { $pos = $linenr; while ++$pos < $last-linenr - && !@seen.AT-POS($pos) + && !(@seen.AT-POS($pos)++) && @lines.AT-POS($pos) -> $line { $selected.push: Pair.new($pos, $line but delimiter('-')); } $selected.push: - Pair.new($pos, @lines.AT-POS($pos) but delimiter('-')); + Pair.new($pos, @lines.AT-POS($pos) but delimiter('-')) + unless @seen.AT-POS($pos)++; } $selected.Slip } @@ -1530,7 +1531,8 @@ deal to me! Copyright 2022 Elizabeth Mattijsen -This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0. +This library is free software; you can redistribute it and/or modify it under +the Artistic License 2.0. =end pod