From 1d1c71f9191f61029a56724f553cef1dcdbc28c1 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 9 Jun 2016 18:52:08 +0200 Subject: [PATCH] Strip of trailing spaces for history entries --- CHANGELOG.asciidoc | 1 + qutebrowser/browser/history.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 309f4e68e..87adfbf94 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -96,6 +96,7 @@ Fixed - Fixed sharing of cookies between tabs when `private-browsing` is enabled - Toggling values with `:set` now uses lower-case values - Hints now work with (non-standard) links with spaces around the URL +- Strip off trailing spaces for history entries with no title v0.6.2 ------ diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py index fbeb34e3d..45ae7b6db 100644 --- a/qutebrowser/browser/history.py +++ b/qutebrowser/browser/history.py @@ -54,7 +54,10 @@ class Entry: hidden=self.hidden) def __str__(self): - return '{} {} {}'.format(int(self.atime), self.url_str(), self.title) + elems = [str(int(self.atime)), self.url_str()] + if self.title: + elems.append(self.title) + return ' '.join(elems) def __eq__(self, other): return (self.atime == other.atime and