private fun isBlockCommented( startLine: Int, endLine: Int, prefixes: Array<String>, document: IDocument ): Boolean { try { for (i in startLine..endLine) { val line: IRegion = document.getLineInformation(i) val text: String = document.get(line.getOffset(), line.getLength()) val found: IntArray = TextUtilities.indexOf(prefixes, text, 0) if (found[0] == -1) return false var s: String = document.get(line.getOffset(), found[0]) s = s.trim { it <= ' ' } if (s.length != 0) return false } return true } catch (x: javax.swing.text.BadLocationException) { } return false }
Determines whether each line is prefixed by one of the prefixes .