LineCount return the number of lines in this document. If the document ends with a trailing \n, that counts as the beginning of a new line.
()
| 380 | // LineCount return the number of lines in this document. If the document ends |
| 381 | // with a trailing \n, that counts as the beginning of a new line. |
| 382 | func (d *Document) LineCount() int { |
| 383 | return len(d.Lines()) |
| 384 | } |
| 385 | |
| 386 | // TranslateIndexToPosition given an index for the text, return the corresponding (row, col) tuple. |
| 387 | // (0-based. Returns (0, 0) for index=0.) |