Do not override previous fix

If there are two words misspelled in a line, codespell was detecting
both, but when writing them to file only the latest was actually being
fixed. This is because we used the wrong line string to fix them.
This commit is contained in:
Lucas De Marchi
2011-04-14 13:54:11 -03:00
parent 3a0c196609
commit 7a724ef9b1

View File

@ -178,7 +178,7 @@ def parse_file(filename, colors):
if options.write_changes and misspellings[lword].fix:
changed = True
lines[i - 1] = line.replace(word, fixword, 1)
lines[i - 1] = lines[i - 1].replace(word, fixword, 1)
continue
cfilename = "%s%s%s" % (colors.FILE, filename, colors.DISABLE)