aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/tabsettings.h
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2011-08-17 12:31:15 +0200
committerhjk <qthjk@ovi.com>2011-08-18 10:09:17 +0200
commit3b0a43802e45affc7cfbef065d99720a1415e791 (patch)
tree87ddae4afd6b5abad5905dc1b4e673c580b53238 /src/plugins/texteditor/tabsettings.h
parent7b90c8b0c533cdb8085420bf1e753518584df310 (diff)
Editors: Enhance smart backspace behavior
Adds a new smart backspace behavior option. Now it's also possible to simply unindent (like a backtab). This is particularly useful when the cursor is not inside an "indentation area" but the user still wants to go backwards by indent levels when possible (for example before a comment that appears after the code line). The option also allows the user to reach a new indent level which has not been seen so far in previous lines. The original follows indentation user setting will be lost with this patch, but we consider this ok for not very "significant" settings. Change-Id: I49efb6b0309d9b7d7ff2a589413446bc16fb753c Reviewed-on: http://codereview.qt.nokia.com/3105 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Robert Löhning <robert.loehning@nokia.com> Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/texteditor/tabsettings.h')
-rw-r--r--src/plugins/texteditor/tabsettings.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h
index 26a1c6f7ec..885f4b2330 100644
--- a/src/plugins/texteditor/tabsettings.h
+++ b/src/plugins/texteditor/tabsettings.h
@@ -63,6 +63,13 @@ public:
ContinuationAlignWithIndent = 2
};
+ // This enum must match the indexes of smartBackspaceBehavior widget
+ enum SmartBackspaceBehavior {
+ BackspaceNeverIndents = 0,
+ BackspaceFollowsPreviousIndents = 1,
+ BackspaceUnindents = 2
+ };
+
TabSettings();
void toSettings(const QString &category, QSettings *s) const;
@@ -96,11 +103,11 @@ public:
bool m_spacesForTabs;
bool m_autoSpacesForTabs;
bool m_autoIndent;
- bool m_smartBackspace;
int m_tabSize;
int m_indentSize;
TabKeyBehavior m_tabKeyBehavior;
ContinuationAlignBehavior m_continuationAlignBehavior;
+ SmartBackspaceBehavior m_smartBackspaceBehavior;
bool equals(const TabSettings &ts) const;
};