minibar: quick fix to allow literals to be entered.

If you press Enter, the current word will be accepted, even if there are no
matching completions.
(You can now use names of people when constructing sentences in the Letter
grammar, for example.)
This commit is contained in:
hallgren
2011-08-22 17:03:47 +00:00
parent 3afefb0ac9
commit d45b9edcd8

View File

@@ -180,6 +180,7 @@ Input.prototype.complete_typed=function(event) {
if(ws.length>1 || event.keyCode==13) {
if(ws[0]!=words.filtered) filter_completions(ws[0],true);
if(words.count==1) add_word(words.theword);
else if(event.keyCode==13) add_word(ws[0]) // for literals
else if(elem(ws[0],words.completions)) add_word(ws[0]);
else if(words.theword.length>ws[0].length) inp.value=words.theword;
}