aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-07-16 22:20:20 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2015-08-06 13:12:45 +0200
commit6dc558ed2071176bd8d099ba8e3eae37adcf266d (patch)
treec6fd9dc116f0ebf9ec31688239eabd5e48dabd40
parent005336ba8c3ce50cb7fa445252b0139f1bf7bcf4 (diff)
downloaddotfiles-6dc558ed2071176bd8d099ba8e3eae37adcf266d.tar.xz
weechat: buffers.pl: 5.0 -> 5.1
-rw-r--r--weechat/perl/buffers.pl17
1 files changed, 14 insertions, 3 deletions
diff --git a/weechat/perl/buffers.pl b/weechat/perl/buffers.pl
index 472f6e9..c31d8fc 100644
--- a/weechat/perl/buffers.pl
+++ b/weechat/perl/buffers.pl
@@ -20,6 +20,8 @@
#
# History:
#
+# 2015-03-29, Ed Santiago <ed@edsantiago.com>
+# v5.1: merged buffers: always indent, except when filling is horizontal
# 2014-12-12
# v5.0: fix cropping non-latin buffer names
# 2014-08-29, Patrick Steinhardt <ps@pks.im>:
@@ -164,7 +166,7 @@ use strict;
use Encode qw( decode encode );
# -----------------------------[ internal ]-------------------------------------
my $SCRIPT_NAME = "buffers";
-my $SCRIPT_VERSION = "5.0";
+my $SCRIPT_VERSION = "5.1";
my $BUFFERS_CONFIG_FILE_NAME = "buffers";
my $buffers_config_file;
@@ -1298,8 +1300,17 @@ sub build_buffers
}
else
{
- my $indent = "";
- $indent = ((" " x length($buffer->{"number"}))." ") if (($position eq "left") || ($position eq "right"));
+ # Indentation aligns channels in a visually appealing way
+ # when viewing list top-to-bottom...
+ my $indent = (" " x length($buffer->{"number"}))." ";
+ # ...except when list is top/bottom and channels left-to-right.
+ my $option_pos = weechat::config_string( weechat::config_get( "weechat.bar.buffers.position" ) );
+ if (($option_pos eq 'top') || ($option_pos eq 'bottom')) {
+ my $option_filling = weechat::config_string( weechat::config_get( "weechat.bar.buffers.filling_top_bottom" ) );
+ if ($option_filling =~ /horizontal/) {
+ $indent = '';
+ }
+ }
$str .= weechat::color("default")
.$color_bg
.$indent;