From 951abf878bbaa2b851b856fa33f36777f2f98b80 Mon Sep 17 00:00:00 2001
From: David Cormier <david.cormier@savoirfairelinux.com>
Date: Tue, 1 Oct 2013 19:12:29 -0400
Subject: [PATCH] Always have an activeBuffer

---
 js/websockets.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/js/websockets.js b/js/websockets.js
index 2acd306..c51b757 100644
--- a/js/websockets.js
+++ b/js/websockets.js
@@ -205,6 +205,10 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'pluginManager', function($
             bufferInfo['id'] = pointer;
             bufferInfo['lines'] = [];
             buffers[pointer] = bufferInfo
+            if (i == 0) {
+                // first buffer is active buffer by default
+                $rootScope.activeBuffer = buffers[pointer];
+            }
         }
         $rootScope.buffers = buffers;
     }