fix scrolling when undoing code fix
This commit is contained in:
@@ -89,12 +89,14 @@ public partial class SharpIdeCodeEdit : CodeEdit
|
|||||||
var diagnostics = await RoslynAnalysis.GetDocumentDiagnostics(_currentFile);
|
var diagnostics = await RoslynAnalysis.GetDocumentDiagnostics(_currentFile);
|
||||||
Callable.From(() =>
|
Callable.From(() =>
|
||||||
{
|
{
|
||||||
|
BeginComplexOperation();
|
||||||
SetText(fileContents);
|
SetText(fileContents);
|
||||||
SetSyntaxHighlightingModel(syntaxHighlighting);
|
SetSyntaxHighlightingModel(syntaxHighlighting);
|
||||||
SetDiagnosticsModel(diagnostics);
|
SetDiagnosticsModel(diagnostics);
|
||||||
SetCaretLine(currentCaretPosition.line);
|
SetCaretLine(currentCaretPosition.line);
|
||||||
SetCaretColumn(currentCaretPosition.col);
|
SetCaretColumn(currentCaretPosition.col);
|
||||||
SetVScroll(vScroll);
|
SetVScroll(vScroll);
|
||||||
|
EndComplexOperation();
|
||||||
}).CallDeferred();
|
}).CallDeferred();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -220,6 +222,8 @@ public partial class SharpIdeCodeEdit : CodeEdit
|
|||||||
_popupMenu.AddItem(codeAction.Title, index);
|
_popupMenu.AddItem(codeAction.Title, index);
|
||||||
//_popupMenu.SetItemMetadata(menuItem, codeAction);
|
//_popupMenu.SetItemMetadata(menuItem, codeAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (codeActions.Length is not 0) _popupMenu.SetFocusedItem(0);
|
||||||
GD.Print($"Code fixes found: {codeActions.Length}, displaying menu");
|
GD.Print($"Code fixes found: {codeActions.Length}, displaying menu");
|
||||||
}).CallDeferred();
|
}).CallDeferred();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user