Skip to content

Commit

Permalink
texteditor_plg.cpp: better defaults?
Browse files Browse the repository at this point in the history
More files we can handle by text editing.
  • Loading branch information
diegoiast committed Sep 17, 2024
1 parent 89022f2 commit bfe5d17
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/plugins/texteditor/texteditor_plg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,20 @@ int TextEditorPlugin::canOpenFile(const QString fileName) {
}

static const QStringList extensions = {
".c", ".cpp", ".cxx", ".h", ".hpp", ".hxx", ".inc", ".pro", ".pri", ".txt", ".inc",
".java", ".js", ".py", ".rb", ".pas", "bas", ".swift", ".bat", ".sh", ".md"};
".c", ".cpp", ".cxx", ".h", ".hpp", ".hxx", ".inc",
".pro", ".pri", ".txt", ".inc", ".java", ".js", ".py",
".rb", ".pas", "bas", ".swift", ".mk", ".bat", ".sh",
".md", ".user", ".bak", ".txt", ".text", ".dox", ".desktop",
".old", "license", "readme", "copying", "Makefile", "Doxyfile"};
for (const QString &ext : extensions) {
if (fileName.endsWith(ext, Qt::CaseInsensitive)) {
return 5;
}
}

if (fileName.startsWith(".")) {
return 5;
}
return 2;
}

Expand Down

0 comments on commit bfe5d17

Please sign in to comment.