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