41 Public method to show the given diff. |
41 Public method to show the given diff. |
42 |
42 |
43 @param diff text containing the unified diff |
43 @param diff text containing the unified diff |
44 @type str |
44 @type str |
45 """ |
45 """ |
|
46 self.__highlighter.regenerateRules( |
|
47 { |
|
48 "text": Preferences.getDiffColour("TextColor"), |
|
49 "added": Preferences.getDiffColour("AddedColor"), |
|
50 "removed": Preferences.getDiffColour("RemovedColor"), |
|
51 "replaced": Preferences.getDiffColour("ReplacedColor"), |
|
52 "context": Preferences.getDiffColour("ContextColor"), |
|
53 "header": Preferences.getDiffColour("HeaderColor"), |
|
54 "whitespace": Preferences.getDiffColour("BadWhitespaceColor"), |
|
55 }, |
|
56 Preferences.getEditorOtherFonts("MonospacedFont"), |
|
57 ) |
46 self.diffEdit.clear() |
58 self.diffEdit.clear() |
47 self.__highlighter.regenerateRules() |
|
48 |
59 |
49 if diff: |
60 if diff: |
50 self.diffEdit.setPlainText(diff) |
61 self.diffEdit.setPlainText(diff) |
51 else: |
62 else: |
52 self.diffEdit.setPlainText(self.tr("There is no difference.")) |
63 self.diffEdit.setPlainText(self.tr("There is no difference.")) |