Skip to content

Commit ac01ea3

Browse files
committed
Fix for bug #3
Rewritten display_diff function to avoid new lines on display
1 parent f767433 commit ac01ea3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

diff.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,16 @@ def display_diff(self):
126126
global file1, diff
127127

128128
with open(file1, "r") as tmp_file1:
129-
o = tmp_file1.readlines()
130-
for x in range(len(o)):
131-
self.textEdit.append(o[x])
132-
self.textEdit_2.toHtml()
129+
for line in tmp_file1:
130+
line=line.strip()
131+
self.textEdit.append(line)
132+
self.textEdit.toHtml()
133133
tmp_file1.close()
134134

135135
with open(diff, "r") as tmp_diff:
136-
d = tmp_diff.readlines()
137-
for x in range(len(d)):
138-
self.textEdit_2.append(d[x])
136+
for line in tmp_diff:
137+
line=line.strip()
138+
self.textEdit_2.append(line)
139139
self.textEdit_2.toHtml()
140140
tmp_diff.close()
141141

0 commit comments

Comments
 (0)