Forcing tab indent?

Started by jeremy_c, August 29, 2009, 03:45:39 PM

Previous topic - Next topic

jeremy_c

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

Arthur

#1
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.

alex

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.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]