|
@@ -2287,17 +2287,22 @@ namespace IDE.ui
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ var targetSourceEditWidgetContent = mTargetEditWidget.Content as SourceEditWidgetContent;
|
|
|
|
+ var sourceEditWidgetContent = targetSourceEditWidgetContent;
|
|
|
|
+ var prevCursorPosition = sourceEditWidgetContent.CursorTextPos;
|
|
|
|
+ var prevScrollPos = mTargetEditWidget.mVertPos.mDest;
|
|
|
|
+
|
|
UndoBatchStart undoBatchStart = null;
|
|
UndoBatchStart undoBatchStart = null;
|
|
|
|
|
|
var parts = String.StackSplit!(data, '|');
|
|
var parts = String.StackSplit!(data, '|');
|
|
|
|
+ String fixitKind = parts[0];
|
|
String fixitFileName = parts[1];
|
|
String fixitFileName = parts[1];
|
|
SourceViewPanel sourceViewPanel = IDEApp.sApp.ShowSourceFile(fixitFileName);
|
|
SourceViewPanel sourceViewPanel = IDEApp.sApp.ShowSourceFile(fixitFileName);
|
|
|
|
+ bool focusChange = !fixitKind.StartsWith(".");
|
|
|
|
|
|
- var targetSourceEditWidgetContent = mTargetEditWidget.Content as SourceEditWidgetContent;
|
|
|
|
var historyEntry = targetSourceEditWidgetContent.RecordHistoryLocation();
|
|
var historyEntry = targetSourceEditWidgetContent.RecordHistoryLocation();
|
|
historyEntry.mNoMerge = true;
|
|
historyEntry.mNoMerge = true;
|
|
|
|
|
|
- var sourceEditWidgetContent = targetSourceEditWidgetContent;
|
|
|
|
if (sourceEditWidgetContent.mSourceViewPanel != sourceViewPanel)
|
|
if (sourceEditWidgetContent.mSourceViewPanel != sourceViewPanel)
|
|
{
|
|
{
|
|
sourceEditWidgetContent = (SourceEditWidgetContent)sourceViewPanel.GetActivePanel().EditWidget.mEditWidgetContent;
|
|
sourceEditWidgetContent = (SourceEditWidgetContent)sourceViewPanel.GetActivePanel().EditWidget.mEditWidgetContent;
|
|
@@ -2305,6 +2310,11 @@ namespace IDE.ui
|
|
sourceEditWidgetContent.mData.mUndoManager.Add(undoBatchStart);
|
|
sourceEditWidgetContent.mData.mUndoManager.Add(undoBatchStart);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!focusChange)
|
|
|
|
+ {
|
|
|
|
+ sourceEditWidgetContent.CheckRecordScrollTop(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
int32 fixitIdx = 0;
|
|
int32 fixitIdx = 0;
|
|
int32 fixitLen = 0;
|
|
int32 fixitLen = 0;
|
|
StringView fixitLocStr = parts[2];
|
|
StringView fixitLocStr = parts[2];
|
|
@@ -2325,6 +2335,8 @@ namespace IDE.ui
|
|
else
|
|
else
|
|
fixitIdx = int32.Parse(fixitLocStr).GetValueOrDefault();
|
|
fixitIdx = int32.Parse(fixitLocStr).GetValueOrDefault();
|
|
|
|
|
|
|
|
+ int prevTextLength = sourceEditWidgetContent.mData.mTextLength;
|
|
|
|
+
|
|
int insertCount = 0;
|
|
int insertCount = 0;
|
|
int dataIdx = 3;
|
|
int dataIdx = 3;
|
|
|
|
|
|
@@ -2358,7 +2370,8 @@ namespace IDE.ui
|
|
}
|
|
}
|
|
|
|
|
|
sourceEditWidgetContent.CursorTextPos = fixitIdx;
|
|
sourceEditWidgetContent.CursorTextPos = fixitIdx;
|
|
- sourceEditWidgetContent.EnsureCursorVisible(true, true);
|
|
|
|
|
|
+ if (focusChange)
|
|
|
|
+ sourceEditWidgetContent.EnsureCursorVisible(true, true);
|
|
|
|
|
|
if (fixitLen > 0)
|
|
if (fixitLen > 0)
|
|
{
|
|
{
|
|
@@ -2377,6 +2390,14 @@ namespace IDE.ui
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!focusChange)
|
|
|
|
+ {
|
|
|
|
+ mTargetEditWidget.VertScrollTo(prevScrollPos, true);
|
|
|
|
+ sourceEditWidgetContent.CursorTextPos = prevCursorPosition;
|
|
|
|
+ int addedSize = sourceEditWidgetContent.mData.mTextLength - prevTextLength;
|
|
|
|
+ sourceEditWidgetContent.[Friend]AdjustCursorsAfterExternalEdit(fixitIdx, addedSize);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (historyEntry != null)
|
|
if (historyEntry != null)
|
|
{
|
|
{
|
|
// Make sure when we go back that we'll go back to the insert position
|
|
// Make sure when we go back that we'll go back to the insert position
|