Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20876

Spaces for hanging indent when using tabs for indentation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 4.11.1
    • Qt Creator 4.7.0
    • FakeVim
    • None
    • Linux/X11
    • 76eba270bf54c2e5e52e327551da22faa2426f9a

    Description

      I've recently been doing some development in C in projects using linux kernel style which requires tabs for indenting and I've noticed one error in indentation for "hanging" indent.

      I've created "kernel" style with:

      • Tab policy: Mixed (can be also Tabs only - the same behaviour)
      • Tab size & indent: 8
      • Align continuation lines: with regular indent

      and expected QtCreator to behave like: act as if indentation was with spaces but replace all leading 8 spaces with tab and if there is not enough spaces to replace them with tab then just leave them.  And mostly it does behave like that apart from one notable case: hanging indent in continuation lines.  Then it goes like: use indentation of previous line and add enough spaces to align as required e.g. I want this:

       ------->------->some_function(arg1, arg2,
       ------->------->------->      arg3, arg4);
      

      but instead it is indented as:

       ------->------->some_function(arg1, arg2,
       ------->------->              arg3, arg4);
      

      which causes my patches to fail to comply with policy and I have to manually edit every such place.

      I am using FakeVim so I added it to components list but I expect it to just rely on the standard editor/cpp plugin.

      I would really appreciate having this fixed.

      Best regards

      Andrzej

      PS. Would it be possible to store the indentation style used in user project file description?  When I'm switching between projects I have to manually switch the settings because they are global (and not remembered per project).  And if not in per project file (if that creates problems when editing multiple projects at the same time) then maybe store this setting per session?

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-20876
        # Subject Branch Project Status CR V

        Activity

          People

            davschul David Schulz
            krasnal Andrzej Ostruszka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes