mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: better highlighting for fragmented diff near shoene gutter
This commit is contained in:
+3
-1
@@ -69,7 +69,7 @@ public class FragmentedEditorHighlighter implements EditorHighlighter {
|
||||
|
||||
if (range.getEndOffset() >= iterator.getStart()) {
|
||||
int relativeStart = Math.max(iterator.getStart() - range.getStartOffset(), 0);
|
||||
int relativeEnd = Math.min(iterator.getEnd() - range.getStartOffset(), range.getLength());
|
||||
int relativeEnd = Math.min(iterator.getEnd() - range.getStartOffset(), range.getLength() + 1);
|
||||
boolean merged = false;
|
||||
if (myMergeByTextAttributes && !myPieces.isEmpty()) {
|
||||
Element element = myPieces.get(myPieces.size() - 1);
|
||||
@@ -93,6 +93,8 @@ public class FragmentedEditorHighlighter implements EditorHighlighter {
|
||||
|
||||
if (range.getEndOffset() < iterator.getEnd()) {
|
||||
offset += range.getLength() + 1 + myAdditionalOffset; // myAdditionalOffset because of extra line - for shoene separators
|
||||
int lastEnd = myPieces.isEmpty() ? -1 : myPieces.get(myPieces.size() - 1).getEnd();
|
||||
myPieces.add(new Element(Math.max(offset - 1 - myAdditionalOffset, lastEnd), offset, null, TextAttributes.ERASE_MARKER));
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user