469,611 Members | 1,711 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,611 developers. It's quick & easy.

Inserting blank lines breaks lines of code

I have a big VS 2002/2003 annoyance, and wondering if there is a way to turn
it off:

Put your cursor at the start of an indented line of code inside a function.
(right before the first character, not at the left margin) Now press Enter.

It does insert a blank line, but it also moves your cursor 6 characters to
the right, so that it is no longer at the beginning of the statement. If you
press Enter again, you've now busted apart the line of code at a strange
place.

Huge, huge frustration when you want to insert 3 or 4 lines, and you end up
mangling your code.
This works as expected in VB6, and I'm having a hard time breaking the
habit. In VB6, your cursor stays at the same vertical column, and you can
insert multiple lines by hitting Enter repeatedly.

Any solution to this? Anyone know if this behavior is the same in VS 2005?
Thanks!!
Nov 21 '05 #1
3 2332
"BradC" <br********@yahoo.com> schrieb:
I have a big VS 2002/2003 annoyance, and wondering if there is a way to
turn it off:

Put your cursor at the start of an indented line of code inside a
function. (right before the first character, not at the left margin) Now
press Enter.

It does insert a blank line, but it also moves your cursor 6 characters to
the right, so that it is no longer at the beginning of the statement. If
you press Enter again, you've now busted apart the line of code at a
strange place.


I turned pretty listing off...

"Tools" -> "Options..." -> "Text Editor" -> "Basic" -> "VB-specific" -> ...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
I tried that, and one of the other things the "Pretty Listing" feature
provides (recasing) is something I rely on pretty heavily. (I type in all
lower, and then when it capitalizes function names or variables, it is a
subtle visual confirmation that I typed them correctly. Hmm... If I ever
pick up C#, that's gonna be a huge problem for me, right? C# not only
doesn't auto-correct capitalization, it is actually case sensitive and will
error out if function names or variable are not cased right.)

I did find that if switch the "Text Editor -> Basic -> Tabs" option to
"Block" instead of "Smart", it doesn't auto-indent for me, which sorta
solves the problem. Unfortunately, it also means I have to manually do the
indents under IFs or DOs, which is really annoying.

I guess we can point to the automatic "smart" indenting feature as the
culprit, but this still feels like an interface bug to me. Pressing Enter to
go down a line should only indent you IF you are moving inside a block. In
my listed example, you are just moving the current line down a row.

Can anyone confirm if this is still a problem in 2005 ?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e3**************@TK2MSFTNGP15.phx.gbl...
"BradC" <br********@yahoo.com> schrieb:
I have a big VS 2002/2003 annoyance, and wondering if there is a way to
turn it off:

Put your cursor at the start of an indented line of code inside a
function. (right before the first character, not at the left margin) Now
press Enter.

It does insert a blank line, but it also moves your cursor 6 characters
to the right, so that it is no longer at the beginning of the statement.
If you press Enter again, you've now busted apart the line of code at a
strange place.


I turned pretty listing off...

"Tools" -> "Options..." -> "Text Editor" -> "Basic" -> "VB-specific" ->
...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
This problem was gone in Beta of VB Express, have not seen VS 2005 beta but
I would hope that things like this problem would be the same in both.

Lloyd SHeen

"BradC" <br********@yahoo.com> wrote in message
news:et**************@tk2msftngp13.phx.gbl...
I tried that, and one of the other things the "Pretty Listing" feature
provides (recasing) is something I rely on pretty heavily. (I type in all
lower, and then when it capitalizes function names or variables, it is a
subtle visual confirmation that I typed them correctly. Hmm... If I ever
pick up C#, that's gonna be a huge problem for me, right? C# not only
doesn't auto-correct capitalization, it is actually case sensitive and will
error out if function names or variable are not cased right.)

I did find that if switch the "Text Editor -> Basic -> Tabs" option to
"Block" instead of "Smart", it doesn't auto-indent for me, which sorta
solves the problem. Unfortunately, it also means I have to manually do the
indents under IFs or DOs, which is really annoying.

I guess we can point to the automatic "smart" indenting feature as the
culprit, but this still feels like an interface bug to me. Pressing Enter
to go down a line should only indent you IF you are moving inside a block.
In my listed example, you are just moving the current line down a row.

Can anyone confirm if this is still a problem in 2005 ?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e3**************@TK2MSFTNGP15.phx.gbl...
"BradC" <br********@yahoo.com> schrieb:
I have a big VS 2002/2003 annoyance, and wondering if there is a way to
turn it off:

Put your cursor at the start of an indented line of code inside a
function. (right before the first character, not at the left margin) Now
press Enter.

It does insert a blank line, but it also moves your cursor 6 characters
to the right, so that it is no longer at the beginning of the statement.
If you press Enter again, you've now busted apart the line of code at a
strange place.


I turned pretty listing off...

"Tools" -> "Options..." -> "Text Editor" -> "Basic" -> "VB-specific" ->
...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by dan glenn | last post: by
6 posts views Thread by Melissa | last post: by
23 posts views Thread by andrew | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.