Skip to content

Commit

Permalink
replaced line[0] with line.startswith()
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Gornostal committed Jan 16, 2013
1 parent cce37ff commit c11b17b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Modific.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ def get_lines_to_hl(self):
current = chunk['start']
deleted_line = None
for line in chunk['lines']:
if line[0] == '-':
if line.startswith('-'):
if (not deleted_line or deleted_line not in deleted):
deleted.append(current)
deleted_line = current
elif line[0] == '+':
elif line.startswith('+'):
if deleted_line:
deleted.pop()
deleted_line = None
Expand Down Expand Up @@ -350,11 +350,11 @@ def get_original_part(self, line_num):
replace_lines = 0
return_this_lines = False
for line in chunk['lines']:
if line[0] == '-' or line[0] == '+':
if line.startswith('-') or line.startswith('+'):
first = first or current
if current == line_num:
return_this_lines = True
if line[0] == '-':
if line.startswith('-'):
ret_lines.append(line[1:])
else:
replace_lines += 1
Expand Down

0 comments on commit c11b17b

Please sign in to comment.