From 83b464312d02beb49743fa45ccd5380ebcdd02f9 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 1 Oct 2019 21:45:11 +0200 Subject: gui.widgets.statusbar: Truncate the VCS commit message Fixes #1704. --- ranger/gui/widgets/statusbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index 71064ed4..c735b8f8 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -212,7 +212,7 @@ class StatusBar(Widget): # pylint: disable=too-many-instance-attributes left.add_space() left.add(directory.vcs.rootvcs.head['date'].strftime(self.timeformat), 'vcsdate') left.add_space() - left.add(directory.vcs.rootvcs.head['summary'], 'vcscommit') + left.add(directory.vcs.rootvcs.head['summary'][:70], 'vcscommit') def _get_owner(self, target): uid = target.stat.st_uid -- cgit From 24a5736e3928ffe034bd733b97ba0d99990603b7 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 1 Oct 2019 21:56:21 +0200 Subject: Change the commit msg truncation point 50 characters seems to be the recommended length of the Git commit messages. --- ranger/gui/widgets/statusbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index c735b8f8..19113012 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -212,7 +212,7 @@ class StatusBar(Widget): # pylint: disable=too-many-instance-attributes left.add_space() left.add(directory.vcs.rootvcs.head['date'].strftime(self.timeformat), 'vcsdate') left.add_space() - left.add(directory.vcs.rootvcs.head['summary'][:70], 'vcscommit') + left.add(directory.vcs.rootvcs.head['summary'][:50], 'vcscommit') def _get_owner(self, target): uid = target.stat.st_uid -- cgit