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

ClangFormat misconverts Tab indentation from old settings

    XMLWordPrintable

Details

    • 6a20e588b (11.0)

    Description

      I have a C++ Style configuration that uses Tabs for indentation.

      When .clang-format file is created for this configuration, it is created with UseTab: Never, and the lines are indented with spaces.

      To reproduce:

      qtcreator -settingspath /tmp/no-tabs -noload ClangFormat

      Edit -> Preferences -> C++ -> Code Style
      Copy Qt, change the Tab policy to Tabs Only, Apply and quit Qt Creator

      Now run again with:

      qtcreator -settingspath /tmp/no-tabs

      Edit -> Preferences -> C++ -> Code Style

      Notice that the preview appears with spaces, and if you scroll to the bottom (it's the last setting) you'll see UseTab: Never.

      Now switch to General. The combobox shows Spaces Only, but the preview has tabs .

      If you manually change it to Tabs Only, the issue is fixed.

      Attachments

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

        Activity

          People

            artem.sokolovskii Artem Sokolovskii
            orgads Orgad Shaneh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes