aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/right_panel/GameTabRightPanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/right_panel/GameTabRightPanel.cpp')
-rw-r--r--src/game_tab/right_panel/GameTabRightPanel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game_tab/right_panel/GameTabRightPanel.cpp b/src/game_tab/right_panel/GameTabRightPanel.cpp
index 3a46f59..dd0ebca 100644
--- a/src/game_tab/right_panel/GameTabRightPanel.cpp
+++ b/src/game_tab/right_panel/GameTabRightPanel.cpp
@@ -89,7 +89,12 @@ void GameTabRightPanel::OnCommentChange(wxCommandEvent &event) {
wxLogDebug("GameTabRightPanel: comment input change");
HalfMove *m = game->GetCurrentMove();
if (m != nullptr) {
- m->comment=event.GetString().ToStdString();
+ m->comment=event.GetString().Trim().ToStdString();
+ // Remove newlines:
+ for(char &c:m->comment){
+ if(c=='\n')
+ c=' ';
+ }
}
editor_canvas->Refresh();
}