Fix an exception when pressing up-arrow in a buffer without history

rewrite-with-urlplugin
Lorenz Hübschle-Schneider 11 years ago
parent cbcae58760
commit 57ce4e252a
  1. 4
      js/glowingbear.js

@ -1577,7 +1577,9 @@ weechat.directive('inputBar', function() {
// Set cursor to last position. Need 0ms timeout because browser sets cursor
// position to the beginning after this key handler returns.
setTimeout(function() {
inputNode.setSelectionRange($scope.command.length, $scope.command.length);
if ($scope.command) {
inputNode.setSelectionRange($scope.command.length, $scope.command.length);
}
}, 0);
return true;
}

Loading…
Cancel
Save