Skip to content

Commit

Permalink
prevent \n avalanche
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Jan 14, 2025
1 parent d5bd27d commit 0b0d7f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/asammdf/gui/widgets/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ def to_config(self):
config["windows"] = windows
config["active_window"] = current_window.windowTitle() if current_window else ""
config["functions"] = self.functions
config["global_variables"] = self.global_variables
config["global_variables"] = "\n".join([line for line in self.global_variables.splitlines() if line])

return config

Expand Down Expand Up @@ -1268,6 +1268,7 @@ def load_channel_list(self, event=None, file_name=None, manually=False, show_pro

self.functions.update(info.get("functions", {}))
self.global_variables = f'{self.global_variables}\n{info.get("global_variables", "")}'
self.global_variables = '\n'.join([line for line in self.global_variables.splitlines() if line])

if channels:
iterator = QtWidgets.QTreeWidgetItemIterator(self.channels_tree)
Expand Down

0 comments on commit 0b0d7f3

Please sign in to comment.