Tabs and Indents

L

Laurence

In VS.2005, using VB.NET

My editor is behaving strangely.

If I press the tab key, the line moves over the appropriate
number of spaces. When I click on another line, the line that I had tab'd on
moves over more spaces.

I have changed the tab and insert, but it doesn't seem to work.

The help says:

Indent size
Sets the size in spaces of an automatic indentation. The default is four spaces. Tab characters, space characters, or both
will be inserted to fill the specified size.

What does this mean? What is an "Automatic indentation?"
Is that a tab?
What exactly is the difference between tab and automatic indentation,
do they influence one another.

Thanks in Advance,

Laurence

'--------------------------------------------------------------------------------------------------------------------

Indenting
None
When selected, new lines are not indented. The insertion point is placed in the first column of a new line.

Block
When selected, new lines are automatically indented. The insertion point is placed at the same starting point as the
preceding line.

Smart
When selected, new lines are positioned to fit the code context, per other code formatting settings and IntelliSense
conventions for your development language. This option is not available for all development languages.

For example, lines enclosed between an opening brace ( { ) and a closing brace ( } ) might automatically be indented an extra
tab stop from the position of the aligned braces.

Tabs
Tab size
Sets the distance in spaces between tab stops. The default is four spaces.

Indent size
Sets the size in spaces of an automatic indentation. The default is four spaces. Tab characters, space characters, or both
will be inserted to fill the specified size.

Insert spaces
When selected, indent operations insert only space characters, not TAB characters. If the Indent size is set to 5, for
example, then five space characters are inserted whenever you press the TAB key or the Increase Indent button on the
Formatting toolbar.

Keep tabs
When selected, indent operations insert as many TAB characters as possible. Each TAB character fills the number of spaces
specified in Tab size. If the Indent size is not an even multiple of the Tab size, space characters are added to fill in the
difference.
 
K

Kevin Spencer

What does this mean? What is an "Automatic indentation?"
Is that a tab?
What exactly is the difference between tab and automatic indentation,
do they influence one another.

Automatic indentation is the indentation that VS creates automatically when
you write code in the editor. A Tab is a preset space of one or more
characters that are inserted when the TAB key is pressed. Automatic
indentation can use tabs or spaces. That is, for example, if you go to a new
line in your code, according to the rules of automatic indentation, 5 space
characters or, perhaps 1 tab character will be inserted (if the size of the
tab is set to 5).

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

It takes a tough man to make a tender chicken salad.
 
L

Larry

The tools options panel has
an item under Text Edit,
Basic,

it has General
Tabs
VB specific

When I click on the Tabs item, I get a panel on the left that includes
selections for indenting and tabs.

The top group box has an options for indenting, (None, Block, Smart)
and then the Tab group box has an indent option also.

If they are separate things, then why is indenting and tabs in the same panel?

What is the Indent size for in the Tab Group box?
Isn't the Indent taken care of in the Indenting group Box?

No matter what I do, when I hit the enter key,
the line I was on gets moved over to the right.

Thanks in Advance,

Laurence
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top