Skip to content

Commit

Permalink
Added option to turn off autocompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
tcstewar committed Apr 20, 2018
1 parent 3095157 commit f8ca57e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nengo_gui/static/ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Nengo.Ace = function (uid, args) {
lang_tools.setCompleters([this.completer]);
this.editor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: true
enableLiveAutocompletion: Nengo.config.autocomplete
});
}

Expand Down
1 change: 1 addition & 0 deletions nengo_gui/static/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Nengo.Config = function(parent, args) {
define_option("zoom_fonts", false);
define_option("font_size", 100);
define_option("scriptdir", ".");
define_option("autocomplete", true);

// Ace editor options
define_option("hide_editor", false);
Expand Down
14 changes: 14 additions & 0 deletions nengo_gui/static/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,15 @@ Nengo.Modal.prototype.main_config = function() {
'<div class="help-block with-errors"></div>' +
'</div>' +
'</div>' +
'<div class="form-group">' +
'<div class="checkbox">' +
'<label for="autocomplete" class="control-label">' +
'<input type="checkbox" id="autocomplete">' +
'Use live autocompletion in editor' +
'</label>' +
'<div class="help-block with-errors"></div>' +
'</div>' +
'</div>' +
'<div class="form-group">' +
'<div class="checkbox">' +
'<label for="transparent-nets" class="control-label">' +
Expand Down Expand Up @@ -302,6 +311,11 @@ Nengo.Modal.prototype.main_config = function() {
Nengo.ace.auto_update = $('#sync-editor').prop('checked');
Nengo.ace.update_trigger = $('#sync-editor').prop('checked');
});
$('#autocomplete').prop('checked', Nengo.config.autocomplete);
$('#autocomplete').change(function () {
Nengo.ace.editor.setOption("enableLiveAutocompletion", $('#autocomplete').prop('checked'));
Nengo.config.autocomplete = $('#autocomplete').prop('checked');
});

$('#config-fontsize').val(Nengo.netgraph.font_size);
$('#config-fontsize').bind('keyup input', function () {
Expand Down

0 comments on commit f8ca57e

Please sign in to comment.