Skip to content

Commit

Permalink
Merge pull request #42 from skranz/master
Browse files Browse the repository at this point in the history
Autocompletion: R code completition not called when Ctrl-Space is pressed twice
  • Loading branch information
trestletech committed Apr 9, 2016
2 parents 660a789 + 966280a commit 2e07059
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions inst/www/shinyAce.js
Expand Up @@ -62,7 +62,11 @@ var rlangCompleter = {
var inputId = editor.container.id;
Shiny.onInputChange('shinyAce_' + inputId + '_hint', {
linebuffer: session.getLine(pos.row),
cursorPosition: pos.column
cursorPosition: pos.column,
// nonce causes autcomplement event to trigger
// on R side even if Ctrl-Space is pressed twice
// with the same linebuffer and cursorPosition
nonce: Math.random()
});
//store callback for dynamic completion
$('#' + inputId).data('autoCompleteCallback', callback);
Expand Down Expand Up @@ -125,4 +129,4 @@ Shiny.addCustomMessageHandler('shinyAce', function(data) {
var callback = $el.data('autoCompleteCallback');
if(callback !== undefined) callback(null, words);
}
});
});

0 comments on commit 2e07059

Please sign in to comment.