jrockway / cperl-mode

cperl-mode with 5.10 fixes, mx-declare support, perl6 support, etc.
102 stars 33 forks source link

Extra space in keyword expansion #33

Open r39ex opened 8 years ago

r39ex commented 8 years ago

With cperl-electric-keywords set, when typing if + space I get an expanded construct like this (_ is point):

if ( _) {
}
  1. Is this intended behaviour?
  2. If so, is there a setting or some other way to get rid of the extra space before point?
hakonhagland commented 8 years ago

I think the behavior is intended. Note that according to perlstyle spaces after the opening parenthesis is recommended for readability. For example if I run perltidy on this code:

if($foo==3) {
    say "Hello";
}

it will insert extra spaces like this:

if ( $foo == 3 ) {
    say "Hello";
}
r39ex commented 8 years ago

Yes, but timtowtdi =). That's why perltidy has an option like --paren-tightness. I would personally write it like this:

if ($foo == 3) {
    say "Hello";
}
renormalist commented 6 years ago

I don't think someone will fix this, and tend to close the issue unless someone objects.