https://bugs.kde.org/show_bug.cgi?id=373009

            Bug ID: 373009
           Summary: indention following single-statement loop over-indents
                    the following command, must undo twice
           Product: kate
           Version: 16.08
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: indentation
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: drankina...@suddenlinkmail.com
  Target Milestone: ---

Indent config: Soft Tabs: 4 (Indent using spaces)

If you attempt to add an additional line before the next statement after a
single-statement loop in a C source, autoindent indents the statement on the
current line 3-levels too many. Example, save the following as a C-source (e.g.
bug.c)

    while (whatever) printf ("please fix indentation.\n");
    return 0;

(make sure it has 4-spaces, a single level of indention before it in the file,
e.g. select it and press ctrl+i) Now place the cursor at the insertion point
immediately before the 'r' in 'return' (or at the beginning of the line) and
press enter ('.' inserted to preserve spacing below):

....while (whatever) printf ("please fix indentation.\n");

..............return 0;

That is 14-spaces before 'return' instead of the expected `4`. The expected
result is simply 4-spaces before each line with a blank line in between the
commands. Moreover, `14` spaces??? That should never happen anyway with 'Soft
Tabs: 4' set. Your indents are at 12 or 16, but never 14, something is borked.

Now try and 'undo' (e.g. ctrl+z). You can't in one step. You have to undo
twice. You should never have to 'undo' twice for the result of a single
keystroke. One keystroke, one undo should restore to the previous state.

Both of these make the indent model in kate/kwrite seems clumsy and broken.
With more than a decade using kate/kwrite, these bugs were never present and
the indent model in kde3. That indent model was very elegant and enjoyable to
use for C, C++, php, html, etc.. There were never any surprises and it was
rock-solid. The current indent model is more annoying than helpful in many
circumstances. A slip of the finger attempting to insert a 'single-quote' that
hits enter key and inserts a new line now takes '2 ctrl+z' to undo and restore
the editor state. That's just broken and a symptom of fundamental problems with
the current indent model. Is that a problem with KDE or Qt?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to