summaryrefslogtreecommitdiff
path: root/src/plugins/qmljseditor/qmljseditoreditable.h
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2013-03-06 15:28:19 +0100
committerMitch Curtis <mitch.curtis@digia.com>2013-03-08 15:15:53 +0100
commite53ae81858373b98639c1f52c00dcd4eb8f5d821 (patch)
tree61798e8ecaa356b5eaa4e871bebe879c8721156f /src/plugins/qmljseditor/qmljseditoreditable.h
parentb682adaee9fa9e360e428db2d71328c2d8d7fbed (diff)
downloadqt-creator-e53ae81858373b98639c1f52c00dcd4eb8f5d821.tar.gz
CPP, QmlJs editors: don't indent when moving commented lines up/down.
Currently, pressing Ctrl + Shift + Up/Down with a commented block of text selected will indent that block if the line two lines above the block is indented. This is undesirable, because the indenting for that block is incorrect when it is uncommented. See the following example: Step 1: void f() { int x; // int y; } Step 2 - After Ctrl + Shift + Up: void f() { int x; // int y; } Step 3 - After uncommenting the block: void f() { int x; int y; } This patch tells the CPP and QmlJs editors not to indent commented blocks when moving them. Blocks that are not entirely within comments (excluding whitespace) are not affected. Tested with (C++ and JavaScript, respectively): http://paste.kde.org/688778/ http://paste.kde.org/688784/ Change-Id: I35414e6dfd5a1084fd997594e711ea9932231981 Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'src/plugins/qmljseditor/qmljseditoreditable.h')
-rw-r--r--src/plugins/qmljseditor/qmljseditoreditable.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/qmljseditor/qmljseditoreditable.h b/src/plugins/qmljseditor/qmljseditoreditable.h
index b2b972fe5f..ac7d161588 100644
--- a/src/plugins/qmljseditor/qmljseditoreditable.h
+++ b/src/plugins/qmljseditor/qmljseditoreditable.h
@@ -31,6 +31,7 @@
#define QMLJSEDITOREDITABLE_H
#include "qmljseditor_global.h"
+#include <utils/uncommentselection.h>
#include <texteditor/basetexteditor.h>
namespace QmlJSEditor {
@@ -50,6 +51,10 @@ public:
bool open(QString *errorString, const QString &fileName, const QString &realFileName);
Core::Id preferredModeType() const;
void setTextCodec(QTextCodec *codec, TextCodecReason = TextCodecOtherReason);
+
+ const Utils::CommentDefinition *commentDefinition() const;
+private:
+ Utils::CommentDefinition m_commentDefinition;
};
} // namespace QmlJSEditor