Re: [Dev-C++] Tabs vs. spaces in the editor -- by design or a bug? (4.9.9.1)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ray K. <kul...@wr...> - 2004-12-02 05:04:58
|
I've noticed similar behavior. If I type the following (text in angle
brackets are keypresses; everything else is a literal string)...
int test() {<enter>
if (test2())<enter>
<tab>return 1;<enter>
<backspace>else<enter>
<tab>return 0;<enter>
}
...I get this output:
int test() {
if (test2())
return 1;
else
return 0;
}
This is with four-space tabs, "use tab character" on, and "smart tabs" off.
It autoindents after the first time I hit enter, inserting a tab. Then I
type
a line and manually enter another tab and some text, but that tab gets
converted to four spaces. When I hit enter again, it remains indented to
the
level of "return 1;", so I hit backspace. At this point, it puts me on a
new
line with no tabs and ONE space. I type else, hit enter, and indent
another
level with the tab key. This time it inserts only three spaces, bringing it
up to four total. (since it kept the extra space from the previous line.)
If I insert braces to go with the if/else statements, the autoindenting
works
perfectly, and no spaces are inserted where there should be tabs. The odd
behavior only shows up when the braces are left out.
"Len Philpot" <le...@ph...> wrote:
> Maybe I'm just missing it here :-), but this doesn't seem to work
> properly, IMO.
>
> For example, on the Editor Options dialog, I have "Use Tab Character"
> enabled, as well as "Show hidden line characters" so I can see what's
> happening (my Tab Size is 4, BTW)...
>
> 1. In the editor, if I go to a blank line and simply hit Tab a fewtimes,
> the caret jumps out past EOL into virtual space until I hit an
> alphanumeric key, when it fills the space with tabs. If I delete that
> character, all the leading tabs disappear as well.
>
> 2. If I go to the end of an existing line and do the same, thevirtual
> space is filled with spaces, no matter the Use Tab Charactersetting. If
> I delete that character, the leading spaces remain.
|