MCPcopy Create free account
hub / github.com/Macuyiko/minecraft-python / onCompositionEnd

Function onCompositionEnd

ServerEditorWeb/ace/ace.js:2210–2241  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

2208 };
2209
2210 var onCompositionEnd = function(e) {
2211 if (!host.onCompositionEnd || host.$readOnly) return;
2212 var c = inComposition;
2213 inComposition = false;
2214 var timer = setTimeout(function() {
2215 timer = null;
2216 var str = text.value.replace(/\x01/g, "");
2217 if (inComposition)
2218 return;
2219 else if (str == c.lastValue)
2220 resetValue();
2221 else if (!c.lastValue && str) {
2222 resetValue();
2223 sendText(str);
2224 }
2225 });
2226 inputHandler = function compositionInputHandler(str) {
2227 if (timer)
2228 clearTimeout(timer);
2229 str = str.replace(/\x01/g, "");
2230 if (str == c.lastValue)
2231 return "";
2232 if (c.lastValue && timer)
2233 host.undo();
2234 return str;
2235 };
2236 host.onCompositionEnd();
2237 host.removeListener("mousedown", onCompositionEnd);
2238 if (e.type == "compositionend" && c.range) {
2239 host.selection.setRange(c.range);
2240 }
2241 };
2242
2243
2244

Callers

nothing calls this directly

Calls 2

resetValueFunction · 0.85
sendTextFunction · 0.85

Tested by

no test coverage detected