mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 22:11:40 +07:00
restore space in Python line comment prefix (PY-10929); re-fix PY-9840 correctly
This commit is contained in:
@@ -48,6 +48,7 @@ public class EnterInLineCommentHandler extends EnterHandlerDelegateAdapter {
|
||||
if (offset < document.getTextLength() && text.charAt(offset) != '\n') {
|
||||
String prefix = commenter.getLineCommentPrefix();
|
||||
assert prefix != null: "Line Comment type is set but Line Comment Prefix is null!";
|
||||
prefix = prefix.trim();
|
||||
if (!StringUtil.startsWith(text, offset, prefix)) {
|
||||
if (text.charAt(caretOffset) != ' ' && !prefix.endsWith(" ")) {
|
||||
prefix += " ";
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class PythonCommenter implements CodeDocumentationAwareCommenter, IndentedCommenter {
|
||||
public String getLineCommentPrefix() {
|
||||
return "#";
|
||||
return "# ";
|
||||
}
|
||||
|
||||
public String getBlockCommentPrefix() {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
def foo():
|
||||
#i = 1
|
||||
# i = 1
|
||||
j = 2
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#noinspection PyUnresolvedReferences
|
||||
# noinspection PyUnresolvedReferences
|
||||
print x<caret>xx
|
||||
Reference in New Issue
Block a user