Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.h
Show First 20 Lines • Show All 818 Lines • ▼ Show 20 Line(s) | 809 | public: | |||
---|---|---|---|---|---|
819 | 819 | | |||
820 | bool ownedView(KTextEditor::ViewPrivate *); | 820 | bool ownedView(KTextEditor::ViewPrivate *); | ||
821 | 821 | | |||
822 | int toVirtualColumn(int line, int column) const; | 822 | int toVirtualColumn(int line, int column) const; | ||
823 | int toVirtualColumn(const KTextEditor::Cursor &) const; | 823 | int toVirtualColumn(const KTextEditor::Cursor &) const; | ||
824 | int fromVirtualColumn(int line, int column) const; | 824 | int fromVirtualColumn(int line, int column) const; | ||
825 | int fromVirtualColumn(const KTextEditor::Cursor &) const; | 825 | int fromVirtualColumn(const KTextEditor::Cursor &) const; | ||
826 | 826 | | |||
827 | void newLine(KTextEditor::ViewPrivate *view); // Changes input | 827 | enum NewLineIndent { Indent, NoIndent }; | ||
828 | | ||||
829 | void newLine(KTextEditor::ViewPrivate *view, NewLineIndent indent = NewLineIndent::Indent); // Changes input | ||||
dhaumann: I dislike the double negation: noIndentation = false. Later even !noIndentation. This is bad… | |||||
Noted. Although I'll use an enum per cullmann's recommendation (but I'll choose a better name, hopefully). (Believe it or not, I had it as "const bool indent" first, but then bike-shed it to an over-engineered death). ahmadsamir: Noted. Although I'll use an enum per cullmann's recommendation (but I'll choose a better name… | |||||
828 | void backspace(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &); | 830 | void backspace(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &); | ||
829 | void del(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &); | 831 | void del(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &); | ||
830 | void transpose(const KTextEditor::Cursor &); | 832 | void transpose(const KTextEditor::Cursor &); | ||
831 | void paste(KTextEditor::ViewPrivate *view, const QString &text); | 833 | void paste(KTextEditor::ViewPrivate *view, const QString &text); | ||
832 | 834 | | |||
833 | public: | 835 | public: | ||
834 | void indent(KTextEditor::Range range, int change); | 836 | void indent(KTextEditor::Range range, int change); | ||
835 | void comment(KTextEditor::ViewPrivate *view, uint line, uint column, int change); | 837 | void comment(KTextEditor::ViewPrivate *view, uint line, uint column, int change); | ||
▲ Show 20 Lines • Show All 604 Lines • Show Last 20 Lines |
I dislike the double negation: noIndentation = false. Later even !noIndentation. This is bad API design.
Please change to bool indent = true.