Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/phuix/PHUIXAutocomplete.js
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | _activate: function(code) { | ||||
var head = range.start; | var head = range.start; | ||||
var prior; | var prior; | ||||
if (head > 1) { | if (head > 1) { | ||||
prior = area.value.substring(head - 2, head - 1); | prior = area.value.substring(head - 2, head - 1); | ||||
} else { | } else { | ||||
prior = '<start>'; | prior = '<start>'; | ||||
} | } | ||||
// If this is a repeating sequence and the previous character is the | |||||
// same as the one the user just typed, like "((", don't reactivate. | |||||
if (prior === String.fromCharCode(code)) { | |||||
return; | |||||
} | |||||
switch (prior) { | switch (prior) { | ||||
case '<start>': | case '<start>': | ||||
case ' ': | case ' ': | ||||
case '\n': | case '\n': | ||||
case '\t': | case '\t': | ||||
case '(': // Might be "(@username, what do you think?)". | case '(': // Might be "(@username, what do you think?)". | ||||
case '-': // Might be an unnumbered list. | case '-': // Might be an unnumbered list. | ||||
case '.': // Might be a numbered list. | case '.': // Might be a numbered list. | ||||
▲ Show 20 Lines • Show All 640 Lines • Show Last 20 Lines |