Problem with VS2008 editor: How to force insert of tab

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Red

    Problem with VS2008 editor: How to force insert of tab

    If auto-format is turned off in VS2008, there is apparently no way to
    indent a line. Under Tools->Options->Text Editor->C#->Formatting,
    there are three checkboxes. Unchecking those seems to cause this
    behavior.

    I'd simply like to have the tab key insert a tab at the beginning of a
    line. I believe that there were publlished macros for doing this in
    earlier VS versions, but I expected this to be 'fixed' in VS2008. Yes,
    I realize someone will say this is a feature, but it seems reasonable
    to be able to simply insert a tab when required.
  • Red

    #2
    Re: Problem with VS2008 editor: How to force insert of tab

    On Mon, 14 Apr 2008 03:05:16 -0400, Red <red@nospam.com wrote:
    >If auto-format is turned off in VS2008, there is apparently no way to
    >indent a line. Under Tools->Options->Text Editor->C#->Formatting,
    >there are three checkboxes. Unchecking those seems to cause this
    >behavior.
    >
    >I'd simply like to have the tab key insert a tab at the beginning of a
    >line. I believe that there were publlished macros for doing this in
    >earlier VS versions, but I expected this to be 'fixed' in VS2008. Yes,
    >I realize someone will say this is a feature, but it seems reasonable
    >to be able to simply insert a tab when required.
    No word on this? I am not sure whether to log this with Microsoft, as
    I'm sure they'll say it's a 'feature.' But givent that turning those
    three checkboxes off seems to render the editor unusable, it would
    seem like it.

    Has anyone got a workaround or more info?

    Comment

    • Chris Dunaway

      #3
      Re: Problem with VS2008 editor: How to force insert of tab

      On Apr 15, 12:56 am, Red <r...@nospam.co mwrote:
      On Mon, 14 Apr 2008 03:05:16 -0400, Red <r...@nospam.co mwrote:
      If auto-format is turned off in VS2008, there is apparently no way to
      indent a line. Under Tools->Options->Text Editor->C#->Formatting,
      there are three checkboxes. Unchecking those seems to cause this
      behavior.
      >
      I'd simply like to have the tab key insert a tab at the beginning of a
      line. I believe that there were publlished macros for doing this in
      earlier VS versions, but I expected this to be 'fixed' in VS2008. Yes,
      I realize someone will say this is a feature, but it seems reasonable
      to be able to simply insert a tab when required.
      >
      No word on this? I am not sure whether to log this with Microsoft, as
      I'm sure they'll say it's a 'feature.' But givent that turning those
      three checkboxes off seems to render the editor unusable, it would
      seem like it.
      >
      Has anyone got a workaround or more info?
      Have you tried the settings under Tools->Options->Text Editor->C#-
      >Tabs? Perhaps these will get you what you want.
      Chris

      Comment

      • Red

        #4
        Re: Problem with VS2008 editor: How to force insert of tab

        On Tue, 15 Apr 2008 07:21:44 -0700 (PDT), Chris Dunaway
        <dunawayc@gmail .comwrote:
        >On Apr 15, 12:56 am, Red <r...@nospam.co mwrote:
        >On Mon, 14 Apr 2008 03:05:16 -0400, Red <r...@nospam.co mwrote:
        >If auto-format is turned off in VS2008, there is apparently no way to
        >indent a line. Under Tools->Options->Text Editor->C#->Formatting,
        >there are three checkboxes. Unchecking those seems to cause this
        >behavior.
        >>
        >I'd simply like to have the tab key insert a tab at the beginning of a
        >line. I believe that there were publlished macros for doing this in
        >earlier VS versions, but I expected this to be 'fixed' in VS2008. Yes,
        >I realize someone will say this is a feature, but it seems reasonable
        >to be able to simply insert a tab when required.
        >>
        >No word on this? I am not sure whether to log this with Microsoft, as
        >I'm sure they'll say it's a 'feature.' But givent that turning those
        >three checkboxes off seems to render the editor unusable, it would
        >seem like it.
        >>
        >Has anyone got a workaround or more info?
        >
        >Have you tried the settings under Tools->Options->Text Editor->C#-
        >>Tabs? Perhaps these will get you what you want.
        >
        >Chris
        Hi Chris,

        Thanks for your reply. The 'tabs' settings do not have any affect,
        since the editor enforces its own notion of indentation. That notion,
        in this case, seems to be keeping all code at the very left side of
        the page. IOW, tabs are disabled.

        Surely there must be some option that would override that behavior,
        but I haven't found it. That's why it seems like a bug, for lack of a
        better term.

        Comment

        • Mythran

          #5
          Re: Problem with VS2008 editor: How to force insert of tab



          "Red" <Red@nospam.com wrote in message
          news:o4m904d6po 8ljr7g33ghdi1ta rchjibufa@4ax.c om...
          On Tue, 15 Apr 2008 07:21:44 -0700 (PDT), Chris Dunaway
          <dunawayc@gmail .comwrote:
          >
          >>On Apr 15, 12:56 am, Red <r...@nospam.co mwrote:
          >>On Mon, 14 Apr 2008 03:05:16 -0400, Red <r...@nospam.co mwrote:
          >>If auto-format is turned off in VS2008, there is apparently no way to
          >>indent a line. Under Tools->Options->Text Editor->C#->Formatting,
          >>there are three checkboxes. Unchecking those seems to cause this
          >>behavior.
          >>>
          >>I'd simply like to have the tab key insert a tab at the beginning of a
          >>line. I believe that there were publlished macros for doing this in
          >>earlier VS versions, but I expected this to be 'fixed' in VS2008. Yes,
          >>I realize someone will say this is a feature, but it seems reasonable
          >>to be able to simply insert a tab when required.
          >>>
          >>No word on this? I am not sure whether to log this with Microsoft, as
          >>I'm sure they'll say it's a 'feature.' But givent that turning those
          >>three checkboxes off seems to render the editor unusable, it would
          >>seem like it.
          >>>
          >>Has anyone got a workaround or more info?
          >>
          >>Have you tried the settings under Tools->Options->Text Editor->C#-
          >>>Tabs? Perhaps these will get you what you want.
          >>
          >>Chris
          >
          Hi Chris,
          >
          Thanks for your reply. The 'tabs' settings do not have any affect,
          since the editor enforces its own notion of indentation. That notion,
          in this case, seems to be keeping all code at the very left side of
          the page. IOW, tabs are disabled.
          >
          Surely there must be some option that would override that behavior,
          but I haven't found it. That's why it seems like a bug, for lack of a
          better term.
          >
          I have all three options unchecked, and that's how I've been developing.
          Tabs work fine for me.

          Mythran


          Comment

          • Red

            #6
            Re: Problem with VS2008 editor: How to force insert of tab

            On Tue, 15 Apr 2008 08:46:21 -0700, "Mythran" <kip_potter@hot mail.com>
            wrote:
            >
            >"Red" <Red@nospam.com wrote in message
            >>>On Apr 15, 12:56 am, Red <r...@nospam.co mwrote:
            >>>On Mon, 14 Apr 2008 03:05:16 -0400, Red <r...@nospam.co mwrote:
            >>>If auto-format is turned off in VS2008, there is apparently no way to
            >>>indent a line. Under Tools->Options->Text Editor->C#->Formatting,
            >>>there are three checkboxes. Unchecking those seems to cause this
            >>>behavior.
            >>>>
            >>>I'd simply like to have the tab key insert a tab at the beginning of a
            >>>line. I believe that there were publlished macros for doing this in
            >>>earlier VS versions, but I expected this to be 'fixed' in VS2008.
            >I have all three options unchecked, and that's how I've been developing.
            >Tabs work fine for me.
            Hi Mythran,

            Thanks for your reply! That's what I was waiting to hear (or not!).
            Just to clarify my post, here is what I refer to... If I create a new
            empty project and insert the following lines, they cannot be indented
            by inserting a tab in front of them:

            -----------------------------------------------------------------------------------

            namespace Test
            {
            public partial class Form1 : Form
            {
            int q = 12;
            int y = 12;
            int z = 234;

            ----------------------------------------------------------------------------------

            IOW, any inserted statement is kept at the left side (when the
            auto-indent options are turned off).

            If you don't have this problem with VS2008, then there must be a
            difference between our editor options. I've copied all my settings
            below. Do you see any differences from yours?

            Editor settings follow. Looks long but I think it's only 5 pages::
            --------------------------------------------------------------------------------

            Tools->Options:
            Environment:
            Keyboard: Emacs
            Text Editor:
            C#:
            General:
            Statemment completion:
            [x] Auto list members
            [ ] Hide advanced members
            [x] Parameter information
            Settings:
            [ ] Enable Virtual space
            [ ] Word wrap
            [x] Apply Cut/Copy commands to blank lines when no
            selection
            Display:
            [ ] Line Numbers
            [x] Enable single-click URL navigation
            [x] Navigation bar
            Tabs:
            Indenting:
            ( ) None
            ( ) Block
            ( ) Smart
            Tab:
            Tab Size: 4
            Indent Size: 4
            ( ) Insert spaces
            (x) Keep tabs
            Advanced:
            Outlining:
            [x] Enter outlining mode when files open
            Editor Help:
            [x] Underline errors in the editor
            Refactoring:
            [ ] Warn if build errors exist when refactoring
            [x] Warn on members with compiler generated references
            XML Documentation Comments:
            [x] Generate XML documentation comments for ///
            Implement Interface:
            [x] Surrund generated code with #region
            Organize Usings:
            [x] Warn if build errors exist when organizing usings
            [x] Place 'System' directives first when sorting
            usings
            Formatting:
            General: (all three below were checked by default)
            [x] Automatically format completed statement on ;
            [x] Automatically format completed statement on }
            [x] Adjust indentation on paste
            Indentation:
            [x] Indent block contents
            [ ] Indent open and close braces
            [x] Indent case contents
            [ ] Indent case labels
            Label Indentation:
            ( ) Place goto labels in leftmost column
            (x) Place goto labels one indent less than current
            ( ) Indent labels normally
            New Lines:
            New line options for braces:
            [x] Place open brace on new line for types
            [x] Place open brace on new line for methods
            [x] Place open brace on new line for anonymous
            methods
            [ ] Place open brace on new line for control
            blocks
            [x] Place open brace on new line for anonymous
            types
            [x] Place open brace on new line for object
            initializers
            [x] Place open brace on new line for lambda
            expressions
            New line options for keywords:
            [ ] Place 'else' on new line
            [ ] Place 'catch' on new line
            [ ] Place 'finally' on new line
            New line options for expressions:
            [x] Place members in object initializers on new
            line
            [x] Place members in anonymous types on new line
            [x] Place query expression clauses on new line
            Spacing:
            (all unchecked except...)
            Set other spacing options:
            [x] Insert space after keywords in control flow
            statements
            [?] Ignore spaces in delaration statements
            Set spacing for delimiters:
            [x] Insert space after colon for base or interface
            in type..
            [x] Insert space after comma
            [ ] Insert space after dot
            [x] Insert space afer semicolon in "for" stateent
            [x] Insert space before colon for base ...in type
            decl.
            [ ] Insert space before comma
            [ ] Insert space before dot
            [ ] Insert space before semicolonn in "for"
            statement
            Wrapping:
            [x] Leave block on single line
            [ ] Leave statements and member declarations on the
            same line
            IntelliSense:
            Completion Lists:
            [x] Show completion list after a character is typed
            Selection in Completion List:
            Committed by typing the following characters:
            {}[]().,:;+-*/%&|^!~=<>?@#' "\
            [x] Committed by pressing the space bar
            [ ] Add new line on commit with enter at end of fully
            typed word
            Intellisense Member Selection
            [x] IntelliSense pre-selects most recently used
            members

            Comment

            • Mythran

              #7
              Re: Problem with VS2008 editor: How to force insert of tab



              "Red" <red@nospam.com wrote in message
              news:2lmd04t22v 106f861f2lm1ou6 6ov4c4dhe@4ax.c om...
              On Tue, 15 Apr 2008 08:46:21 -0700, "Mythran" <kip_potter@hot mail.com>
              wrote:
              >
              >>
              >>"Red" <Red@nospam.com wrote in message
              >
              >>>>On Apr 15, 12:56 am, Red <r...@nospam.co mwrote:
              >>>>On Mon, 14 Apr 2008 03:05:16 -0400, Red <r...@nospam.co mwrote:
              >
              >>>>If auto-format is turned off in VS2008, there is apparently no way to
              >>>>indent a line. Under Tools->Options->Text Editor->C#->Formatting,
              >>>>there are three checkboxes. Unchecking those seems to cause this
              >>>>behavior.
              >>>>>
              >>>>I'd simply like to have the tab key insert a tab at the beginning of
              >>>>a
              >>>>line. I believe that there were publlished macros for doing this in
              >>>>earlier VS versions, but I expected this to be 'fixed' in VS2008.
              >
              >>I have all three options unchecked, and that's how I've been developing.
              >>Tabs work fine for me.
              >
              Hi Mythran,
              >
              Thanks for your reply! That's what I was waiting to hear (or not!).
              Just to clarify my post, here is what I refer to... If I create a new
              empty project and insert the following lines, they cannot be indented
              by inserting a tab in front of them:
              >
              -----------------------------------------------------------------------------------
              >
              namespace Test
              {
              public partial class Form1 : Form
              {
              int q = 12;
              int y = 12;
              int z = 234;
              >
              ----------------------------------------------------------------------------------
              >
              IOW, any inserted statement is kept at the left side (when the
              auto-indent options are turned off).
              >
              If you don't have this problem with VS2008, then there must be a
              difference between our editor options. I've copied all my settings
              below. Do you see any differences from yours?
              >
              Editor settings follow. Looks long but I think it's only 5 pages::
              --------------------------------------------------------------------------------
              >
              Tools->Options:
              Environment:
              Keyboard: Emacs
              Text Editor:
              C#:
              General:
              Statemment completion:
              [x] Auto list members
              [ ] Hide advanced members
              [x] Parameter information
              Settings:
              [ ] Enable Virtual space
              [ ] Word wrap
              [x] Apply Cut/Copy commands to blank lines when no
              selection
              Display:
              [ ] Line Numbers
              [x] Enable single-click URL navigation
              [x] Navigation bar
              Tabs:
              Indenting:
              ( ) None
              ( ) Block
              ( ) Smart
              Tab:
              Tab Size: 4
              Indent Size: 4
              ( ) Insert spaces
              (x) Keep tabs
              Advanced:
              Outlining:
              [x] Enter outlining mode when files open
              Editor Help:
              [x] Underline errors in the editor
              Refactoring:
              [ ] Warn if build errors exist when refactoring
              [x] Warn on members with compiler generated references
              XML Documentation Comments:
              [x] Generate XML documentation comments for ///
              Implement Interface:
              [x] Surrund generated code with #region
              Organize Usings:
              [x] Warn if build errors exist when organizing usings
              [x] Place 'System' directives first when sorting
              usings
              Formatting:
              General: (all three below were checked by default)
              [x] Automatically format completed statement on ;
              [x] Automatically format completed statement on }
              [x] Adjust indentation on paste
              Indentation:
              [x] Indent block contents
              [ ] Indent open and close braces
              [x] Indent case contents
              [ ] Indent case labels
              Label Indentation:
              ( ) Place goto labels in leftmost column
              (x) Place goto labels one indent less than current
              ( ) Indent labels normally
              New Lines:
              New line options for braces:
              [x] Place open brace on new line for types
              [x] Place open brace on new line for methods
              [x] Place open brace on new line for anonymous
              methods
              [ ] Place open brace on new line for control
              blocks
              [x] Place open brace on new line for anonymous
              types
              [x] Place open brace on new line for object
              initializers
              [x] Place open brace on new line for lambda
              expressions
              New line options for keywords:
              [ ] Place 'else' on new line
              [ ] Place 'catch' on new line
              [ ] Place 'finally' on new line
              New line options for expressions:
              [x] Place members in object initializers on new
              line
              [x] Place members in anonymous types on new line
              [x] Place query expression clauses on new line
              Spacing:
              (all unchecked except...)
              Set other spacing options:
              [x] Insert space after keywords in control flow
              statements
              [?] Ignore spaces in delaration statements
              Set spacing for delimiters:
              [x] Insert space after colon for base or interface
              in type..
              [x] Insert space after comma
              [ ] Insert space after dot
              [x] Insert space afer semicolon in "for" stateent
              [x] Insert space before colon for base ...in type
              decl.
              [ ] Insert space before comma
              [ ] Insert space before dot
              [ ] Insert space before semicolonn in "for"
              statement
              Wrapping:
              [x] Leave block on single line
              [ ] Leave statements and member declarations on the
              same line
              IntelliSense:
              Completion Lists:
              [x] Show completion list after a character is typed
              Selection in Completion List:
              Committed by typing the following characters:
              {}[]().,:;+-*/%&|^!~=<>?@#' "\
              [x] Committed by pressing the space bar
              [ ] Add new line on commit with enter at end of fully
              typed word
              Intellisense Member Selection
              [x] IntelliSense pre-selects most recently used
              members
              >
              After reviewing the tab issue, I found that it seems to only apply to the
              Emacs schema. I checked the Edit.InsertTab command and it does show as
              "Tab" for Emacs, but it just doesn't insert the tab. I also checked other
              various settings and couldn't find one that allowed the Emacs scheme to
              successfully insert the tab...quite strange...

              Mythran


              Comment

              • Red

                #8
                Re: Problem with VS2008 editor: How to force insert of tab

                On Thu, 17 Apr 2008 09:27:27 -0700, "Mythran" <kip_potter@hot mail.com>
                wrote:
                >After reviewing the tab issue, I found that it seems to only apply to the
                >Emacs schema. I checked the Edit.InsertTab command and it does show as
                >"Tab" for Emacs, but it just doesn't insert the tab. I also checked other
                >various settings and couldn't find one that allowed the Emacs scheme to
                >successfully insert the tab...quite strange...
                >
                >Mythran
                Hi Mythran,

                Are you using Emacs? That is my usual editor. Unfortunately this
                happens with both the regular C# editor and with Emacs. With VS2005,
                there were macros that were designed to fix problems like this. But I
                thought that by 2008 they may have addressed them (plenty of reports
                on the MS website).

                Also, I don't quite follow your comment. Did the tab key not work for
                you after all? I was referring to entering tabs at the start of a
                line, as in the code I had posted. Does that work for you? If not,
                then how are you getting your code indented?

                (Again, thanks for your reply. Maybe this will eventually solve a
                problem for you as well, if you're using Emacs emu).

                Comment

                • Red

                  #9
                  Re: Problem with VS2008 editor: How to force insert of tab

                  On Thu, 17 Apr 2008 21:21:09 -0500, Red <Red@nospam.com wrote:
                  >On Thu, 17 Apr 2008 09:27:27 -0700, "Mythran" <kip_potter@hot mail.com>
                  >wrote:
                  >
                  >>After reviewing the tab issue, I found that it seems to only apply to the
                  >>Emacs schema. I checked the Edit.InsertTab command and it does show as
                  >>"Tab" for Emacs, but it just doesn't insert the tab. I also checked other
                  >>various settings and couldn't find one that allowed the Emacs scheme to
                  >>successfull y insert the tab...quite strange...
                  >>
                  >>Mythran
                  >
                  >Hi Mythran,
                  >
                  >Are you using Emacs? That is my usual editor. Unfortunately this
                  >happens with both the regular C# editor and with Emacs. With VS2005,
                  >there were macros that were designed to fix problems like this. But I
                  >thought that by 2008 they may have addressed them (plenty of reports
                  >on the MS website).
                  >
                  >Also, I don't quite follow your comment. Did the tab key not work for
                  >you after all? I was referring to entering tabs at the start of a
                  >line, as in the code I had posted.
                  .....

                  Sorry...I read your reply again and realized that you are probably not
                  using Emacs keyboard mapping. But I also rechecked various other
                  mapping options (C#2005, Visual Studio, etc) and none of them will
                  insert a tab for me.

                  So even in non-Emacs configuration there is still something different
                  between the way our VS2008's are working, Apparently that difference
                  is not showing up in the options menu. Sad that this was not fixed in
                  VS2008.

                  Comment

                  Working...