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

Issue 46 in vim: a bug of c code indent

Expand Messages
  • vim@googlecode.com
    Status: New Owner: ---- Labels: Type-Defect Priority-Medium New issue 46 by fy0...@gmail.com: a bug of c code indent
    Message 1 of 2 , Jan 3, 2012
    • 0 Attachment
      Status: New
      Owner: ----
      Labels: Type-Defect Priority-Medium

      New issue 46 by fy0...@...: a bug of c code indent
      http://code.google.com/p/vim/issues/detail?id=46

      What steps will reproduce the problem?
      1.input these codes:
      if (!c) {
      // 当字符为 # 时 ...
      if (c=='#') {
      // 当字符为 { 时 ...
      } else if(c=='{') {
      // 当字符为其他
      }
      }
      2. "=gg"
      3. the result:
      if (!c) {
      // 当字符为 # 时 ...
      if (c=='#') {
      // 当字符为 { 时 ...
      } else if(c=='{') {
      // 当字符为其他
      }
      }

      What is the expected output? What do you see instead?
      expected:
      if (!c) {
      // 当字符为 # 时 ...
      if (c=='#') {
      // 当字符为 { 时 ...
      } else if(c=='{') {
      // 当字符为其他
      }
      }
      instead:
      if (!c) {
      // 当字符为 # 时 ...
      if (c=='#') {
      // 当字符为 { 时 ...
      } else if(c=='{') {
      // 当字符为其他
      }
      }

      What version of the product are you using? On what operating system?
      Ver: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 6 2011 10:20:05)
      OS : xubuntu 11.10

      Please provide any additional information below.
      it's a bug of c code indent.


      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • vim@googlecode.com
      Updates: Status: Accepted Comment #1 on issue 46 by brammool...@gmail.com: a bug of c code indent http://code.google.com/p/vim/issues/detail?id=46 This happens
      Message 2 of 2 , Jan 4, 2012
      • 0 Attachment
        Updates:
        Status: Accepted

        Comment #1 on issue 46 by brammool...@...: a bug of c code indent
        http://code.google.com/p/vim/issues/detail?id=46

        This happens because of the unmatched { in the middle comment. Remove it
        or add a } in that line.

        Ignoring } and { in a comment is in the todo list somewhere. It won't be
        fixed soon.

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.