Kaydet (Commit) e2571f2c authored tarafından Guido van Rossum's avatar Guido van Rossum

Fix off-by-one error in Tim's recent change to comment_region(): the

list of lines returned by get_region() contains an empty line at the
end representing the start of the next line, and this shouldn't be
commented out!
üst a3b4a33f
......@@ -347,7 +347,7 @@ class AutoIndent:
def comment_region_event(self, event):
head, tail, chars, lines = self.get_region()
for pos in range(len(lines)):
for pos in range(len(lines) - 1):
line = lines[pos]
lines[pos] = '##' + line
self.set_region(head, tail, chars, lines)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment