Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. How to prevent smart editing

How to prevent smart editing

Scheduled Pinned Locked Moved Visual Studio
tutorialquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NetDave
    wrote on last edited by
    #1

    Arrrgghhh! I'm sooo frustrated! I have a construct like this:

    if(something)
    {
    ...
    }
    else
    {
    ...
    }

    And I want to add a comment after the else, thusly:

    if(something)
    {
    ...
    }
    else<tab>//comment
    {
    ...
    }

    As soon as I hit the @$^*(#!+ Tab key, the editor decides to do this:

    if(something)
    {
    ...
    }
    else
    {
    <tab>
    }//comment
    {
    ...
    }

    Usually when the editor reformats things, if you hit Delete, it gives you back what you wanted in the first place, but not in this case. :mad: I have tried every (I think) editor option to prevent it from doing this and haven't figured out how to disable this behavior yet. Does anyone know how to overcome this stupid "smart" feature?

    QRZ? de WAØTTN

    H L 2 Replies Last reply
    0
    • N NetDave

      Arrrgghhh! I'm sooo frustrated! I have a construct like this:

      if(something)
      {
      ...
      }
      else
      {
      ...
      }

      And I want to add a comment after the else, thusly:

      if(something)
      {
      ...
      }
      else<tab>//comment
      {
      ...
      }

      As soon as I hit the @$^*(#!+ Tab key, the editor decides to do this:

      if(something)
      {
      ...
      }
      else
      {
      <tab>
      }//comment
      {
      ...
      }

      Usually when the editor reformats things, if you hit Delete, it gives you back what you wanted in the first place, but not in this case. :mad: I have tried every (I think) editor option to prevent it from doing this and haven't figured out how to disable this behavior yet. Does anyone know how to overcome this stupid "smart" feature?

      QRZ? de WAØTTN

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      If I remember correctly the else autocomplete feature is enabled by a code snippet el, you could remove it. Or was that not what you were meaning?

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      N 1 Reply Last reply
      0
      • N NetDave

        Arrrgghhh! I'm sooo frustrated! I have a construct like this:

        if(something)
        {
        ...
        }
        else
        {
        ...
        }

        And I want to add a comment after the else, thusly:

        if(something)
        {
        ...
        }
        else<tab>//comment
        {
        ...
        }

        As soon as I hit the @$^*(#!+ Tab key, the editor decides to do this:

        if(something)
        {
        ...
        }
        else
        {
        <tab>
        }//comment
        {
        ...
        }

        Usually when the editor reformats things, if you hit Delete, it gives you back what you wanted in the first place, but not in this case. :mad: I have tried every (I think) editor option to prevent it from doing this and haven't figured out how to disable this behavior yet. Does anyone know how to overcome this stupid "smart" feature?

        QRZ? de WAØTTN

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, you can control the auto-formatting to a large extent. See menu Tools/Options/TextEditor/C#/Formatting :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


        1 Reply Last reply
        0
        • H Henry Minute

          If I remember correctly the else autocomplete feature is enabled by a code snippet el, you could remove it. Or was that not what you were meaning?

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          N Offline
          N Offline
          NetDave
          wrote on last edited by
          #4

          Henry Minute wrote:

          If I remember correctly the else autocomplete feature is enabled by a code snippet el

          I'm not sure exactly what you meant here, but it gave me an idea. I changed the "else" to "elsex", which disabled the autoformatting so that I could add my tab and comment, then I went back and removed the "x". It's pretty kludgy, but it works. I don't know if this is what you had in mind, but thanks for the idea! I don't mind a couple of extra keystrokes, the tradeoff being testing every stinkin' autoformat option in the editor settings. :mad:

          QRZ? de WAØTTN

          H 1 Reply Last reply
          0
          • N NetDave

            Henry Minute wrote:

            If I remember correctly the else autocomplete feature is enabled by a code snippet el

            I'm not sure exactly what you meant here, but it gave me an idea. I changed the "else" to "elsex", which disabled the autoformatting so that I could add my tab and comment, then I went back and removed the "x". It's pretty kludgy, but it works. I don't know if this is what you had in mind, but thanks for the idea! I don't mind a couple of extra keystrokes, the tradeoff being testing every stinkin' autoformat option in the editor settings. :mad:

            QRZ? de WAØTTN

            H Offline
            H Offline
            Henry Minute
            wrote on last edited by
            #5

            In that case try else[space][tab]// comment Saves having to go back and delete the 'x'. :)

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            N 1 Reply Last reply
            0
            • H Henry Minute

              In that case try else[space][tab]// comment Saves having to go back and delete the 'x'. :)

              Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

              N Offline
              N Offline
              NetDave
              wrote on last edited by
              #6

              Henry Minute wrote:

              else[space][tab]// comment

              Excellent! Thank you sir! :thumbsup:

              QRZ? de WAØTTN

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups