use length after document modification
[idea/community.git] / python / educational-core / course-creator / src / com / jetbrains / edu / coursecreator / actions / CCFromCourseArchive.java
index bbee0d9610ab8c749690e5d31301408a36115d6d..69c628f360ce99693a31fbdf3695bba07ffc87be 100644 (file)
@@ -174,8 +174,8 @@ public class CCFromCourseArchive extends DumbAwareAction {
         }
         answerPlaceholder.setHints(result);
       }
-      answerPlaceholder.setUseLength(false);
       document.replaceString(offset, offset + answerPlaceholder.getRealLength(), answerPlaceholder.getPossibleAnswer());
+      answerPlaceholder.setUseLength(false);
       FileDocumentManager.getInstance().saveDocument(document);
     }), "Replace answer placeholder", "From Course Archive");
   }