| 315 | } |
| 316 | |
| 317 | QString NotepadNextApplication::detectLanguageFromExtension(const QString &extension) const |
| 318 | { |
| 319 | qInfo(Q_FUNC_INFO); |
| 320 | |
| 321 | getLuaState()->setVariable("ext", extension); |
| 322 | |
| 323 | return getLuaState()->executeAndReturn<QString>(R"( |
| 324 | for name, L in pairs(languages) do |
| 325 | if L.extensions then |
| 326 | for _, v in ipairs(L.extensions) do |
| 327 | if v == ext then |
| 328 | return name |
| 329 | end |
| 330 | end |
| 331 | end |
| 332 | end |
| 333 | return "Text" |
| 334 | )"); |
| 335 | } |
| 336 | |
| 337 | QString NotepadNextApplication::detectLanguageFromContents(ScintillaNext *editor) const |
| 338 | { |
nothing calls this directly
no test coverage detected