промежуточный. использовал невидимый символ для обозначения различий

This commit is contained in:
2025-03-26 00:11:41 +03:00
parent a47a6705d8
commit b900622e4e
4 changed files with 13 additions and 44 deletions

36
.idea/workspace.xml generated
View File

@@ -7,45 +7,9 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/DiffUtils.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/UnifiedDiffUtils.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/algorithm/Change.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/algorithm/DiffAlgorithmFactory.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/algorithm/DiffAlgorithmI.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/algorithm/DiffAlgorithmListener.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/algorithm/myers/MyersDiff.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/algorithm/myers/MyersDiffWithLinearSpace.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/algorithm/myers/PathNode.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/AbstractDelta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/ChangeDelta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/Chunk.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/ConflictOutput.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/DeleteDelta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/DeltaType.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/DiffException.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/EqualDelta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/InsertDelta.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/Patch.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/PatchFailedException.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/patch/VerifyChunk.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/text/DiffRow.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/text/DiffRowGenerator.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/text/StringUtils.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/text/deltamerge/DeltaMergeUtils.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/text/deltamerge/InlineDeltaMergeInfo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/unifieddiff/UnifiedDiff.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/unifieddiff/UnifiedDiffFile.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/unifieddiff/UnifiedDiffParserException.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/unifieddiff/UnifiedDiffReader.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/unifieddiff/UnifiedDiffWriter.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/com/github/difflib/unifieddiff/package-info.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/artifacts/VisualSapfor_jar.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/artifacts/VisualSapfor_jar.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" /> <change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/MainMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/MainMenuBar.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/MainMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/MainMenuBar.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/VisualiserSettingsMenu/VersionsComparisonMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/VisualiserSettingsMenu/VersionsComparisonMenu.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/ComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/ComparisonForm.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/ComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/ComparisonForm.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />

View File

@@ -4,7 +4,7 @@
"ServerUserPassword": "mprit_2011", "ServerUserPassword": "mprit_2011",
"OfferRegistrationOnStart": true, "OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests", "Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1742890241", "ProjectsSearchDirectory": "E:\\BUG",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system", "DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads", "VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F", "Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
@@ -15,7 +15,7 @@
"AutoTestsLoad": true, "AutoTestsLoad": true,
"ConfirmPassesStart": true, "ConfirmPassesStart": true,
"ShowPassesDone": true, "ShowPassesDone": true,
"FocusPassesResult": false, "FocusPassesResult": true,
"collapseCredentials": true, "collapseCredentials": true,
"collapseFileGraphs": false, "collapseFileGraphs": false,
"collapseFileMessages": false, "collapseFileMessages": false,

View File

@@ -67,7 +67,7 @@ public class MainMenuBar extends VisualiserMenuBar {
setPreferredSize(new Dimension(0, 30)); setPreferredSize(new Dimension(0, 30));
//-- //--
/*
add(new MenuBarButton() { add(new MenuBarButton() {
{ {
setIcon("/Common/icons/Apply.png"); setIcon("/Common/icons/Apply.png");
@@ -77,6 +77,7 @@ public class MainMenuBar extends VisualiserMenuBar {
}); });
} }
}); });
*/
//-- //--
add(new JSeparator()); add(new JSeparator());
add(MachineButton = new MenuBarButton() { add(MachineButton = new MenuBarButton() {

View File

@@ -9,6 +9,9 @@ import Common.Visual.Menus.VisualiserMenuBar;
import Common.Visual.UI; import Common.Visual.UI;
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor; import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
import _VisualDVM.Utils; import _VisualDVM.Utils;
import com.github.difflib.DiffUtils;
import com.github.difflib.patch.AbstractDelta;
import com.github.difflib.patch.Patch;
import com.github.difflib.text.DiffRow; import com.github.difflib.text.DiffRow;
import com.github.difflib.text.DiffRowGenerator; import com.github.difflib.text.DiffRowGenerator;
import javafx.util.Pair; import javafx.util.Pair;
@@ -16,7 +19,6 @@ import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaHighlighter;
import org.fife.ui.rtextarea.RTextScrollPane; import org.fife.ui.rtextarea.RTextScrollPane;
import javax.swing.*; import javax.swing.*;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Vector; import java.util.Vector;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@@ -48,6 +50,8 @@ public abstract class ComparisonForm<T> {
//----- //-----
private boolean events_on = false;//относится только к мастеру, отвечает за скроллы. private boolean events_on = false;//относится только к мастеру, отвечает за скроллы.
private int current_diff_line = -1; private int current_diff_line = -1;
final String separator = "\u200B";
//невидимый пробел https://translated.turbopages.org/proxy_u/en-ru.ru.898e1daf-67e318c0-3fccff8a-74722d776562/https/stackoverflow.com/questions/17978720/invisible-characters-ascii
//--->> //--->>
// protected Object ownScrollModel = null; // protected Object ownScrollModel = null;
//---<< //---<<
@@ -160,8 +164,8 @@ public abstract class ComparisonForm<T> {
.showInlineDiffs(true) .showInlineDiffs(true)
.inlineDiffByWord(true) .inlineDiffByWord(true)
.ignoreWhiteSpaces(true) .ignoreWhiteSpaces(true)
.oldTag(f -> "~") .oldTag(f -> separator)
.newTag(f -> "**") .newTag(f -> separator)
.build(); .build();
List<DiffRow> rows = generator.generateDiffRows( List<DiffRow> rows = generator.generateDiffRows(
visible_lines, visible_lines,
@@ -176,7 +180,7 @@ public abstract class ComparisonForm<T> {
Body.setCaretPosition(0); Body.setCaretPosition(0);
slave.Body.setCaretPosition(0); slave.Body.setCaretPosition(0);
//-- //--
Pattern master_pattern = Pattern.compile("~.*~"); Pattern master_pattern = Pattern.compile(separator + ".*" + separator);
Matcher master_matcher = master_pattern.matcher(Body.getText()); Matcher master_matcher = master_pattern.matcher(Body.getText());
while (master_matcher.find()) { while (master_matcher.find()) {
Body.getHighlighter().addHighlight( Body.getHighlighter().addHighlight(
@@ -185,7 +189,7 @@ public abstract class ComparisonForm<T> {
SPFEditor.RedTextPainter SPFEditor.RedTextPainter
); );
} }
Pattern slave_pattern = Pattern.compile("\\*.*\\*"); Pattern slave_pattern = Pattern.compile(separator + ".*" + separator);
Matcher slave_matcher = slave_pattern.matcher(slave.Body.getText()); Matcher slave_matcher = slave_pattern.matcher(slave.Body.getText());
while (slave_matcher.find()) { while (slave_matcher.find()) {
slave_highlighter.addHighlight( slave_highlighter.addHighlight(