package ro.bogdananton.testNameGenerator.settings;

import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorSettings;
import com.intellij.openapi.project.Project;
import com.intellij.util.SystemProperties;
import ro.bogdananton.testNameGenerator.generateTestName;
import ro.bogdananton.testNameGenerator.utils.EditorIntegration;

import java.util.Arrays;

public class EditorDetails
{
    public static String getTabChar()
    {
        int indentSpaces = generateTestName.DEFAULT_INDENT_SPACES;
        boolean useTabCharacter = false;

        try {
            Editor editor = EditorIntegration.getEditor();
            EditorSettings settings = editor.getSettings();
            Project project = editor.getProject();

            useTabCharacter = settings.isUseTabCharacter(project);
            indentSpaces = settings.getTabSize(project);

        } catch (Exception e) {
            // will default to using spaces
        }

        if (useTabCharacter) {
            return "\t";
        }

        char[] charArray = new char[indentSpaces];
        Arrays.fill(charArray, ' ');
        return new String(charArray);
    }

    public static String getLineDelimiter()
    {
        return SystemProperties.getLineSeparator();
    }
}


@@ -1205,32 +1205,56 @@
 ()%0A    %7B%0A       
+ return %22%5Cn%22;%0A        //
  return SystemPr

Update EditorDetails.java