From e806e70958f68a3b0dc9c841cacabacf011ac973 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Thu, 2 Sep 2010 21:26:39 +0200 Subject: Avoiding empty lines in history --- src/gui/widgets/textfield.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index cffda1e3..4989ae83 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -277,7 +277,8 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent) if (mHistory) { // If the input is different from previous, put it in the history - if (mHistory->empty() || !mHistory->matchesLastEntry(getText())) + if (!getText().empty() && (mHistory->empty() || + !mHistory->matchesLastEntry(getText()))) { mHistory->addEntry(getText()); } -- cgit v1.2.3-70-g09d2