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

Remove extraneous whitespace from indentation

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 3.5.0
    • FakeVim
    • None

    Description

      This applies to the FakeVim mode. I'm not sure what expectations are in non-vi-style editors.

      In Vim, when you create a new line (e.g. by hitting “o”), it is indented properly, as expected. However, if no text is added to that line before switching lines, the indentation is removed. As a concrete example, if there are a few lines of code and I want to add new code below it, but with a blank line in between, what I can do is go to the last line, hit “o”, hit “enter”, and then start typing the new lines. Vim will indent on the line below when I hit “o” but when it sees I didn't actually add anything to that line, it removes all space. This is done in realtime, not on save.

      QtCreator keeps all the extra whitespace. If I hit “o” then “enter”, there is now a line with a few spaces at the beginning and nothing else. I find Vim's behavior much more intuitive (you almost never want a line composed purely of extraneous whitespace), and think it would be a useful addition to QtCreator.

      Attachments

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

        Activity

          People

            hjk hjk
            cspiegel Chris Spiegel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes