IDEA-79293: Task Management Cannot Handle Task Titles Containing CRLF
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 26 Dec 2011 08:58:35 +0000 (12:58 +0400)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 26 Dec 2011 08:58:35 +0000 (12:58 +0400)
plugins/tasks/tasks-core/src/com/intellij/tasks/impl/TaskCompletionContributor.java

index 8d5929f712c8ae479b6e18b9280be37287155f0f..1b18c8155adecf64119402c877d136d5c3e43fd1 100644 (file)
@@ -11,6 +11,7 @@ import com.intellij.openapi.progress.ProcessCanceledException;
 import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiFile;
 import com.intellij.tasks.Task;
@@ -107,6 +108,7 @@ public class TaskCompletionContributor extends CompletionContributor {
           public void handleInsert(InsertionContext context, LookupElement item) {
             Document document = context.getEditor().getDocument();
             String s = task.getId() + ": " + task.getSummary();
+            s = StringUtil.convertLineSeparators(s);
             document.replaceString(context.getStartOffset(), context.getTailOffset(), s);
             context.getEditor().getCaretModel().moveToOffset(context.getStartOffset() + s.length());
             consumer.consume(task);