@@ -97,7 +97,9 @@ package body Codefix.Text_Manager.Ada_Commands is
97
97
Close_Cursor.Set_Line (Sloc_Start.Line);
98
98
Close_Cursor.Set_Column
99
99
(To_Column_Index
100
- (String_Index_Type (Sloc_Start.Column), Line));
100
+ (String_Index_Type (Sloc_Start.Column),
101
+ Line,
102
+ Current_Text.Tab_Width (Open_Cursor.File)));
101
103
102
104
return True;
103
105
end if ;
@@ -201,10 +203,11 @@ package body Codefix.Text_Manager.Ada_Commands is
201
203
loop
202
204
declare
203
205
Full_Line : constant String :=
204
- Get_Line (Current_Text, End_Cursor, 1 );
205
- J : String_Index_Type :=
206
- To_Char_Index
207
- (Get_Column (End_Cursor), Full_Line) - 1 ;
206
+ Get_Line (Current_Text, End_Cursor, 1 );
207
+ J : String_Index_Type := To_Char_Index
208
+ (Get_Column (End_Cursor),
209
+ Full_Line,
210
+ Current_Text.Tab_Width (End_Cursor.Get_File)) - 1 ;
208
211
209
212
begin
210
213
-- Skip previous blanks
@@ -222,7 +225,9 @@ package body Codefix.Text_Manager.Ada_Commands is
222
225
Set_Location
223
226
(End_Cursor,
224
227
Get_Line (End_Cursor),
225
- To_Column_Index (J, Full_Line) + 1 );
228
+ To_Column_Index
229
+ (J, Full_Line,
230
+ Current_Text.Tab_Width (End_Cursor.Get_File)) + 1 );
226
231
227
232
exit ;
228
233
@@ -244,7 +249,9 @@ package body Codefix.Text_Manager.Ada_Commands is
244
249
Set_Location
245
250
(End_Cursor,
246
251
Get_Line (End_Cursor),
247
- To_Column_Index (J, Full_Line));
252
+ To_Column_Index
253
+ (J, Full_Line,
254
+ Current_Text.Tab_Width (End_Cursor.Get_File)));
248
255
249
256
exit ;
250
257
end if ;
@@ -876,7 +883,9 @@ package body Codefix.Text_Manager.Ada_Commands is
876
883
Set_Location
877
884
(Position,
878
885
Get_Construct (Declaration).Sloc_End.Line,
879
- To_Column_Index (Char_Ind, Line));
886
+ To_Column_Index
887
+ (Char_Ind, Line,
888
+ Current_Text.Tab_Width (Cursor.Get_File)));
880
889
end ;
881
890
end Add_Pragma ;
882
891
@@ -909,7 +918,9 @@ package body Codefix.Text_Manager.Ada_Commands is
909
918
Set_Location
910
919
(Position,
911
920
Get_Construct (Clause).Sloc_End.Line,
912
- To_Column_Index (Char_Ind, Line));
921
+ To_Column_Index
922
+ (Char_Ind, Line,
923
+ Current_Text.Tab_Width (Cursor.Get_File)));
913
924
end ;
914
925
end Add_Clause_Pragma ;
915
926
@@ -943,7 +954,9 @@ package body Codefix.Text_Manager.Ada_Commands is
943
954
Set_Location
944
955
(Position,
945
956
Get_Construct (Declaration).Sloc_End.Line,
946
- To_Column_Index (Char_Ind, Line));
957
+ To_Column_Index
958
+ (Char_Ind, Line,
959
+ Current_Text.Tab_Width (Cursor.Get_File)));
947
960
end ;
948
961
end Add_Literal_Pragma ;
949
962
@@ -971,7 +984,9 @@ package body Codefix.Text_Manager.Ada_Commands is
971
984
(Position, Get_Construct (Declaration).Sloc_Entity.Line,
972
985
To_Column_Index
973
986
(String_Index_Type
974
- (Get_Construct (Declaration).Sloc_Entity.Column), Line));
987
+ (Get_Construct (Declaration).Sloc_Entity.Column),
988
+ Line,
989
+ Current_Text.Tab_Width (Cursor.Get_File)));
975
990
end ;
976
991
977
992
Garbage := Position;
@@ -1292,7 +1307,8 @@ package body Codefix.Text_Manager.Ada_Commands is
1292
1307
Begin_Cursor.Line := Sloc_Start.Line;
1293
1308
Begin_Cursor.Col := To_Column_Index
1294
1309
(String_Index_Type (Sloc_Start.Column),
1295
- Get_Line (Current_Text, Begin_Cursor, 1 ));
1310
+ Get_Line (Current_Text, Begin_Cursor, 1 ),
1311
+ Current_Text.Tab_Width (Begin_Cursor.Get_File));
1296
1312
end if ;
1297
1313
end Begin_Of_Profile ;
1298
1314
@@ -1306,7 +1322,8 @@ package body Codefix.Text_Manager.Ada_Commands is
1306
1322
End_Cursor.Line := Last_Entity_Line;
1307
1323
End_Cursor.Col := To_Column_Index
1308
1324
(String_Index_Type (Last_Entity_Column),
1309
- Get_Line (Current_Text, End_Cursor, 1 ));
1325
+ Get_Line (Current_Text, End_Cursor, 1 ),
1326
+ Current_Text.Tab_Width (End_Cursor.Get_File));
1310
1327
1311
1328
if Begin_Cursor = Null_File_Cursor then
1312
1329
End_Cursor.Col := End_Cursor.Col + 1 ;
@@ -1389,7 +1406,8 @@ package body Codefix.Text_Manager.Ada_Commands is
1389
1406
To_Column_Index
1390
1407
(String_Index_Type
1391
1408
(Get_Construct (Position_It).Sloc_Start.Column),
1392
- Get_Line (Current_Text, Begin_Analyze_Cursor, 1 )));
1409
+ Get_Line (Current_Text, Begin_Analyze_Cursor, 1 ),
1410
+ Current_Text.Tab_Width (Begin_Analyze_Cursor.Get_File)));
1393
1411
1394
1412
Last_Entity_Column := Integer (Begin_Analyze_Cursor.Col);
1395
1413
Last_Entity_Line := Begin_Analyze_Cursor.Line;
@@ -1720,7 +1738,10 @@ package body Codefix.Text_Manager.Ada_Commands is
1720
1738
(Get_File (Line_Cursor)).Indent_Line (Line_Cursor);
1721
1739
else
1722
1740
Char_Ind := To_Char_Index
1723
- (This.Force_Column, Get_Line (Current_Text, Line_Cursor, 1 ));
1741
+ (This.Force_Column,
1742
+ Get_Line (Current_Text, Line_Cursor, 1 ),
1743
+ Current_Text.Tab_Width (Line_Cursor.Get_File));
1744
+
1724
1745
Indent_Size := Natural (Char_Ind) - 1 ;
1725
1746
1726
1747
declare
@@ -1929,7 +1950,9 @@ package body Codefix.Text_Manager.Ada_Commands is
1929
1950
(This => Cursor,
1930
1951
Line => Sloc_End.Line,
1931
1952
Column => To_Column_Index
1932
- (String_Index_Type (Sloc_End.Column), Line));
1953
+ (String_Index_Type (Sloc_End.Column),
1954
+ Line,
1955
+ Current_Text.Tab_Width (Cursor.Get_File)));
1933
1956
end if ;
1934
1957
1935
1958
return Stop_Scanning;
@@ -2207,7 +2230,9 @@ package body Codefix.Text_Manager.Ada_Commands is
2207
2230
2208
2231
End_Line := Sloc_End.Line;
2209
2232
End_Column := To_Column_Index
2210
- (String_Index_Type (Sloc_End.Column), Line);
2233
+ (String_Index_Type (Sloc_End.Column),
2234
+ Line,
2235
+ Current_Text.Tab_Width (Cursor.Get_File));
2211
2236
2212
2237
return False;
2213
2238
end Scan_Forward_Callback ;
@@ -2288,8 +2313,8 @@ package body Codefix.Text_Manager.Ada_Commands is
2288
2313
Current_Text.Get_Current_Cursor (This.Cursor.all );
2289
2314
Line : constant String := Get_Line (Current_Text, Cursor, 1 );
2290
2315
New_Id : String (1 .. Line'Length);
2291
- Index : String_Index_Type :=
2292
- To_Char_Index (Get_Column (Cursor), Line);
2316
+ Index : String_Index_Type := To_Char_Index
2317
+ (Get_Column (Cursor), Line, Current_Text.Tab_Width (Cursor.Get_File) );
2293
2318
New_Id_Index : Integer := 1 ;
2294
2319
Start_Index : String_Index_Type;
2295
2320
begin
@@ -2325,7 +2350,8 @@ package body Codefix.Text_Manager.Ada_Commands is
2325
2350
end if ;
2326
2351
end loop ;
2327
2352
2328
- Cursor.Col := To_Column_Index (Start_Index, Line);
2353
+ Cursor.Col := To_Column_Index
2354
+ (Start_Index, Line, Current_Text.Tab_Width (Cursor.Get_File));
2329
2355
2330
2356
Current_Text.Replace
2331
2357
(Cursor,
@@ -2384,7 +2410,8 @@ package body Codefix.Text_Manager.Ada_Commands is
2384
2410
Pragma_Cursor.Set_Column
2385
2411
(To_Column_Index
2386
2412
(String_Index_Type (Get_Construct (It).Sloc_Start.Column),
2387
- Current_Text.Get_Line (Pragma_Cursor, 0 )));
2413
+ Current_Text.Get_Line (Pragma_Cursor, 0 ),
2414
+ Current_Text.Tab_Width (Pragma_Cursor.Get_File)));
2388
2415
2389
2416
declare
2390
2417
List : Ada_Statement;
@@ -2581,7 +2608,8 @@ package body Codefix.Text_Manager.Ada_Commands is
2581
2608
End_Line : constant String :=
2582
2609
Current_Text.Get_Line (Src_End_Cursor, 0 );
2583
2610
begin
2584
- Src_End_Cursor.Col := To_Column_Index (End_Line'Length, End_Line);
2611
+ Src_End_Cursor.Col := To_Column_Index
2612
+ (End_Line'Length, End_Line, Current_Text.Tab_Width (Cursor.File));
2585
2613
end ;
2586
2614
2587
2615
if Prev_Entity = Null_Construct_Tree_Iterator then
@@ -2596,7 +2624,10 @@ package body Codefix.Text_Manager.Ada_Commands is
2596
2624
End_Line : constant String :=
2597
2625
Current_Text.Get_Line (Dst_Cursor, 0 );
2598
2626
begin
2599
- Dst_Cursor.Col := To_Column_Index (End_Line'Length, End_Line) + 1 ;
2627
+ Dst_Cursor.Col := To_Column_Index
2628
+ (End_Line'Length,
2629
+ End_Line,
2630
+ Current_Text.Tab_Width (Dst_Cursor.Get_File)) + 1 ;
2600
2631
end ;
2601
2632
else
2602
2633
-- If there is a subprogram before, place it after the end of that
@@ -2608,7 +2639,10 @@ package body Codefix.Text_Manager.Ada_Commands is
2608
2639
End_Line : constant String :=
2609
2640
Current_Text.Get_Line (Dst_Cursor, 0 );
2610
2641
begin
2611
- Dst_Cursor.Col := To_Column_Index (End_Line'Length, End_Line) + 1 ;
2642
+ Dst_Cursor.Col := To_Column_Index
2643
+ (End_Line'Length,
2644
+ End_Line,
2645
+ Current_Text.Tab_Width (Dst_Cursor.Get_File)) + 1 ;
2612
2646
end ;
2613
2647
end if ;
2614
2648
@@ -2863,7 +2897,9 @@ package body Codefix.Text_Manager.Ada_Commands is
2863
2897
Name_Cursor.Set_Location
2864
2898
(Sloc_Start.Line,
2865
2899
To_Column_Index
2866
- (String_Index_Type (Sloc_Start.Column), Line));
2900
+ (String_Index_Type (Sloc_Start.Column),
2901
+ Line,
2902
+ Current_Text.Tab_Width (Name_Cursor.Get_File)));
2867
2903
2868
2904
Name_Length := Sloc_End.Column - Sloc_Start.Column + 1 ;
2869
2905
0 commit comments