Skip to content

Commit

Permalink
Fix newline missing from command CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
fqqb committed Apr 19, 2024
1 parent 962050c commit c536134
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException {

// Write CSV
try {
writeEvents(new File(targetFile), view.getTableViewer().getTable());
writeCommands(new File(targetFile), view.getTableViewer().getTable());
MessageDialog.openInformation(shell, "Export Command History", "Command History exported successfully.");
} catch (Exception e) {
MessageDialog.openError(shell, "Export Command History",
Expand All @@ -52,7 +52,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
return null;
}

private void writeEvents(File targetFile, Table table) throws IOException {
private void writeCommands(File targetFile, Table table) throws IOException {
try (var writer = new FileWriter(targetFile)) {
var first = true;
for (var tc : table.getColumns()) {
Expand All @@ -62,6 +62,7 @@ private void writeEvents(File targetFile, Table table) throws IOException {
writer.write(tc.getText());
first = false;
}
writer.write("\n");

for (var item : table.getItems()) {
var rec = new String[table.getColumnCount()];
Expand Down

0 comments on commit c536134

Please sign in to comment.