From 8df3ebf709f413fe23a785c4d33b6a4fe5186801 Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Sun, 22 Jul 2018 07:17:45 -0700 Subject: [PATCH] [top_status_line] use the unique path for the filename if there is not enough room to display the full path Trying to address #526 --- src/top_status_source.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/top_status_source.hh b/src/top_status_source.hh index 6e0c0935..70455996 100644 --- a/src/top_status_source.hh +++ b/src/top_status_source.hh @@ -132,7 +132,11 @@ public: sf_format.clear(); } - sf_filename.set_value(lf->get_filename()); + if (sf_filename.get_width() > lf->get_filename().length()) { + sf_filename.set_value(lf->get_filename()); + } else { + sf_filename.set_value(lf->get_unique_path()); + } } else { sf_format.clear();