branch : pmacs2
This commit is contained in:
moculus 2007-08-21 13:23:45 +00:00
parent 69eff05223
commit a1a6066a33
1 changed files with 9 additions and 6 deletions

View File

@ -451,9 +451,9 @@ class PerlWhichFunction(Method):
class PerlHashCleanup(Method): class PerlHashCleanup(Method):
'''Correctly align assignment blocks and literal hashes''' '''Correctly align assignment blocks and literal hashes'''
def _execute(self, window, **vargs): def _execute(self, w, **vargs):
cursor = window.logical_cursor() cursor = w.logical_cursor()
b = window.buffer b = w.buffer
# so this is where we will store the groups that we find # so this is where we will store the groups that we find
groups_by_line = {} groups_by_line = {}
@ -520,9 +520,12 @@ class PerlHashCleanup(Method):
# remove the old text and add the new # remove the old text and add the new
start_p = Point(0, start) start_p = Point(0, start)
end_p = Point(0, end + 1) if end < len(w.buffer.lines) - 1:
window.kill(start_p, end_p) end_p = Point(0, end + 1)
window.insert_string(start_p, data) else:
end_p = Point(len(w.buffer.lines[end]), end)
w.kill(start_p, end_p)
w.insert_string(start_p, data)
class PerlWrapLine(Method): class PerlWrapLine(Method):
'''Wrap Comments and POD''' '''Wrap Comments and POD'''