diff options
author | Joel Nordell <joel.nordell@chloridepower.com> | 2009-05-18 12:21:30 -0500 |
---|---|---|
committer | Joel Nordell <joel.nordell@chloridepower.com> | 2009-05-20 11:10:06 -0500 |
commit | ffd19fe8a0d5f33605c8439025b96001e2703e26 (patch) | |
tree | 90378966abbce30375a9b3a40d9dd0eb1c4d2d6f /src/plugins/texteditor/tabsettings.h | |
parent | bb6f56f5538879d4d5720ad9de5ddb5c6ed42818 (diff) |
XCode-style tab behavior
Diffstat (limited to 'src/plugins/texteditor/tabsettings.h')
-rw-r--r-- | src/plugins/texteditor/tabsettings.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index 7cab4ff1a3..aa3567e420 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -44,6 +44,13 @@ namespace TextEditor { // with some convenience functions for formatting. struct TEXTEDITOR_EXPORT TabSettings { + // This enum must match the indexes of tabKeyBehavior widget + enum TabKeyBehavior { + TabNeverIndents = 0, + TabAlwaysIndents = 1, + TabLeadingWhitespaceIndents = 2 + }; + TabSettings(); void toSettings(const QString &category, QSettings *s) const; @@ -61,13 +68,14 @@ struct TEXTEDITOR_EXPORT TabSettings int trailingWhitespaces(const QString &text) const; bool isIndentationClean(const QString &text) const; - + bool tabShouldIndent(const QTextDocument *document, QTextCursor cursor, int *suggestedPosition = 0) const; bool m_spacesForTabs; bool m_autoIndent; bool m_smartBackspace; int m_tabSize; int m_indentSize; + TabKeyBehavior m_tabKeyBehavior; bool equals(const TabSettings &ts) const; }; |