fix websocketMsgSrv.completion paragraph id issue

Change-Id: I3c094abf2a867c5e5b3ddd5ef7f24fd0710f7a1d
This commit is contained in:
Prabhjyot Singh 2018-03-23 16:52:15 +05:30
parent 9380c32faa
commit 508cd239c2
No known key found for this signature in database
GPG key ID: E8B414FA26357220

View file

@ -755,6 +755,12 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
completionListLength = data;
});
$scope.$on('callCompletion', function(event, data) {
if($scope.paragraphFocused) {
websocketMsgSrv.completion($scope.paragraph.id, data.buf, data.pos);
}
});
let remoteCompleter = {
getCompletions: function(editor, session, pos, prefix, callback) {
let langTools = ace.require('ace/ext/language_tools');
@ -779,7 +785,7 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
pos = session.getTextRange(new Range(0, 0, pos.row, pos.column)).length;
let buf = session.getValue();
websocketMsgSrv.completion($scope.paragraph.id, buf, pos);
$rootScope.$broadcast('callCompletion', {buf: buf, pos: pos});
$scope.$on('completionList', function(event, data) {
let computeCaption = function(value, meta) {