From 6888c6ef60f596bb29511beb6f9088e6e5d78c3c Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Wed, 30 May 2012 21:41:50 +0200 Subject: [PATCH] Made history saving/loading respect the 'do not save duplicate lines' setting --- deluge/ui/console/modes/legacy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/modes/legacy.py b/deluge/ui/console/modes/legacy.py index c1146302f..856dfabcd 100644 --- a/deluge/ui/console/modes/legacy.py +++ b/deluge/ui/console/modes/legacy.py @@ -179,7 +179,13 @@ class Legacy(BaseMode, component.Component): for line in self.lines: line = format_utils.remove_formatting(line) if line.startswith(">>> "): - self.input_history.append( line[4:] ) + input = line[4:] + if self.console_config["ignore_duplicate_lines"]: + if len(self.input_history) > 0: + if self.input_history[-1] != input: + self.input_history.append(input) + else: + self.input_history.append(input) self.input_history_index = len(self.input_history)