Skip to content

Commit

Permalink
improve support for UTF-8 accented characters
Browse files Browse the repository at this point in the history
  • Loading branch information
protocool committed Jun 24, 2010
1 parent 5549ec7 commit b578cf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion bundle_extras/ackmate_ack.autogenerated
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

use warnings;
use strict;
use Unicode::Normalize;
use Encode;

our $VERSION = '1.92-ackmate';
# Check http://betterthangrep.com/ for updates
Expand Down Expand Up @@ -1418,6 +1420,7 @@ sub get_command_line_options {
}

if ( $opt{ackmate} ) {
$opt{regex} = Unicode::Normalize::NFC($opt{regex});
$opt{color} = 0;
$opt{heading} = 1;
$opt{break} = 0;
Expand Down Expand Up @@ -2604,7 +2607,7 @@ sub needs_line_scan {
App::Ack::warn( "$self->{filename}: $!" );
return 1;
}
return 0 unless $rc && ( $rc == $size );
return 0 unless $rc && ( $rc == $size || length(Encode::encode_utf8($buffer)) == $size );

my $regex = $opt->{regex};
return $buffer =~ /$regex/m;
Expand Down
2 changes: 1 addition & 1 deletion source/controllers/JPAckProcess.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ - (void)invokeWithTerm:(NSString*)term path:(NSString*)path searchFolder:(NSStri
[self.ackTask setCurrentDirectoryPath:path];

[self.ackTask setLaunchPath:@"/usr/bin/env"];
NSMutableArray* args = [NSMutableArray arrayWithObjects:@"perl", ackmateAck, @"--ackmate", nil];
NSMutableArray* args = [NSMutableArray arrayWithObjects:@"perl", @"-CADS", ackmateAck, @"--ackmate", nil];

if (literal) [args addObject:@"--literal"];
if (words) [args addObject:@"--word-regexp"];
Expand Down

0 comments on commit b578cf0

Please sign in to comment.