diff --git a/language/editor/persistentmovingrange.cpp b/language/editor/persistentmovingrange.cpp
index 465b1b6..ddbe9bb 100644
--- a/language/editor/persistentmovingrange.cpp
+++ b/language/editor/persistentmovingrange.cpp
@@ -26,12 +26,14 @@
 #include <interfaces/ilanguagecontroller.h>
 #include <backgroundparser/backgroundparser.h>
 
-KDevelop::PersistentMovingRange::PersistentMovingRange(const SimpleRange& range, const IndexedString& document): m_p(new PersistentMovingRangePrivate)
+KDevelop::PersistentMovingRange::PersistentMovingRange(const SimpleRange& range, const IndexedString& document, bool shouldExpand)
+: m_p(new PersistentMovingRangePrivate)
 {
   VERIFY_FOREGROUND_LOCKED;
   m_p->m_range = range;
   m_p->m_document = document;
-  
+  m_p->m_shouldExpand = shouldExpand;
+
   m_p->connectTracker();
 }
 
diff --git a/language/editor/persistentmovingrange.h b/language/editor/persistentmovingrange.h
index 1fa0b87..cfabc84 100644
--- a/language/editor/persistentmovingrange.h
+++ b/language/editor/persistentmovingrange.h
@@ -49,7 +49,7 @@ class KDEVPLATFORMLANGUAGE_EXPORT PersistentMovingRange : public KShared
     /**
      * Creates a new persistent moving range based on the current revision of the given document
      * */
-    PersistentMovingRange(const SimpleRange& range, const IndexedString& document);
+    PersistentMovingRange(const SimpleRange& range, const IndexedString& document, bool shouldExpand = false);
     ~PersistentMovingRange();
     
     IndexedString document() const;
diff --git a/language/editor/persistentmovingrangeprivate.cpp b/language/editor/persistentmovingrangeprivate.cpp
index d4e88fc..239123e 100644
--- a/language/editor/persistentmovingrangeprivate.cpp
+++ b/language/editor/persistentmovingrangeprivate.cpp
@@ -34,10 +34,11 @@ void KDevelop::PersistentMovingRangePrivate::connectTracker()
   {
     // Create a moving range
     m_movingRange = m_tracker->documentMovingInterface()->newMovingRange(m_range.textRange());
+    if (m_shouldExpand)
+      m_movingRange->setInsertBehaviors(KTextEditor::MovingRange::ExpandLeft | KTextEditor::MovingRange::ExpandRight);
     connect(m_tracker->document(), SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)), this, SLOT(aboutToDeleteMovingInterfaceContent()));
     connect(m_tracker->document(), SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)), this, SLOT(aboutToInvalidateMovingInterfaceContent()));
     m_movingRange->setAttribute(m_attribte);
-    
     m_movingRange->setZDepth(m_zDepth);
   }
 }
diff --git a/language/editor/persistentmovingrangeprivate.h b/language/editor/persistentmovingrangeprivate.h
index 0e65ce9..c2233a2 100644
--- a/language/editor/persistentmovingrangeprivate.h
+++ b/language/editor/persistentmovingrangeprivate.h
@@ -35,7 +35,7 @@ class PersistentMovingRangePrivate : public QObject
 {
   Q_OBJECT
   public:
-  PersistentMovingRangePrivate() : m_valid(false), m_movingRange(0), m_tracker(0), m_zDepth(0) {
+  PersistentMovingRangePrivate() : m_valid(false), m_shouldExpand(false), m_movingRange(0), m_tracker(0), m_zDepth(0) {
     moveToThread(QApplication::instance()->thread());
   }
   
@@ -44,6 +44,7 @@ class PersistentMovingRangePrivate : public QObject
   void disconnectTracker();
   
   bool m_valid;
+  bool m_shouldExpand;
   SimpleRange m_range;
   IndexedString m_document;
   KTextEditor::Attribute::Ptr m_attribte;
