Changeset f987504


Ignore:
Timestamp:
Jul 27, 2009, 11:23:57 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
8f16dcd
Parents:
7be5d8b
git-author:
Nelson Elhage <nelhage@mit.edu> (07/27/09 23:22:21)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/27/09 23:23:57)
Message:
Fix completion handling if the null string generates a completion.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/Completion.pm

    rb73bcbb rf987504  
    4646sub insert_completion {
    4747    my $ctx = shift;
    48     my $completion = shift;
     48    my $completion = BarnOwl::quote(shift);
    4949    my $unique = shift;
     50
     51    if($unique) {
     52        $completion .= " ";
     53    }
    5054
    5155    save_excursion {
     
    5357        BarnOwl::Editwin::set_mark();
    5458        point_move($ctx->word_end - $ctx->word_start);
    55         replace_region(BarnOwl::quote($completion));
     59        replace_region($completion);
    5660    };
    57     if($unique && $ctx->word == (scalar @{$ctx->words} - 1)) {
    58         save_excursion {
    59             BarnOwl::Editwin::set_mark();
    60             replace_region(' ');
    61         };
    62         point_move(1);
     61    if(!length($ctx->words->[$ctx->word])) {
     62        point_move(length($completion));
    6363    }
    6464}
Note: See TracChangeset for help on using the changeset viewer.