File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/table Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,8 @@ protected String sanitizeFieldValue(Object value) {
163
163
}
164
164
165
165
protected String generateCsv (Object [][] data ) {
166
+ CsvColumnInfoMap columnInfoMap = getColumnInfoMap ();
167
+ boolean newLineAtEnd = CsvEditorSettings .getInstance ().isFileEndLineBreak () && (columnInfoMap == null || columnInfoMap .hasEmptyLastLine ());
166
168
StringBuilder result = new StringBuilder ();
167
169
for (int row = 0 ; row < data .length ; ++row ) {
168
170
for (int column = 0 ; column < data [row ].length ; ++column ) {
@@ -172,8 +174,7 @@ protected String generateCsv(Object[][] data) {
172
174
result .append (this .currentSeparator .getCharacter ());
173
175
}
174
176
}
175
- if (row < data .length - 1 ||
176
- (CsvEditorSettings .getInstance ().isFileEndLineBreak () && getColumnInfoMap ().hasEmptyLastLine ())) {
177
+ if (row < data .length - 1 || newLineAtEnd ) {
177
178
result .append ("\n " );
178
179
}
179
180
}
You can’t perform that action at this time.
0 commit comments