Changeset 880311d for perl/lib/BarnOwl
- Timestamp:
- Dec 28, 2009, 12:03:28 AM (15 years ago)
- Branches:
- master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- e6cec01
- Parents:
- 4815492
- git-author:
- Nelson Elhage <nelhage@mit.edu> (12/24/09 16:45:08)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (12/28/09 00:03:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl/Completion.pm
r4815492 r880311d 34 34 35 35 if($prefix) { 36 insert_completion($ctx, $prefix, scalar @words == 1); 36 insert_completion($ctx, $prefix, 37 scalar @words == 1 && completion_done($words[0])); 37 38 } 38 39 … … 55 56 An arrayref completion consists of 56 57 57 [$display_text, $replacement_value ].58 [$display_text, $replacement_value[, $completion_done] ]. 58 59 59 60 $display_text will be printed in the case of ambiguous completions, 60 $replacement_value will be used to substitute the value in. 61 $replacement_value will be used to substitute the value in. If there 62 is only a single completion for a given word, a space will be appended 63 after the completion iff $completion_done is true (or missing). 61 64 62 65 =cut … … 74 77 } 75 78 79 sub completion_done { 80 my $c = shift; 81 return 1 if ref($c) ne 'ARRAY' or @$c < 3; 82 return $c->[2]; 83 } 84 76 85 sub insert_completion { 77 86 my $ctx = shift; 78 87 my $completion = BarnOwl::quote(completion_value(shift)); 79 my $ unique = shift;88 my $done = shift; 80 89 81 if($ unique) {90 if($done) { 82 91 $completion .= " "; 83 92 }
Note: See TracChangeset
for help on using the changeset viewer.