Make line numbers start on 1 (not 0).

This is the behavior on most tools and starting with 0 was confusing at times.
This commit is contained in:
Sergio Martínez Portela 2020-12-10 00:24:10 +01:00
parent 28a63a7e5e
commit 4ebd6bfd86

View File

@ -1044,10 +1044,9 @@ class OrgDomReader:
line_count = len(lines)
reader = enumerate(lines)
for linenum, line in reader:
for lnum, line in reader:
linenum = lnum + 1
try:
last_line = linenum + 1 == line_count
if m := RAW_LINE_RE.match(line):
self.add_raw_line(linenum, line)
elif m := HEADLINE_RE.match(line):