Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3440830
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:28:45+00:00 2026-05-18T08:28:45+00:00

Sometimes (but not always!?) when I paste or end a line with a semi-colon,

  • 0

Sometimes (but not always!?) when I paste or end a line with a semi-colon, Visual Studio will add a space after the if statement! For example, when pasting, this

if()

will turn into this:

if (condition)

and, when completing a line, this

if(condition)
    DoSomething()

will turn into this:

if (condition)
    DoSomething();

Having to constantly delete this space (sometimes twice!) is driving me absolutely Bonkers! It seems to happen with if and while but not for.

I cannot find anything relating to this in the VS options. I do have Resharper installed, but it is set to not add the space automatically:
(image of my resharper settings)

Why is Visual Studio punishing me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:28:45+00:00Added an answer on May 18, 2026 at 8:28 am

    In the Visual Studio options, under Text Editor / C# / Formatting / Spacing, in the “Set other spacing options” part, there’s an option for “Insert space after keywords in control flow statements”.

    I suspect you’ll find you’ve got that checked, and you don’t want it to be. (I have it checked deliberately 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I draw a line in a zedgraph pane, but sometimes it will be like
So I'm mapreducing using mongo, and sometimes, but not always, the first element of
This does not always happen, but sometimes when I try to build a (large)
Sometimes my code is returning an a.m. or p.m. but not always. Most of
I embed text in textfield, but sometimes it does not render using htmltext. if
Sometimes I know a file is not so deep away, but a very dense
I am not an idiot, but header files make me feel like one sometimes.
The issue: sometimes, but not every time, Git deletes the static directory of a
Suppose I have a class in which I want to sometimes* (but now always)
I'm using FancyBox on my page, and occasionally (but not always), the lightbox opens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.