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

Spaces for hanging indent when using tabs for indentation

    Details

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 4.7.0
    • Fix Version/s: None
    • Component/s: Editors, FakeVim
    • Labels:
      None
    • Platform/s:
      Linux/X11

      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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              davschul David Schulz
              Reporter:
              krasnal Andrzej Ostruszka
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes