Trim long buffers

Fixes #338
This commit is contained in:
Lorenz Hübschle-Schneider 2014-06-26 21:38:04 +01:00
parent 8bdfd68438
commit 984ceaf4e5
1 changed files with 5 additions and 0 deletions

View File

@ -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;