Make ctrl-Enter compile straight away; slightly reduce pause

This commit is contained in:
Matt Godbolt
2017-01-03 17:14:49 -06:00
parent d2b6f62919
commit cc27bcd301
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ define(function (require) {
});
var optionsChange = _.debounce(function () {
self.onOptionsChange($(this).val());
}, 1250);
}, 800);
this.domRoot.find(".options")
.val(this.options)
.on("change", optionsChange)
+5 -2
View File
@@ -83,7 +83,10 @@ define(function (require) {
readOnly: state.options ? !!state.options.readOnly : false,
extraKeys: {
"Alt-F": false, // see https://github.com/mattgodbolt/compiler-explorer/pull/131
"Ctrl-/": 'toggleComment'
"Ctrl-/": 'toggleComment',
"Ctrl-Enter": _.bind(function () {
this.maybeEmitChange();
}, this)
},
mode: cmMode
});
@@ -103,7 +106,7 @@ define(function (require) {
// * Only actually triggering a change if the document text has changed from
// the previous emitted.
this.lastChangeEmitted = null;
var ChangeDebounceMs = 1250;
var ChangeDebounceMs = 800;
this.debouncedEmitChange = _.debounce(function () {
if (self.options.get().compileOnChange) self.maybeEmitChange();
}, ChangeDebounceMs);