mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Custom foldings: fix placeholder text for folding in block comments
This commit is contained in:
+4
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.lang.customFolding;
|
||||
|
||||
import com.intellij.lang.folding.CustomFoldingProvider;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
|
||||
/**
|
||||
* Supports <a href="http://msdn.microsoft.com/en-us/library/9a1ybwek%28v=vs.100%29.aspx">VisualStudio custom foldings.</a>
|
||||
@@ -34,7 +35,8 @@ public class VisualStudioCustomFoldingProvider extends CustomFoldingProvider {
|
||||
|
||||
@Override
|
||||
public String getPlaceholderText(String elementText) {
|
||||
return elementText.replaceFirst("[/*#-]*\\s*region(.*)","$1").trim();
|
||||
String result = elementText.replaceFirst("[/*#-]*\\s*region(.*)", "$1");
|
||||
return elementText.startsWith("/*") ? StringUtil.trimEnd(result, "*/").trim() : result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user