use length after document modification
authorEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Wed, 3 Aug 2016 10:47:50 +0000 (13:47 +0300)
committerEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Wed, 3 Aug 2016 10:47:50 +0000 (13:47 +0300)
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.setHints(result);
       }
-      answerPlaceholder.setUseLength(false);
       document.replaceString(offset, offset + answerPlaceholder.getRealLength(), answerPlaceholder.getPossibleAnswer());
       document.replaceString(offset, offset + answerPlaceholder.getRealLength(), answerPlaceholder.getPossibleAnswer());
+      answerPlaceholder.setUseLength(false);
       FileDocumentManager.getInstance().saveDocument(document);
     }), "Replace answer placeholder", "From Course Archive");
   }
       FileDocumentManager.getInstance().saveDocument(document);
     }), "Replace answer placeholder", "From Course Archive");
   }