mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Made using/pragma fixits no long focus on change
This commit is contained in:
parent
97fd278e07
commit
709b337617
6 changed files with 31 additions and 10 deletions
|
@ -2287,17 +2287,22 @@ namespace IDE.ui
|
|||
return;
|
||||
}
|
||||
|
||||
var targetSourceEditWidgetContent = mTargetEditWidget.Content as SourceEditWidgetContent;
|
||||
var sourceEditWidgetContent = targetSourceEditWidgetContent;
|
||||
var prevCursorPosition = sourceEditWidgetContent.CursorTextPos;
|
||||
var prevScrollPos = mTargetEditWidget.mVertPos.mDest;
|
||||
|
||||
UndoBatchStart undoBatchStart = null;
|
||||
|
||||
var parts = String.StackSplit!(data, '|');
|
||||
String fixitKind = parts[0];
|
||||
String fixitFileName = parts[1];
|
||||
SourceViewPanel sourceViewPanel = IDEApp.sApp.ShowSourceFile(fixitFileName);
|
||||
bool focusChange = !fixitKind.StartsWith(".");
|
||||
|
||||
var targetSourceEditWidgetContent = mTargetEditWidget.Content as SourceEditWidgetContent;
|
||||
var historyEntry = targetSourceEditWidgetContent.RecordHistoryLocation();
|
||||
historyEntry.mNoMerge = true;
|
||||
|
||||
var sourceEditWidgetContent = targetSourceEditWidgetContent;
|
||||
if (sourceEditWidgetContent.mSourceViewPanel != sourceViewPanel)
|
||||
{
|
||||
sourceEditWidgetContent = (SourceEditWidgetContent)sourceViewPanel.GetActivePanel().EditWidget.mEditWidgetContent;
|
||||
|
@ -2305,6 +2310,11 @@ namespace IDE.ui
|
|||
sourceEditWidgetContent.mData.mUndoManager.Add(undoBatchStart);
|
||||
}
|
||||
|
||||
if (!focusChange)
|
||||
{
|
||||
sourceEditWidgetContent.CheckRecordScrollTop(true);
|
||||
}
|
||||
|
||||
int32 fixitIdx = 0;
|
||||
int32 fixitLen = 0;
|
||||
StringView fixitLocStr = parts[2];
|
||||
|
@ -2325,6 +2335,8 @@ namespace IDE.ui
|
|||
else
|
||||
fixitIdx = int32.Parse(fixitLocStr).GetValueOrDefault();
|
||||
|
||||
int prevTextLength = sourceEditWidgetContent.mData.mTextLength;
|
||||
|
||||
int insertCount = 0;
|
||||
int dataIdx = 3;
|
||||
|
||||
|
@ -2358,7 +2370,8 @@ namespace IDE.ui
|
|||
}
|
||||
|
||||
sourceEditWidgetContent.CursorTextPos = fixitIdx;
|
||||
sourceEditWidgetContent.EnsureCursorVisible(true, true);
|
||||
if (focusChange)
|
||||
sourceEditWidgetContent.EnsureCursorVisible(true, true);
|
||||
|
||||
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)
|
||||
{
|
||||
// Make sure when we go back that we'll go back to the insert position
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue