File tree Expand file tree Collapse file tree 2 files changed +534
-384
lines changed Expand file tree Collapse file tree 2 files changed +534
-384
lines changed Original file line number Diff line number Diff line change 5
5
using System . Text ;
6
6
using System . Windows . Forms ;
7
7
using System . Windows . Input ;
8
+ using Microsoft . Win32 ;
8
9
using Rubberduck . Inspections ;
9
10
using Rubberduck . UI ;
10
11
using Rubberduck . UI . Command ;
@@ -205,6 +206,13 @@ public CodeInspectionSetting[] GetDefaultCodeInspections()
205
206
206
207
public IndenterSettings GetDefaultIndenterSettings ( )
207
208
{
209
+ var tabWidth = 4 ;
210
+ var reg = Registry . CurrentUser . OpenSubKey ( @"Software\Microsoft\VBA\6.0\Common" , false ) ??
211
+ Registry . CurrentUser . OpenSubKey ( @"Software\Microsoft\VBA\7.0\Common" , false ) ;
212
+ if ( reg != null )
213
+ {
214
+ tabWidth = Convert . ToInt32 ( reg . GetValue ( "TabWidth" ) ?? tabWidth ) ;
215
+ }
208
216
return new IndenterSettings
209
217
{
210
218
IndentEntireProcedureBody = true ,
@@ -222,7 +230,7 @@ public IndenterSettings GetDefaultIndenterSettings()
222
230
EnableUndo = true ,
223
231
EndOfLineCommentStyle = SmartIndenter . EndOfLineCommentStyle . AlignInColumn ,
224
232
EndOfLineCommentColumnSpaceAlignment = 50 ,
225
- IndentSpaces = 4
233
+ IndentSpaces = tabWidth
226
234
} ;
227
235
}
228
236
}
You can’t perform that action at this time.
0 commit comments