Author Topic: Forcing tab indent?  (Read 655 times)

Offline jeremy_c

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Forcing tab indent?
« on: August 29, 2009, 02:45:39 pm »
How can I force tab indents?

I have Options>Formatting:
  Tab size: 4, Use Optimal Fill = Off, Replace spaces with tabs selected, Auto-detect default indent off.

Then, when I press tab and enter some text:

    hello_world() -- Here I press enter
    goodbye()


hello_world() is indented by a tab, but goodbye() is indented as 4 spaces.

Jeremy

Offline Arthur

  • Hero Member
  • *****
  • Posts: 620
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Forcing tab indent?
« Reply #1 on: August 30, 2009, 03:37:54 am »
Hi Jeremy,

What I observed is if you would keep typing spaces, after the 4th one they would turn into tabs in this scenario.

If you'd enable White Space view you could see this happening in action.
Interestingly, if one hits enter the cursor indents, and only when a key is pressed it becomes left padded with spaces.

By playing around with HE's formatting settings I could make it work as you want.
The recipe is to set the formatting of tab-spaces as follows:

Use Optimal Fit -> checked
Auto (detect from content) -> chosen
Auto-Detect Default Indent -> unchecked


Besides, I suggest HE developers should re-engineer the settings to make them more straight forward.
« Last Edit: August 30, 2009, 03:40:06 am by Arthur »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Forcing tab indent?
« Reply #2 on: August 31, 2009, 10:59:11 am »
Hi Jeremy,

Arthur was right with Use optimal fill to be checked. This option controls how indents are inserted. If it is On AND Keep as Typed or Spaces to Tabs is selected, indented space is converted to be as more tabs as possible and rest is filled by spaces.

I think, I can remove Use Optimal Fill at all from UI settings and leave it only changeable via XML files, with default set to ON. This should decrease confusion. And in addition Quick Help for these field is necessary. I would try to add this new 1.46 beta.

Best regards,
Alex.

 

Related Topics

  Subject / Started by Replies Last post
Auto indent ?

Started by gordonisnz General Discussion

13 Replies
1501 Views
Last post December 29, 2008, 06:22:59 pm
by Stefan
7 Replies
955 Views
Last post March 06, 2009, 07:04:25 pm
by alex
1 Replies
319 Views
Last post April 01, 2009, 03:27:17 pm
by alex
3 Replies
712 Views
Last post July 15, 2009, 02:16:48 pm
by alex
1 Replies
296 Views
Last post June 06, 2011, 01:14:44 pm
by alex