Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Bring "break" statement one tab back in Visual Studio

I know this is really stupid, but it really bothers me that the "break" keyword is tabbed one more than the "case" one:

i.imgur.com/KHdICal.png

Anyone know a plugin or something that could help me?
It wouldn't be right without it, because the colon serves as a type of bracket
[Image: Syr3DlV.png]
i dont even understand why or what you even want but in you can actually join cases together that do the same thing:

case "Hello":
case "other Hello":
//do stuff
break;

in your case they are the same case so just write in once.
you can also merge a multiple cases together with the default case that is run whenever no other condition was met:

case "Hello":
//do stuff for hello
break;
default:
//do for every other
break;

//default can also be used as a fall through if you want to build up stuff you want to do. like a pipeline and in the switch you can choose where you want to enter:

case "do everything":
//stuff
case "some stuff but not everything":
//more stuff
default:
//this stuff is always run
break;

dont know if that answered your question but these are the common ways devs avoid to use multiple blocks or breaks

EDIT:
Sorry i got that completely wrong... but i do understand now what you mean ^^ and yes depending on your ide that is fixable :) im not sure but in vs i think i can remebmre that you are able to change intellisense and indentation options and preferences under the preferences tab... hope im not mistaken there :)
Do you want your break to act as case keyword?

I mean, you want this?
Code
case "tsumino":
break;

than this?
Code
case "tsumino":
     break;
[Image: signaturetwo.png]
break; is a statement and is not necessarily an end-marker of the case block in C#. For example:
PHP Code

<?php 
switch (...)
{
 
  case 0:
 
     if (...) 
 
        break;
 
     // case block continues here.
 
     break;
} 
is valid.

If you want some kind of end marker of the case block, you could add a scope instead using braces. Lots of IDEs allow you to change the default brace layout. Keep in mind you will still need the break statement.
PHP Code

<?php 
switch (...)
{
 
  case 1:
 
  {
 
     ...
 
     break;
 
  }
} 
https://github.com/Washi1337

"I'll tell you this UDP joke, and I don't care if you will get it or not."
You can also write it like this if you want more readability or whatever (you know, each to their own)

[Image: Syr3DlV.png]
(Jul 13, 2019 10:31 PM)Vyxn Wrote:  Do you want your break to act as case keyword?

I mean, you want this?
Code
         case "tsumino":
break;

than this?
Code
         case "tsumino":
    break;

Yep

(Jul 14, 2019 09:32 AM)gigajew Wrote:  You can also write it like this if you want more readability or whatever (you know, each to their own)


Oh suppose that's better.

Thank you.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by brokenheartsJun 30, 2025 01:05 AM 29 1,083 Jun 30, 2025 01:05 AM
Last Post: HOMODIN
[Tutorial] by WhiteTVFeb 17, 2025 08:25 AM 0 114 Feb 17, 2025 08:25 AM
Last Post: WhiteTV
by HackersDec 11, 2024 05:11 PM 21 534 Dec 11, 2024 05:11 PM
Last Post: padrino