Merge pull request #389 from glowing-bear/fix-history-exception

Fix an exception when pressing up-arrow in a buffer without history
This commit is contained in:
David Cormier 2014-07-31 09:26:12 -04:00
commit 770616cf93

View file

@ -1593,7 +1593,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;
}