mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: oneside viewer - hide chevrone operations on state invalidation
* they will do nothing anyway
This commit is contained in:
@@ -235,6 +235,7 @@ public class OnesideDiffChange {
|
||||
|
||||
@Nullable
|
||||
public GutterIconRenderer createRenderer() {
|
||||
if (myViewer.isStateIsOutOfDate()) return null;
|
||||
if (!myViewer.isEditable(mySide.other(), true)) return null;
|
||||
boolean bothEditable = myViewer.isEditable(mySide, true);
|
||||
|
||||
|
||||
@@ -383,6 +383,22 @@ public class OnesideDiffViewer extends TextDiffViewerBase {
|
||||
updateEditorCanBeTyped();
|
||||
}
|
||||
|
||||
@CalledInAwt
|
||||
protected void markSuppressEditorTyping() {
|
||||
mySuppressEditorTyping = true;
|
||||
updateEditorCanBeTyped();
|
||||
}
|
||||
|
||||
@CalledInAwt
|
||||
protected void markStateIsOutOfDate() {
|
||||
myStateIsOutOfDate = true;
|
||||
if (myChangedBlockData != null) {
|
||||
for (OnesideDiffChange diffChange : myChangedBlockData.getDiffChanges()) {
|
||||
diffChange.updateGutterActions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private EditorHighlighter buildHighlighter(@Nullable Project project,
|
||||
@NotNull DocumentContent content1,
|
||||
@@ -611,8 +627,7 @@ public class OnesideDiffViewer extends TextDiffViewerBase {
|
||||
if (twosideStartLine == -1 || twosideEndLine == -1) {
|
||||
// this should never happen
|
||||
logDebugInfo(e, onesideStartPosition, onesideEndPosition, twosideStartLine, twosideEndLine);
|
||||
mySuppressEditorTyping = true;
|
||||
updateEditorCanBeTyped();
|
||||
markSuppressEditorTyping();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -630,7 +645,7 @@ public class OnesideDiffViewer extends TextDiffViewerBase {
|
||||
finally {
|
||||
// TODO: we can avoid marking state out-of-date in some simple cases (like in SimpleDiffViewer)
|
||||
// but this will greatly increase complexity, so let's wait if it's actually required by users
|
||||
myStateIsOutOfDate = true;
|
||||
markStateIsOutOfDate();
|
||||
|
||||
myFoldingModel.onDocumentChanged(e);
|
||||
scheduleRediff();
|
||||
@@ -673,9 +688,8 @@ public class OnesideDiffViewer extends TextDiffViewerBase {
|
||||
protected void onDocumentChange(@NotNull DocumentEvent e) {
|
||||
if (myDuringTwosideDocumentModification) return;
|
||||
|
||||
myStateIsOutOfDate = true;
|
||||
mySuppressEditorTyping = true;
|
||||
updateEditorCanBeTyped();
|
||||
markStateIsOutOfDate();
|
||||
markSuppressEditorTyping();
|
||||
|
||||
myFoldingModel.onDocumentChanged(e);
|
||||
scheduleRediff();
|
||||
|
||||
Reference in New Issue
Block a user