Skip to content

Commit

Permalink
change buffers with alt+x by their number instead of index in the mod…
Browse files Browse the repository at this point in the history
…els array
  • Loading branch information
Ailin Nemui committed Aug 29, 2014
1 parent 7c4df46 commit ad50220
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/glowingbear.js
Original file line number Diff line number Diff line change
Expand Up @@ -1658,9 +1658,12 @@ weechat.directive('inputBar', function() {
}

var bufferNumber = code - 48 - 1 ;
var activeBufferId = Object.keys(models.getBuffers())[bufferNumber];
if (activeBufferId) {
models.setActiveBuffer(activeBufferId);
var keyedBuffers = _.filter(_.sortBy(models.getBuffers(), 'number'), function(itembuffer) {
return itembuffer.itemActive;
});
var activeBuffer = keyedBuffers[bufferNumber];
if (activeBuffer) {
models.setActiveBuffer(activeBuffer.id);
$event.preventDefault();
}
}
Expand Down

0 comments on commit ad50220

Please sign in to comment.