|
5 | 5 |
|
6 | 6 | DiffViewerTextBuilder::DiffViewerTextBuilder() |
7 | 7 | { |
8 | | - |
| 8 | + global = Global::getInstance(); |
9 | 9 | } |
10 | 10 |
|
11 | 11 | QString DiffViewerTextBuilder::generateText(QJsonValue jsonVal, QJsonObject comments, bool isTopLevel= true) |
@@ -88,6 +88,14 @@ void DiffViewerTextBuilder::pasteLexem(const QJsonObject &lex) |
88 | 88 | text.append("<font style=\"background-color: #E5F0FF;\">"); |
89 | 89 | text.append(lex["string"].toString()); |
90 | 90 | text.append("</font>"); |
| 91 | + }else if (lex["type"].toString() == "errorLexem"){ |
| 92 | + if(lex["id"] == global->getSelectedErrorLexId()){ |
| 93 | + text.append("<font style=\"background-color:#ffffe6;\">"); |
| 94 | + }else{ |
| 95 | + text.append("<font style=\"background-color:#FF9CA1;\">"); |
| 96 | + } |
| 97 | + text.append(lex["string"].toString()); |
| 98 | + text.append("</font>"); |
91 | 99 | }else { |
92 | 100 | text.append(lex["string"].toString()); |
93 | 101 | } |
@@ -144,16 +152,22 @@ void DiffViewerTextBuilder::genList(const QJsonObject &listObj, bool isFirstCall |
144 | 152 |
|
145 | 153 |
|
146 | 154 | pasteSpacesBeforeParent(getTrueLine(lparenCoord[0].toInt()),lparenCoord[1].toInt()); |
147 | | - if(listObj["diff-st"].toString() == "deleted"){ |
| 155 | + if((listObj["diff-st"].toString() == "deleted") || |
| 156 | + listObj["isIllegalNode"].toBool()){ |
148 | 157 | text.append("<font style=\"background-color:#FF9CA1;\">"); |
149 | 158 | main_part(); |
150 | 159 | text.append("</font>"); |
151 | 160 | }else if (listObj["diff-st"].toString() == "new"){ |
152 | 161 | text.append("<font style=\"background-color:#C9FFBF;\">"); |
153 | 162 | main_part(); |
154 | 163 | text.append("</font>"); |
155 | | - }else if(listObj["diff-st"].toString() == "moved"){ |
156 | | - text.append("<font style=\"background-color: #E5F0FF;\">"); |
| 164 | + }else if(listObj["diff-st"].isArray() && listObj["diff-st"].toArray()[0] == "moved"){ |
| 165 | + if((global->currentTextVersion == 1 && global->current_selected_moved_ids[1] == listObj["diff-st"].toArray()[1].toInt()) |
| 166 | + || (global->currentTextVersion == 2 && global->current_selected_moved_ids[0] == listObj["diff-st"].toArray()[1].toInt())){ |
| 167 | + text.append("<font style=\"background-color: #AAA0FF;\">"); |
| 168 | + } else { |
| 169 | + text.append("<font style=\"background-color: #E5F0FF;\">"); |
| 170 | + } |
157 | 171 | main_part(); |
158 | 172 | text.append("</font>"); |
159 | 173 | }else { |
|
0 commit comments