MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / detectLanguageFromContents

Method detectLanguageFromContents

src/NotepadNextApplication.cpp:337–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337QString NotepadNextApplication::detectLanguageFromContents(ScintillaNext *editor) const
338{
339 qInfo(Q_FUNC_INFO);
340
341 LuaExtension::Instance().setEditor(editor);
342
343 return getLuaState()->executeAndReturn<QString>(R"(
344 -- Grab a small chunk
345 if editor.Length > 0 then
346 editor:SetTargetRange(0, math.min(64, editor.Length))
347 return DetectLanguageFromContents(editor.TargetText)
348 end
349
350 return "Text"
351 )");
352}
353
354void NotepadNextApplication::sendInfoToPrimaryInstance()
355{

Callers

nothing calls this directly

Calls 1

setEditorMethod · 0.45

Tested by

no test coverage detected