D22276: Add an action to insert a non-indented newline

Dominik Haumann noreply at phabricator.kde.org
Fri Jul 5 08:45:50 BST 2019

dhaumann added inline comments.


> katedocument.h:827
> -    void newLine(KTextEditor::ViewPrivate *view);  // Changes input
> +    void newLine(KTextEditor::ViewPrivate *view, const bool noIndentation = false);  // Changes input
>      void backspace(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &);

I dislike the double negation: noIndentation = false. Later even !noIndentation. This is bad API design.

Please change to bool indent = true.

> kateview.cpp:2881
> +    doc()->newLine(this, true);
> +    m_viewInternal->iconBorder()->updateForCursorLineChange();
> +    m_viewInternal->updateView();

Do we really need this call? Also Don't we miss setting the cursor position? Incliding a begin/endEdit?

  R39 KTextEditor


To: ahmadsamir, #ktexteditor, cullmann, dhaumann
Cc: mickaelbo, kde-frameworks-devel, kwrite-devel, LeGast00n, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190705/9153f300/attachment.html>

More information about the KWrite-Devel mailing list