vim-perl

Why is vim indenting my Perl code incorrectly?

拈花ヽ惹草 提交于 2019-12-04 23:30:39
问题 I have a subroutine in Perl that should be indented like this: sub GetFiles { my $pwd = shift; my @input = @_; my @returned; my @DirectoryContent = &GetContentInformation(@input); foreach (@DirectoryContent) { my %current = %{$_}; if ($current{'info'} =~ /<DIR>/) { my $RecurseDir = &GetRecurseDir($pwd, \%current); push(@returned, &GetFiles($RecurseDir, &GetDirectoryContents($RecurseDir))); } else { # clean up the data my $size = $current{'info'}; # filesize will be in number of bytes # remove

Why is vim indenting my Perl code incorrectly?

孤街醉人 提交于 2019-12-03 14:27:46
I have a subroutine in Perl that should be indented like this: sub GetFiles { my $pwd = shift; my @input = @_; my @returned; my @DirectoryContent = &GetContentInformation(@input); foreach (@DirectoryContent) { my %current = %{$_}; if ($current{'info'} =~ /<DIR>/) { my $RecurseDir = &GetRecurseDir($pwd, \%current); push(@returned, &GetFiles($RecurseDir, &GetDirectoryContents($RecurseDir))); } else { # clean up the data my $size = $current{'info'}; # filesize will be in number of bytes # remove file separators #$size =~ s/,//g; my $extension = &GetFileExtension($current{'name'}); delete($current