summaryrefslogtreecommitdiff
path: root/python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/format/TaskWindow.java
diff options
context:
space:
mode:
Diffstat (limited to 'python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/format/TaskWindow.java')
-rw-r--r--python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/format/TaskWindow.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/format/TaskWindow.java b/python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/format/TaskWindow.java
index cb6418ec75d7..6b1be7ef3e7d 100644
--- a/python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/format/TaskWindow.java
+++ b/python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/format/TaskWindow.java
@@ -68,16 +68,17 @@ public class TaskWindow implements Comparable{
}
}
- public void drawHighlighter(@NotNull final Editor editor) {
+ public void drawHighlighter(@NotNull final Editor editor, boolean useLength) {
int startOffset = editor.getDocument().getLineStartOffset(line) + start;
- int endOffset = startOffset + myReplacementLength;
+ int highlighterLength = useLength ? length : myReplacementLength;
+ int endOffset = startOffset + highlighterLength;
TextAttributes defaultTestAttributes =
EditorColorsManager.getInstance().getGlobalScheme().getAttributes(EditorColors.LIVE_TEMPLATE_ATTRIBUTES);
RangeHighlighter highlighter =
editor.getMarkupModel().addRangeHighlighter(startOffset, endOffset, HighlighterLayer.LAST + 1, defaultTestAttributes,
HighlighterTargetArea.EXACT_RANGE);
highlighter.setGreedyToLeft(true);
- highlighter.setGreedyToRight(true);
+ highlighter.setGreedyToRight(false);
}
public int getIndex() {
@@ -123,10 +124,6 @@ public class TaskWindow implements Comparable{
return lineDiff;
}
- public String getPossibleAnswer() {
- return possible_answer;
- }
-
public int getLength() {
return length;
}