Support control character escapes, add :AllChars attribute

Also:
- fix warning in RevBank::Plugin->Tab when there are attrs but no :Tab
- reconstruct quotes and escapes in prompt on retry
This commit is contained in:
Juerd Waalboer 2023-12-28 03:06:37 +01:00
parent 573731cb61
commit 0cd178d950
2 changed files with 34 additions and 5 deletions

View file

@ -22,7 +22,7 @@ sub Tab($self, $method) {
ref $method ? $method : $self->can($method)
) or return;
my ($tab) = $attr =~ /Tab \( (.*?) \)/x;
my ($tab) = $attr =~ /Tab \( (.*?) \)/x or return;
for my $keyword (split /\s*,\s*/, $tab) {
if ($keyword =~ /^&(.*)/) {
my $method = $1;
@ -44,6 +44,14 @@ sub Tab($self, $method) {
return keys %completions;
}
sub AllChars($self, $method) {
my $attr = attributes::get(
ref $method ? $method : $self->can($method)
) or return;
return !!($attr =~ /AllChars/);
}
1;
__END__