Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix continued expression indentation when cperl-indent-parens-as-block in effect #20

Merged
merged 1 commit into from

2 participants

@dev97

When cperl-indent-parens-as-block is in effect, expressions are indented incorrectly:

if ($var1 == 1 &&
      $var2 == 2 &&
      $var3 == 3) {
  ...
}

this patch fixes the indentation:

if ($var1 == 1 &&
    $var2 == 2 &&
    $var3 == 3) {
  ...
}

I'm working with this patch applied over one month and I didn't notice negative side effects.
Please test it and apply to upstream.

@dev97 dev97 fix continued expression indentation when cperl-indent-parens-as-bloc…
…k in effect

When cperl-indent-parens-as-block is in effect, expressions are indented
incorectly:

if ($var1 == 1 &&
      $var2 == 2 &&
      $var3 == 3) {
  ...
}

this patch fixes the indentation:

if ($var1 == 1 &&
    $var2 == 2 &&
    $var3 == 3) {
  ...
}
f91da31
@renormalist renormalist merged commit b0ff883 into jrockway:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2014
  1. @dev97

    fix continued expression indentation when cperl-indent-parens-as-bloc…

    dev97 authored
    …k in effect
    
    When cperl-indent-parens-as-block is in effect, expressions are indented
    incorectly:
    
    if ($var1 == 1 &&
          $var2 == 2 &&
          $var3 == 3) {
      ...
    }
    
    this patch fixes the indentation:
    
    if ($var1 == 1 &&
        $var2 == 2 &&
        $var3 == 3) {
      ...
    }
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  cperl-mode.el
View
2  cperl-mode.el
@@ -2929,6 +2929,8 @@ Will not look before LIM."
(cperl-backward-to-noncomment containing-sexp))
;; Now we get non-label preceeding the indent point
(if (not (or (eq (1- (point)) containing-sexp)
+ (and cperl-indent-parens-as-block
+ (not is-block))
(memq (preceding-char)
(append (if is-block " ;{" " ,;{") '(nil)))
(and (eq (preceding-char) ?\})
Something went wrong with that request. Please try again.