From 984ceaf4e57d7da5a50443ec35f56e531912f7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Thu, 26 Jun 2014 21:38:04 +0100 Subject: [PATCH] Trim long buffers Fixes #338 --- js/glowingbear.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/glowingbear.js b/js/glowingbear.js index ee648c8..a40822a 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -698,6 +698,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $rootScope.$on('activeBufferChanged', function(event, unreadSum) { var ab = models.getActiveBuffer(); + + // trim lines to 2 screenfuls + 10 lines + ab.lines.splice(0, ab.lines.length - (2 * $scope.lines + 10)); + ab.requestedLines = ab.lines.length; + $scope.bufferlines = ab.lines; $scope.nicklist = ab.nicklist;