开发者

How do I prevent Visual Basic 2008 from automatically indenting namespaces?

开发者 https://www.devze.com 2022-12-15 06:23 出处:网络
Is there a way to prevent this from happening? Namespace testing Public Module TestModule Public testobj As New test

Is there a way to prevent this from happening?

Namespace testing
    Public Module TestModule
        Public testobj As New test
    End Module
End Namespace

It is extremely annoying to have to start out two tabs to the right on new code. Is there anyway to disable auto-inde开发者_开发百科nting just for namespace declarations in visual studio 2008?


There is no setting for turning off specific block type indentations. (There is a setting for C# to turn off block indenting altogether, but again, not specific to certain block types like namespace blocks).

You shouldn't need to hit tab twice though - when you press "enter" on a line of code, it should automatically indent you to where the last line was indented to.

And no matter how you type in your code, it's just a quick keystroke to auto-format the whole document (Ctrl-K followed by Ctrl-D). So you can ignore idents until you're done typing and then auto-format.

0

精彩评论

暂无评论...
验证码 换一张
取 消