Skip to content

Commit

Permalink
Merge pull request #862 from Ruben-Sten/word-count-filetypes
Browse files Browse the repository at this point in the history
Word count only analyses LaTeX files
  • Loading branch information
HannahSchellekens committed Apr 14, 2019
2 parents 1a4a572 + 199b0f9 commit 9dc6d6c
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -33,7 +33,7 @@ open class WordCountAction : AnAction(
"\\usepackage", "\\documentclass", "\\label", "\\linespread", "\\ref", "\\cite", "\\eqref", "\\nameref",
"\\autoref", "\\fullref", "\\pageref", "\\newcounter", "\\newcommand", "\\renewcommand",
"\\setcounter", "\\resizebox", "\\includegraphics", "\\include", "\\input", "\\refstepcounter",
"\\counterwithins", "\\RequirePackage"
"\\counterwithins", "\\RequirePackage", "\\bibliography", "\\bibliographystyle"
)

/**
Expand Down Expand Up @@ -103,6 +103,7 @@ open class WordCountAction : AnAction(
*/
private fun countWords(baseFile: PsiFile): Pair<Int, Int> {
val fileSet = baseFile.referencedFileSet()
.filter { it.name.endsWith(".tex", ignoreCase = true) }
val allNormalText = fileSet.flatMap { it.childrenOfType(LatexNormalText::class) }

val bibliographies = baseFile.childrenOfType(LatexEnvironment::class)
Expand Down

0 comments on commit 9dc6d6c

Please sign in to comment.