Loading ...
Sorry, an error occurred while loading the content.

Re: [patch] switch indentation problem

Expand Messages
  • Bram Moolenaar
    ... It makes sense. But only when l1 is in cinoptions . I ll add a check for ind_keep_case_label being set. -- ARTHUR: I command you as King of the
    Message 1 of 2 , Sep 1, 2001
    • 0 Attachment
      David Bustos wrote:

      > In Vim 6.0at, with cindent on and cino=:0l1, the following switch
      > statement is indented thusly:
      >
      > func(int x)
      > {
      > switch (x) {
      >
      > case 1:
      > statement1;
      >
      > case CONST: {
      > statement2;
      > }
      >
      > default:
      > statement3;
      > }
      > }
      >
      > The problem is statement3. It's being aligned with the { in the
      > "case CONST:" line when I want it to be aligned with statement1. I
      > believe this is a bug. I've come up with a patch to fix it by making
      > get_c_indent() continue past the "case CONST:" line rather than stopping
      > at it. I'm not sure if this is the Right Way to do it, but it works and
      > should give someone who knows get_c_indent() better than I a starting
      > point.

      It makes sense. But only when "l1" is in 'cinoptions'. I'll add a check
      for ind_keep_case_label being set.

      --
      ARTHUR: I command you as King of the Britons to stand aside!
      BLACK KNIGHT: I move for no man.
      The Quest for the Holy Grail (Monty Python)

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.