Skip to content

Commit 3c5e546

Browse files
authored
Merge pull request #323 from SeeSharpSoft/master
Release 2.18.2
2 parents 2b4347f + cb1b334 commit 3c5e546

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

CHANGELOG

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2.18.2
2+
Dec 14, 2021
3+
4+
FIX: java.lang.NullPointerException #320
5+
FIX: Exception when Show info balloon is not selected #318
6+
17
2.18.1
28
Nov 04, 2021
39

build.gradle

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jacocoTestReport {
2727
}
2828

2929
group 'net.seesharpsoft.intellij.plugins'
30-
version '2.18.1'
30+
version '2.18.2'
3131

3232
apply plugin: 'java'
3333
project.sourceCompatibility = JavaVersion.VERSION_11
@@ -79,10 +79,16 @@ apply plugin: 'org.jetbrains.intellij'
7979
intellij {
8080
// IDE version - https://www.jetbrains.com/intellij-repository/releases
8181
version = System.getenv().getOrDefault('IDEA_VERSION', 'IC-2020.1.1')
82-
pluginName = 'CSV Plugin'
82+
pluginName = 'CSV'
8383
updateSinceUntilBuild = false
8484
downloadSources = Boolean.parseBoolean(System.getenv().getOrDefault('IDEA_SOURCES', "true"))
8585
}
86+
patchPluginXml {
87+
changeNotes = """<pre style="font-family: sans-serif">
88+
FIX: java.lang.NullPointerException #320
89+
FIX: Exception when Show info balloon is not selected #318
90+
</pre>"""
91+
}
8692
publishPlugin {
8793
token = System.getenv().getOrDefault('JI_TOKEN', '')
8894
channels = [System.getenv().getOrDefault('JI_CHANNELS', 'Testing')]

src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/CsvAnnotator.java

+13-11
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,18 @@ public void annotate(@NotNull final PsiElement element, @NotNull final Annotatio
6060
);
6161
}
6262

63-
holder.newAnnotation(CSV_COLUMN_INFO_SEVERITY, message)
63+
AnnotationBuilder annotationBuilder = holder.newAnnotation(CSV_COLUMN_INFO_SEVERITY, message)
6464
.range(element)
65-
.tooltip(tooltip)
66-
.enforcedTextAttributes(
67-
CsvEditorSettings.getInstance().getValueColoring() == CsvEditorSettings.ValueColoring.RAINBOW ?
68-
CsvColorSettings.getTextAttributesOfColumn(columnInfo.getColumnIndex(), holder.getCurrentAnnotationSession()) :
69-
null
70-
)
71-
.needsUpdateOnTyping(false)
72-
.create();
65+
.needsUpdateOnTyping(false);
66+
67+
if (CsvEditorSettings.getInstance().getValueColoring() == CsvEditorSettings.ValueColoring.RAINBOW) {
68+
annotationBuilder.enforcedTextAttributes(CsvColorSettings.getTextAttributesOfColumn(columnInfo.getColumnIndex(), holder.getCurrentAnnotationSession()));
69+
}
70+
if (tooltip != null) {
71+
annotationBuilder.tooltip(tooltip);
72+
}
73+
74+
annotationBuilder.create();
7375
}
7476
}
7577

@@ -95,8 +97,8 @@ protected boolean handleSeparatorElement(@NotNull PsiElement element, @NotNull A
9597
holder.getCurrentAnnotationSession().putUserData(TAB_SEPARATOR_HIGHLIGHT_COLOR_DETERMINED_KEY, Boolean.TRUE);
9698
}
9799
}
98-
if (textAttributes != null) {
99-
holder.newAnnotation(CSV_COLUMN_INFO_SEVERITY, showInfoBalloon(holder.getCurrentAnnotationSession()) ? "↹" : null)
100+
if (textAttributes != null && showInfoBalloon(holder.getCurrentAnnotationSession())) {
101+
holder.newAnnotation(CSV_COLUMN_INFO_SEVERITY, "↹")
100102
.range(element)
101103
.enforcedTextAttributes(textAttributes)
102104
.needsUpdateOnTyping(false)

src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/table/CsvTableEditor.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ protected String sanitizeFieldValue(Object value) {
163163
}
164164

165165
protected String generateCsv(Object[][] data) {
166+
CsvColumnInfoMap columnInfoMap = getColumnInfoMap();
167+
boolean newLineAtEnd = CsvEditorSettings.getInstance().isFileEndLineBreak() && (columnInfoMap == null || columnInfoMap.hasEmptyLastLine());
166168
StringBuilder result = new StringBuilder();
167169
for (int row = 0; row < data.length; ++row) {
168170
for (int column = 0; column < data[row].length; ++column) {
@@ -172,8 +174,7 @@ protected String generateCsv(Object[][] data) {
172174
result.append(this.currentSeparator.getCharacter());
173175
}
174176
}
175-
if (row < data.length - 1 ||
176-
(CsvEditorSettings.getInstance().isFileEndLineBreak() && getColumnInfoMap().hasEmptyLastLine())) {
177+
if (row < data.length - 1 || newLineAtEnd) {
177178
result.append("\n");
178179
}
179180
}

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

-8
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@
4848
</p>
4949
]]></description>
5050

51-
<change-notes><![CDATA[
52-
<pre style="font-family: sans-serif">
53-
FIX: set require-restart attribute
54-
NEW: Ability to open urls from IntelliJ CSV view #312
55-
</pre>
56-
]]>
57-
</change-notes>
58-
5951
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
6052
<idea-version since-build="201" />
6153

0 commit comments

Comments
 (0)