Increase Indent, or TAB, respecting my intentation (long)

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
ptoniolo
Posts: 3
Joined: Mon Sep 29, 2003 12:55 pm

Increase Indent, or TAB, respecting my intentation (long)

Post by ptoniolo »

When I use the Increase Indent toolbar command (or just hitting TAB on a block of selected text), TextPad 4.7.1 not only adds a TAB char to any row selected, but also converts the spaces at the beginning of the same rows in TABs.

I generally use a mixed approach during the indent of my texts, sometimes I need a tab (when indenting an embedded structure, for example) and sometimes I need a bunch of true spaces (for example when I have to put text in "columns" under previous lines.

If TP changes my spaces in TABs I cannot guarantee a correct rendering on different TAB-viewing media, for example e-mail readers, or printers.

Here is an example: I use to format my SQL commands this way:

Code: Select all

select one
      ,two
      ,three
from tab1
    ,tab2
where cond1
  and cond2
;
Note that the second line starts with exactly 6 blanks, and, with a non-proportional font, this puts the "t" of "two" just under the "o" of "one".

Well, if my tab spacing is set to 4, when I indent this block, the second line starts with TAB (the indent requested) TAB (the first 4 blanks converted!) and the two remaining blanks (there were 6, remember?). This is not the behaviour I need, I do not want TP to convert the spaces in the text, but only append a TAB at the beginning of the line, leaving the content unchanged.

BTW, I am sure that a previous version of TP was behaving the other way, "respecting" the previous intentation literally.

Is there any option I can setup to restore the behavior I need? I know I can avoid tabs and convert every TAB to space, but I need TABS, I do not want to have train of spaces (a-la VB) used to indent embedded structures.

Thanx
Pietro
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Have you unchecked "Convert New tabs to Spaces" and
"Convert Existing Tabs to Spaces When Saving Files" for the
relevant document class?
Then I open up and see
the person fumbling here is me
a different way to be
ptoniolo
Posts: 3
Joined: Mon Sep 29, 2003 12:55 pm

Post by ptoniolo »

s_reynisson wrote:Have you unchecked "Convert New tabs to Spaces" and
"Convert Existing Tabs to Spaces When Saving Files" for the
relevant document class?
Yes, the "Tabulation" tab has:
- Default Tab Spacing = 4
- Indent Size = 4
- Convert new Tabs to Spaces = unchecked
- Convert existing Tabs to Spaces when saving files = unchecked
- Tab Stops = all empty

Pietro
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Well, I'm using TP 4.7.1 and for *.txt files under the document class Text
I have unchecked "Convert New tabs to Spaces" and "Convert Existing
Tabs to Spaces When Saving Files". I can use a blend of tabs and spaces,
save and reopen, the spaces and tabs stay the same.

Double check that your file extension is a part of the Document Class.
Ie. if you are using the document class SQL, make sure you have some-
thing like *.sql for that class under "Files in class SQL".
Then I open up and see
the person fumbling here is me
a different way to be
ptoniolo
Posts: 3
Joined: Mon Sep 29, 2003 12:55 pm

Post by ptoniolo »

My point is that: when I use Increase Indent, TP is changing spaces in tabs.

Set the tabstop to four, paste the sql code of my first message, select the code, press TAB, check the spaces: some of them have been converted to space.

At least, this is what happens to me. If you do not have the same behaviour, maybe my configuration is flawd somehow...

Pietro
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

When I use Increase Indent a tab is inserted at start of line.
The original spaces are shifted right and they stay as spaces.

When I have the number of spaces equal to a tab and then use Increase
Indent ALL my spaces are converted to a single tab and I have two tabs
at the start of line.

TP's settings only cover the "tab to spaces", not the "spaces to tab"
and it should therefore not convert spaces.
This must be a bug or at best an "undocumented design feature".
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply