MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / AutoCompleteCompleted

Method AutoCompleteCompleted

scintilla/src/ScintillaBase.cxx:333–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void ScintillaBase::AutoCompleteCompleted() {
334 int item = ac.GetSelection();
335 if (item == -1) {
336 AutoCompleteCancel();
337 return;
338 }
339 const std::string selected = ac.GetValue(item);
340
341 ac.Show(false);
342
343 SCNotification scn = {0};
344 scn.nmhdr.code = listType > 0 ? SCN_USERLISTSELECTION : SCN_AUTOCSELECTION;
345 scn.message = 0;
346 scn.wParam = listType;
347 scn.listType = listType;
348 Position firstPos = ac.posStart - ac.startLen;
349 scn.position = firstPos;
350 scn.lParam = firstPos;
351 scn.text = selected.c_str();
352 NotifyParent(scn);
353
354 if (!ac.Active())
355 return;
356 ac.Cancel();
357
358 if (listType > 0)
359 return;
360
361 Position endPos = sel.MainCaret();
362 if (ac.dropRestOfWord)
363 endPos = pdoc->ExtendWordSelect(endPos, 1, true);
364 if (endPos < firstPos)
365 return;
366 AutoCompleteInsert(firstPos, endPos - firstPos, selected.c_str(), static_cast<int>(selected.length()));
367 SetLastXChosen();
368}
369
370int ScintillaBase::AutoCompleteGetCurrent() {
371 if (!ac.Active())

Callers 1

Calls 7

ActiveMethod · 0.80
CancelMethod · 0.80
MainCaretMethod · 0.80
ExtendWordSelectMethod · 0.80
GetSelectionMethod · 0.45
GetValueMethod · 0.45
ShowMethod · 0.45

Tested by

no test coverage detected