bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add unindent_label option to indent


From: Eliot Blennerhassett
Subject: [PATCH] Add unindent_label option to indent
Date: Fri, 23 Nov 2007 14:43:09 +1300
User-agent: KMail/1.9.6

Add commandline option ul unindent-labels, which specifies the unindent
applied to labels, previously hardcoded to 2

Signed-off-by: Eliot Blennerhassett <address@hidden>
---

*** indent-2.2.9_clean/src/io.c 2002-08-05 05:08:41.000000000 +1200
--- indent-2.2.9/indent-2.2.9/src/io.c  2007-11-23 14:30:46.000000000 +1300
***************
*** 314,320 ****
      }
      else
      {
!         return parser_state_tos->ind_level - LABEL_OFFSET + 1;
      }
  }

--- 314,320 ----
      }
      else
      {
!         return parser_state_tos->ind_level - settings.unindent_label + 1;
      }
  }

*** indent-2.2.9_clean/src/args.c       2002-11-11 10:02:48.000000000 +1300
--- indent-2.2.9/indent-2.2.9/src/args.c        2007-11-23 14:30:14.000000000 
+1300
***************
*** 147,152 ****
--- 147,153 ----
  static int exp_st   = 0;
  static int exp_ts   = 0;
  static int exp_ut   = 0;
+ static int exp_ul   = 0;
  static int exp_v    = 0;
  static int exp_version = 0;

***************
*** 308,313 ****
--- 309,315 ----
      {"version", PRO_PRSTRING,                           0, ONOFF_NA, (int *) 
VERSION,                            &exp_version},
      {"v",       PRO_BOOL,                           false,       ON, 
&settings.verbose,                          &exp_v},
      {"ut",      PRO_BOOL,                            true,       ON, 
&settings.use_tabs,                         &exp_ut},
+     {"ul",      PRO_INT,                                2, ONOFF_NA, 
&settings.unindent_label,                   &exp_ul},
      {"ts",      PRO_INT,                                8, ONOFF_NA, 
&settings.tabsize,                          &exp_ts},
      {"st",      PRO_BOOL,                           false,       ON, 
&settings.use_stdout,                       &exp_st},
      {"ss",      PRO_BOOL,                           false,       ON, 
&settings.space_sp_semicolon,               &exp_ss},
***************
*** 428,433 ****
--- 430,436 ----
      {"verbose",                                     "v"},
      {"usage",                                       "h"},
      {"use-tabs",                                    "ut"},
+     {"unindent-labels",                             "ul"},
      {"tab-size",                                    "ts"},
      {"swallow-optional-blank-lines",                "sob"},
      {"struct-brace-indentation",                    "sbi"},
*** indent-2.2.9_clean/src/indent.h     2002-11-11 10:02:48.000000000 +1300
--- indent-2.2.9/indent-2.2.9/src/indent.h      2007-11-23 14:29:33.000000000 
+1300
***************
*** 253,258 ****
--- 251,257 ----
      int btype_2; /* when true, brace should be on same line as if, while, etc 
*/
      int brace_indent; /* number of spaces to indent braces from the suround 
if, while, etc. in -bl
                         * (bype_2 == 0) code */
+     int unindent_label; /* label unindented this much from code */
      int expect_output_file;  /* Means "-o" was specified. */
  } user_options_ty;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]