mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-186444 Pasting whole line doesn't work properly in Javadoc comments
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInsight.editorActions;
|
||||
|
||||
import com.intellij.application.options.CodeStyle;
|
||||
@@ -39,7 +39,7 @@ public class JavadocCopyPastePreProcessor implements CopyPastePreProcessor {
|
||||
int lineStartOffset = DocumentUtil.getLineStartOffset(offset, document);
|
||||
CharSequence chars = document.getImmutableCharSequence();
|
||||
int firstNonWsLineOffset = CharArrayUtil.shiftForward(chars, lineStartOffset, " \t");
|
||||
if (firstNonWsLineOffset >= chars.length() || chars.charAt(firstNonWsLineOffset) != '*') return text;
|
||||
if (firstNonWsLineOffset >= offset || chars.charAt(firstNonWsLineOffset) != '*') return text;
|
||||
|
||||
String lineStartReplacement = "\n" + chars.subSequence(lineStartOffset, firstNonWsLineOffset + 1) + " ";
|
||||
return StringUtil.trimTrailing(text, '\n').replace("\n", lineStartReplacement);
|
||||
|
||||
Reference in New Issue
Block a user