mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
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!
This commit is contained in:
parent
a3b4a33f3b
commit
e2571f2ce7
1 changed files with 1 additions and 1 deletions
|
@ -347,7 +347,7 @@ class AutoIndent:
|
||||||
|
|
||||||
def comment_region_event(self, event):
|
def comment_region_event(self, event):
|
||||||
head, tail, chars, lines = self.get_region()
|
head, tail, chars, lines = self.get_region()
|
||||||
for pos in range(len(lines)):
|
for pos in range(len(lines) - 1):
|
||||||
line = lines[pos]
|
line = lines[pos]
|
||||||
lines[pos] = '##' + line
|
lines[pos] = '##' + line
|
||||||
self.set_region(head, tail, chars, lines)
|
self.set_region(head, tail, chars, lines)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue