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) {
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 }
You can’t perform that action at this time.
0 commit comments