Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#331 Smart Indent

Completed
closed
Neil Hodgson
None
2
2009-07-03
2006-05-25
Anonymous
No

Indents wrapped lines to the same position as the
indent at the start of the line, e.g.

This is an example line that is wrapped
here and not smart indented at all but goes
back to the left margin.

This is an example line that is wrapped
here using smart indent. Each wrapped line
matches the previous indent level and is useful
for showing the structure of the document in an
outline format. Useful for latex.

Both of the above examples would contain no line
breaks. They are single wrapped lines. Yes I know there
is a fixed indent option for the following lines but it
does not take account of different levels of indent.

Keep up the good work,

Tim.
tim_milstead@yahoo.co.uk

Discussion

  • Logged In: NO

    Looks like it stripped out my space formatting :-(.
    Hopefully the description makes it clear. Each wrapped line
    is indented the same amount as the indent at the start of
    said line.

    Tim.

     
  • Neil Hodgson
    Neil Hodgson
    2006-05-27

    Logged In: YES
    user_id=12579

    I understand what you want and this was considered when
    WrapStartIndent and WrapVisualFlagsLocation were
    implemented. Its an OK idea but I won't be working on it.
    Offsetting the indent of the wrapped lines is a possible
    extension.

     
  • Neil Hodgson
    Neil Hodgson
    2006-05-27

    • priority: 5 --> 2
    • assigned_to: nobody --> nyamatongwe
     
  • Logged In: NO

    This thing is more critical than you might think. I'm not even considering switching to SciTE until it has this feature, although it does seem superior to jEdit. You probably just can't imagine how annoying these dead wrapped lines are if you are used to clean layout. WrapStartIndent is useless unless you have 3 indentation levels at maximum.

    I'll keep on checking back for this feature.

     
  • Iskar Enev
    Iskar Enev
    2008-03-20

    Logged In: YES
    user_id=2041549
    Originator: NO

    I think it would be nice feature and a lot of people will love it. I don't know if someone already started working on it or made it as an extension.

     
  • rockstar1707
    rockstar1707
    2008-05-08

    Logged In: YES
    user_id=1388473
    Originator: NO

    I would vote for this feature as well. It might not be really useful for programming, but it is really convenient for typing LaTeX texts (long equations in indented "equation" environment).

     
  • Martin Spacek
    Martin Spacek
    2008-11-18

    +1 on this one. The rarity of this feature across text editors is probably the only reason I'm still using Textpad in Windows (e-texteditor.com is the only other one I've found that has it). I just discovered Geany (Scintilla based) which has a fixed wrapped line indentation level, but would love if it had smart indent.

     
  • maXmo
    maXmo
    2009-05-21

    I'll look to implement this feature. Wouldn't you mind if I remove support for fixed wrap indent?

     
  • Martin Spacek
    Martin Spacek
    2009-05-21

    That would be fantastic! I personally have no need for the fixed wrap indent. Seems like just a poor man's version of smart indent to me. Not sure why anyone would specifically want fixed wrap indent...

     
  • Neil Hodgson
    Neil Hodgson
    2009-05-21

    The new behaviour should be an option with existing behaviour preserved for those people that do not choose to change.

     
  • maXmo
    maXmo
    2009-05-23

    Question on design: why

    enum \{ eWrapNone, eWrapWord, eWrapChar \} wrapState;
    int wrapWidth;
    int wrapVisualFlags;
    int wrapVisualFlagsLocation;
    int wrapVisualStartIndent;
    int actualWrapVisualStartIndent;
    

    are members of Editor? Shouldn't they be in ViewStyle? Is it ok to move them there?

     
  • Neil Hodgson
    Neil Hodgson
    2009-05-25

    They were probably added to Editor because the issue wasn't thought about. They probably do belong in ViewState.

     
  • maXmo
    maXmo
    2009-05-25

    People interested in smart indent, what do you think is better? SC_WRAPINDENT_SAME or SC_WRAPINDENT_INDENT? See my thoughts in FR#2796119 (4th post).

     
  • Martin Spacek
    Martin Spacek
    2009-05-26

    From feature request ID: 2796119:

    SC_WRAPINDENT_FIXED - current behavior, default
    SC_WRAPINDENT_SAME - wrapped lines are aligned to first line indent
    SC_WRAPINDENT_INDENT - first line's indent + yet one more indent (as
    defined by document).

    As far as I undertsand it, I prefer SC_WRAPINDENT_SAME, as described in the initial comment here by Tim. This is the way TextPad works. I've never heard smart indent described as it is for SC_WRAPINDENT_INDENT. But it sounds like SC_WRAPINDENT_SAME is just a special case of SC_WRAPINDENT_INDENT, where the extra indentation is set to zero, no?

     
  • maXmo
    maXmo
    2009-05-26

    yes

     
  • Neil Hodgson
    Neil Hodgson
    2009-07-03

    • milestone: --> Completed
    • status: open --> closed