Skip to content

Conversation

@utix
Copy link
Contributor

@utix utix commented Mar 3, 2015

  • Multi case
  • half indent for case
  • indent when typing : in case
  • use cinoptions configuration : and =

case is now use as a block delimiter
#195 should be fixed

Before:

switch(name) {
    case 1:
        break;
    case 2:
        a = b;
    foo();
    bar();
    break;
    case 4:
        case 3:
        if (true) {
        foo();
    }
    bar();
    c = d;
    break;
    default:
        foo();
    break;
}

After:

switch(name) { 
    case 1: 
        break; 
    case 2: 
        a = b; 
        foo(); 
        bar(); 
        break; 
    case 4: 
    case 3: 
        if (true) { 
            foo(); 
        } 
        bar(); 
        c = d; 
        break; 
    default: 
        foo(); 
        break; 
} 

with set cinoptions+=:2,=2

switch(name) {
  case 1:
    break;
  case 2:
    a = b;
    foo();
    bar();
    break;
  case 4:
  case 3:
    if (true) {
        foo();
    }
    bar();
    c = d;
    break;
  default:
    foo();
    break;
}

with set cinoptions+=:0,=4

switch(name) { 
case 1:  
    break; 
case 2:  
    a = b;  
    foo(); 
    bar(); 
    break; 
case 4:  
case 3:  
    if (true) { 
        foo(); 
    }   
    bar(); 
    c = d;  
    break; 
default: 
    foo(); 
    break; 
} 

@utix
Copy link
Contributor Author

utix commented Mar 16, 2015

Do I need to improve my commits ?
Have you tested it ?

@aaronjensen
Copy link

fwiw, I tested this and it works well.

utix added 2 commits July 23, 2015 18:18
* Multi case
* half indent for case
* indent when typing : in case

case is now use as a block delimiter

Before:

switch(name) {
    case 1:
        break;
    case 2:
        a = b;
    foo();
    bar();
    break;
    case 4:
        case 3:
        if (true) {
        foo();
    }
    bar();
    c = d;
    break;
    default:
        foo();
    break;
}

After:

switch(name) {
  case 1:
    break;
  case 2:
    a = b;
    foo();
    bar();
    break;
  case 4:
  case 3:
    if (true) {
        foo();
    }
    bar();
    c = d;
    break;
  default:
    foo();
    break;
}
:N    Place case labels N characters from the indent of the switch().
            (default 'shiftwidth').

=N    Place statements occurring after a case label N characters from
            the indent of the label.  (default 'shiftwidth').

(Same as default cindent)
@utix
Copy link
Contributor Author

utix commented Jul 23, 2015

I have rebased my work, merge is now fixed

goatslacker added a commit that referenced this pull request Jul 23, 2015
@goatslacker goatslacker merged commit 3d91f81 into pangloss:develop Jul 23, 2015
@goatslacker
Copy link
Collaborator

thanks!

@netei
Copy link

netei commented Sep 22, 2015

Hi, I happen to have the same issue, however, this wasn't merged into master (yet). Can you merge it ?

@qstrahl
Copy link
Collaborator

qstrahl commented Sep 22, 2015

Is this not in master yet? If not we should really do a merge.

On Tue, 22 Sep 2015 05:05 netei notifications@github.com wrote:

Hi, I happen to have the same issue, however, this wasn't merged into
master (yet). Can you merge it ?


Reply to this email directly or view it on GitHub
#250 (comment)
.

@netei
Copy link

netei commented Sep 23, 2015

The latest commit on master is on Jun 15, this merge request has been merged in July

@qstrahl
Copy link
Collaborator

qstrahl commented Sep 23, 2015

Okay, I'll call for a merge into master. See #304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants