Skip to content

Commit b9ec948

Browse files
committed
[FIX] default settings initialization fixed => 1.4.1
Targets issue #6
1 parent 5080403 commit b9ec948

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/main/java/net/seesharpsoft/intellij/plugins/csv/formatter/CsvCodeStyleSettings.java

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public static String getCurrentSeparator() {
4242

4343
public CsvCodeStyleSettings(CodeStyleSettings settings) {
4444
super("CsvCodeStyleSettings", settings);
45-
settings.getIndentOptions().TAB_SIZE = 1;
46-
settings.getIndentOptions().INDENT_SIZE = 1;
47-
settings.getIndentOptions().USE_TAB_CHARACTER = false;
4845
}
4946

5047
public boolean SPACE_BEFORE_SEPARATOR = false;

src/main/java/net/seesharpsoft/intellij/plugins/csv/formatter/CsvLanguageCodeStyleSettingsProvider.java

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.intellij.lang.Language;
44
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable;
5+
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
56
import com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider;
67
import net.seesharpsoft.intellij.plugins.csv.CsvLanguage;
78
import org.jetbrains.annotations.NotNull;
@@ -68,4 +69,14 @@ public String getCodeSample(@NotNull SettingsType settingsType) {
6869
"3.1\n" +
6970
"5 ,Holmes HEPA Air Purifier,Carlos Soltero,515,30.94,21.78";
7071
}
72+
73+
@Override
74+
public CommonCodeStyleSettings getDefaultCommonSettings() {
75+
CommonCodeStyleSettings commonSettings = new CommonCodeStyleSettings(getLanguage());
76+
commonSettings.initIndentOptions();
77+
commonSettings.getIndentOptions().TAB_SIZE = 1;
78+
commonSettings.getIndentOptions().INDENT_SIZE = 1;
79+
commonSettings.getIndentOptions().USE_TAB_CHARACTER = false;
80+
return commonSettings;
81+
}
7182
}

src/main/resources/META-INF/plugin.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
22
<id>net.seesharpsoft.intellij.plugins.csv</id>
33
<name>CSV Plugin</name>
4-
<version>1.4</version>
4+
<version>1.4.1</version>
55
<vendor url="https://github.com/SeeSharpSoft/intellij-csv-validator">
66
Martin Sommer
77
</vendor>
@@ -29,7 +29,8 @@
2929
]]></description>
3030

3131
<change-notes><![CDATA[
32-
Handle tabs as 1-length character - fixes 'Tabularize' for csv files with tabs
32+
Handle tabs as 1-length character - fixes 'Tabularize' for csv files with tabs<br>
33+
Fix default settings initialization
3334
]]>
3435
</change-notes>
3536

0 commit comments

Comments
 (0)