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

bug with error format %p^

Expand Messages
  • Benoit Cerrina
    Hi, there seems to be a bug in the way vim handles the %p^ errorformat, at least there is inconsistant behavior when using javac due to the compiler expanding
    Message 1 of 2 , Mar 1 12:43 AM
    • 0 Attachment
      Hi,
      there seems to be a bug in the way vim handles the %p^ errorformat,
      at least there is inconsistant behavior when using javac due to the compiler expanding tabs to spaces at the start of a line.
      this is my line of code:
      <TAB><TAB>java.lang.reflect.Method lMethod = _BEAN_CLASS_.getMethod(iName, iParamTypes);
       
      this is the output of javac:
       
       
      C:\dev\NewGen\src\com\dassault_systemes\NewGen\PersistAttributeNodeBeanInfo.java:57: cannot resolve
      symbol
      symbol  : variable iName
      location: class com.dassault_systemes.NewGen.PersistAttributeNodeBeanInfo
                      java.lang.reflect.Method lMethod = _BEAN_CLASS_.getMethod(iName, iParamTypes);
                                                                                                                   ^
       
      notice that javac expands the tabs to 8 spaces, I have ts=4 and this leads to a differenctial of 8 in the column number and
      the %p^ incorrectly computes error line=75.
       
      possible correction would be to strip the leading tab and spaces for column computation.
       
      Benoit
    • Bram Moolenaar
      ... Vim can t know how many spaces to strip. I think the only solution is to work with tabstop set to 8. Yet another reason to keep tabstop at the
      Message 2 of 2 , Mar 1 4:19 AM
      • 0 Attachment
        Benoit Cerrina wrote:

        > there seems to be a bug in the way vim handles the %p^ errorformat,
        > at least there is inconsistant behavior when using javac due to the compiler
        > expanding tabs to spaces at the start of a line.
        > this is my line of code:
        > <TAB><TAB>java.lang.reflect.Method lMethod = _BEAN_CLASS_.getMethod(iName, iParamTypes);
        >
        > this is the output of javac:
        >
        >
        > C:\dev\NewGen\src\com\dassault_systemes\NewGen\PersistAttributeNodeBeanInfo.java:57: cannot resolve
        > symbol
        > symbol : variable iName
        > location: class com.dassault_systemes.NewGen.PersistAttributeNodeBeanInfo
        > java.lang.reflect.Method lMethod = _BEAN_CLASS_.getMethod(iName, iParamTypes);
        > ^
        >
        > notice that javac expands the tabs to 8 spaces, I have ts=4 and this leads
        > to a differenctial of 8 in the column number and the %p^ incorrectly
        > computes error line.
        >
        > possible correction would be to strip the leading tab and spaces for column
        > computation.

        Vim can't know how many spaces to strip. I think the only solution is to work
        with 'tabstop' set to 8. Yet another reason to keep 'tabstop' at the standard
        value of eight!

        --
        Q: What is the difference betwee open-source and commercial software?
        A: If you have a problem with commercial software you can call a phone
        number and they will tell you it might be solved in a future version.
        For open-source sofware there isn't a phone number to call, but you
        get the solution within a day.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim - http://www.vim.org -- 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.