diff --git a/src/AddIns/Misc/SharpRefactoring/Project/Src/Gui/InsertCtorDialog.xaml.cs b/src/AddIns/Misc/SharpRefactoring/Project/Src/Gui/InsertCtorDialog.xaml.cs index af0b2c9dba..5f1265c153 100644 --- a/src/AddIns/Misc/SharpRefactoring/Project/Src/Gui/InsertCtorDialog.xaml.cs +++ b/src/AddIns/Misc/SharpRefactoring/Project/Src/Gui/InsertCtorDialog.xaml.cs @@ -61,9 +61,9 @@ namespace SharpRefactoring.Gui protected override string GenerateCode(LanguageProperties language, IClass currentClass) { - var line = editor.Document.GetLineForOffset(editor.Caret.Offset); + var line = editor.Document.GetLineForOffset(anchor.Offset); - string indent = DocumentUtilitites.GetWhitespaceAfter(editor.Document, line.Offset) + "\t"; + string indent = DocumentUtilitites.GetWhitespaceAfter(editor.Document, line.Offset); var filtered = paramList.Where(p => p.IsSelected).OrderBy(p => p.Index).ToList();