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