parent
69eff05223
commit
a1a6066a33
13
mode/perl.py
13
mode/perl.py
|
@ -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)
|
||||
if end < len(w.buffer.lines) - 1:
|
||||
end_p = Point(0, end + 1)
|
||||
window.kill(start_p, end_p)
|
||||
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):
|
||||
'''Wrap Comments and POD'''
|
||||
|
|
Loading…
Reference in New Issue