#667 Smart Indent broken in 5.6

development
open
nobody
Program (402)
5
2011-04-20
2011-04-20
Reece
No

Smart Indent in 'C' (and probably other languages) was broken after the 5.5 release. Rather than increasing indentation after a conditional, loop, or opening brace, the indentation level remains the same. Nor does the indentation level decrease after a closing brace.

I've traced this behavior to the changes made in response to tracker #1560892. Reverting these changes restores proper operation of Smart Indent.

To test:
1) Start nedit
2) Select Preferences -> Language Mode -> C
3) Verify Preferences -> Auto Indent -> Smart
4) Start entering (NOT cut-n-paste) a C program like this:

int f(int x)<ENTER>{<ENTER>

5) The broken version will leave the cursor at the left margin. The 5.5 version auto-indents one tab stop.

Reverting the following commits in CVS restores the 5.5 behavior:
1.107 doc/help.etc
1.115 source/macro.c
1.141 source/menu.c

Discussion

  • Bert Wesarg
    Bert Wesarg
    2011-04-21

    Thanks for the report, but I think the right fix is to fix the use of $em_tab_dist in the common smart indent macros of NEdit itself.

     
  • Bert Wesarg
    Bert Wesarg
    2011-04-21

    Commited fix to HEAD.