| 335 | } |
| 336 | |
| 337 | QString 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 | |
| 354 | void NotepadNextApplication::sendInfoToPrimaryInstance() |
| 355 | { |