Skip to content

Commit

Permalink
Fixed, gittk demo error
Browse files Browse the repository at this point in the history
  • Loading branch information
ceccopierangiolieugenio committed Apr 19, 2022
1 parent 5e4a5ae commit e19e3ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions demo/gittk.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _tableCallback(val):
commit = allCommits[val]
diff = repo.git.diff(f"{commit.hexsha}~",f"{commit.hexsha}")
# ttk.TTkLog.debug(diff)
lines = []
lines = ttk.TTkString()
for line in diff.split('\n'):
color = ttk.TTkColor.RST
if line.startswith('---') or line.startswith('+++'):
Expand All @@ -93,8 +93,8 @@ def _tableCallback(val):
color = ttk.TTkColor.fg('#ff0000')
elif line.startswith('@@'):
color = ttk.TTkColor.fg('#0088ff')
lines.append(ttk.TTkString() + color + line.replace('\t',' '*4))
diffText.setLines(lines)
lines += ttk.TTkString(line+"\n",color).tab2spaces()
diffText.setText(lines)

tableCommit.activated.connect(_tableCallback)

Expand Down

0 comments on commit e19e3ad

Please sign in to comment.