1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0810
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.0810
Problem: Too many #ifdefs.
Solution: Graduate FEAT_MBYTE, part 4.
Files: src/getchar.c, src/search.c, src/sign.c, src/spell.c,
src/spellfile.c, src/syntax.c, src/tag.c, src/term.c, src/ui.c,
src/version.c, src/winclip.c, src/window.c, src/glbl_ime.cpp,
src/ex_cmds.h, src/globals.h, src/gui.h, src/if_py_both.h,
src/macros.h, src/option.h, src/os_mac.h, src/os_win32.h,
src/proto.h, src/spell.h, src/structs.h, src/vim.h
*** ../vim-8.1.0809/src/getchar.c 2019-01-20 15:30:36.885328746 +0100
--- src/getchar.c 2019-01-24 16:51:24.391561224 +0100
***************
*** 291,304 ****
static void
add_char_buff(buffheader_T *buf, int c)
{
- #ifdef FEAT_MBYTE
char_u bytes[MB_MAXBYTES + 1];
int len;
int i;
- #endif
char_u temp[4];
- #ifdef FEAT_MBYTE
if (IS_SPECIAL(c))
len = 1;
else
--- 291,301 ----
***************
*** 307,313 ****
{
if (!IS_SPECIAL(c))
c = bytes[i];
- #endif
if (IS_SPECIAL(c) || c == K_SPECIAL || c == NUL)
{
--- 304,309 ----
***************
*** 333,341 ****
temp[1] = NUL;
}
add_buff(buf, temp, -1L);
- #ifdef FEAT_MBYTE
}
- #endif
}
/* First read ahead buffer. Used for translated commands. */
--- 329,335 ----
***************
*** 596,607 ****
break;
/* Handle a special or multibyte character. */
- #ifdef FEAT_MBYTE
if (has_mbyte)
/* Handle composing chars separately. */
c = mb_cptr2char_adv(&s);
else
- #endif
c = *s++;
if (c < ' ' || c == DEL || (*s == NUL && (c == '0' || c == '^')))
add_char_buff(&redobuff, Ctrl_V);
--- 590,599 ----
***************
*** 686,696 ****
}
else
{
- #ifdef FEAT_MBYTE
c = mb_ptr2char_adv(&s);
- #else
- c = *s++;
- #endif
if (c == CAR || c == NL || c == ESC)
c = ' ';
stuffcharReadbuff(c);
--- 678,684 ----
***************
*** 732,742 ****
static buffblock_T *bp;
static char_u *p;
int c;
- #ifdef FEAT_MBYTE
int n;
char_u buf[MB_MAXBYTES + 1];
int i;
- #endif
if (init)
{
--- 720,728 ----
***************
*** 752,758 ****
if ((c = *p) != NUL)
{
/* Reverse the conversion done by add_char_buff() */
- #ifdef FEAT_MBYTE
/* For a multi-byte character get all the bytes and return the
* converted character. */
if (has_mbyte && (c != K_SPECIAL || p[1] == KS_SPECIAL))
--- 738,743 ----
***************
*** 760,766 ****
else
n = 1;
for (i = 0; ; ++i)
- #endif
{
if (c == K_SPECIAL) /* special key or escaped K_SPECIAL */
{
--- 745,750 ----
***************
*** 776,782 ****
bp = bp->b_next;
p = bp->b_str;
}
- #ifdef FEAT_MBYTE
buf[i] = c;
if (i == n - 1) /* last byte of a character */
{
--- 760,765 ----
***************
*** 787,793 ****
c = *p;
if (c == NUL) /* cannot happen? */
break;
- #endif
}
}
--- 770,775 ----
***************
*** 1093,1103 ****
void
ins_char_typebuf(int c)
{
- #ifdef FEAT_MBYTE
char_u buf[MB_MAXBYTES + 1];
- #else
- char_u buf[4];
- #endif
if (IS_SPECIAL(c))
{
buf[0] = K_SPECIAL;
--- 1075,1081 ----
***************
*** 1106,1119 ****
buf[3] = NUL;
}
else
- {
- #ifdef FEAT_MBYTE
buf[(*mb_char2bytes)(c, buf)] = NUL;
- #else
- buf[0] = c;
- buf[1] = NUL;
- #endif
- }
(void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent);
}
--- 1084,1090 ----
***************
*** 1579,1589 ****
vgetc(void)
{
int c, c2;
- #ifdef FEAT_MBYTE
int n;
char_u buf[MB_MAXBYTES + 1];
int i;
- #endif
#ifdef FEAT_EVAL
/* Do garbage collection when garbagecollect() was called previously and
--- 1550,1558 ----
***************
*** 1763,1769 ****
case K_XRIGHT: c = K_RIGHT; break;
}
- #ifdef FEAT_MBYTE
/* For a multi-byte character get all the bytes and return the
* converted character.
* Note: This will loop until enough bytes are received!
--- 1732,1737 ----
***************
*** 1794,1800 ****
--no_mapping;
c = (*mb_ptr2char)(buf);
}
- #endif
break;
}
--- 1762,1767 ----
***************
*** 2212,2218 ****
break;
}
- #ifdef FEAT_MBYTE
/* Don't allow mapping the first byte(s) of a
* multi-byte char. Happens when mapping
* <M-a> and then changing 'encoding'. Beware
--- 2183,2188 ----
***************
*** 2225,2231 ****
&& MB_BYTE2LEN(c1) > MB_PTR2LEN(p2))
mlen = 0;
}
- #endif
/*
* Check an entry whether it matches.
* - Full match: mlen == keylen
--- 2195,2200 ----
***************
*** 2685,2722 ****
curwin->w_wcol = vcol;
vcol += lbr_chartabsize(ptr, ptr + col,
(colnr_T)vcol);
- #ifdef FEAT_MBYTE
if (has_mbyte)
col += (*mb_ptr2len)(ptr + col);
else
- #endif
++col;
}
curwin->w_wrow = curwin->w_cline_row
+ curwin->w_wcol / curwin->w_width;
curwin->w_wcol %= curwin->w_width;
curwin->w_wcol += curwin_col_off();
- #ifdef FEAT_MBYTE
col = 0; /* no correction needed */
- #endif
}
else
{
--curwin->w_wcol;
- #ifdef FEAT_MBYTE
col = curwin->w_cursor.col - 1;
- #endif
}
}
else if (curwin->w_p_wrap && curwin->w_wrow)
{
--curwin->w_wrow;
curwin->w_wcol = curwin->w_width - 1;
- #ifdef FEAT_MBYTE
col = curwin->w_cursor.col - 1;
- #endif
}
- #ifdef FEAT_MBYTE
if (has_mbyte && col > 0 && curwin->w_wcol > 0)
{
/* Correct when the cursor is on the right halve
--- 2654,2682 ----
***************
*** 2726,2732 ****
if ((*mb_ptr2cells)(ptr + col) > 1)
--curwin->w_wcol;
}
- #endif
}
setcursor();
out_flush();
--- 2686,2691 ----
***************
*** 3434,3440 ****
* Otherwise we won't be able to find the start of it in a
* vi-compatible way.
*/
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
int first, last;
--- 3394,3399 ----
***************
*** 3458,3466 ****
goto theend;
}
}
! else
! #endif
! if (vim_iswordc(keys[len - 1])) /* ends in keyword char */
for (n = 0; n < len - 2; ++n)
if (vim_iswordc(keys[n]) != vim_iswordc(keys[len - 2]))
{
--- 3417,3423 ----
goto theend;
}
}
! else if (vim_iswordc(keys[len - 1])) // ends in keyword char
for (n = 0; n < len - 2; ++n)
if (vim_iswordc(keys[n]) != vim_iswordc(keys[len - 2]))
{
***************
*** 4458,4466 ****
#ifdef FEAT_LOCALMAP
mapblock_T *mp2;
#endif
- #ifdef FEAT_MBYTE
int clen = 0; /* length in characters */
- #endif
int is_id = TRUE;
int vim_abbr;
--- 4415,4421 ----
***************
*** 4480,4486 ****
if (col == 0) /* cannot be an abbr. */
return FALSE;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
char_u *p;
--- 4435,4440 ----
***************
*** 4508,4514 ****
scol = (int)(p - ptr);
}
else
- #endif
{
if (!vim_iswordc(ptr[col - 1]))
vim_abbr = TRUE; /* Vim added abbr. */
--- 4462,4467 ----
***************
*** 4601,4607 ****
{
if (c < ABBR_OFF && (c < ' ' || c > '~'))
tb[j++] = Ctrl_V; /* special char needs CTRL-V */
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
/* if ABBR_OFF has been added, remove it here */
--- 4554,4559 ----
***************
*** 4610,4616 ****
j += (*mb_char2bytes)(c, tb + j);
}
else
- #endif
tb[j++] = c;
}
tb[j] = NUL;
--- 4562,4567 ----
***************
*** 4637,4646 ****
tb[0] = Ctrl_H;
tb[1] = NUL;
- #ifdef FEAT_MBYTE
if (has_mbyte)
len = clen; /* Delete characters instead of bytes */
- #endif
while (len-- > 0) /* delete the from string */
(void)ins_typebuf(tb, 1, 0, TRUE, mp->m_silent);
return TRUE;
--- 4588,4595 ----
***************
*** 4715,4727 ****
/* Need a buffer to hold up to three times as much. Four in case of an
* illegal utf-8 byte:
* 0xc0 -> 0xc3 0x80 -> 0xc3 K_SPECIAL KS_SPECIAL KE_FILLER */
! res = alloc((unsigned)(STRLEN(p) *
! #ifdef FEAT_MBYTE
! 4
! #else
! 3
! #endif
! ) + 1);
if (res != NULL)
{
d = res;
--- 4664,4670 ----
/* Need a buffer to hold up to three times as much. Four in case of an
* illegal utf-8 byte:
* 0xc0 -> 0xc3 0x80 -> 0xc3 K_SPECIAL KS_SPECIAL KE_FILLER */
! res = alloc((unsigned)(STRLEN(p) * 4) + 1);
if (res != NULL)
{
d = res;
***************
*** 5012,5018 ****
for ( ; *str != NUL; ++str)
{
- #ifdef FEAT_MBYTE
char_u *p;
/* Check for a multi-byte character, which may contain escaped
--- 4955,4960 ----
***************
*** 5026,5032 ****
--str;
continue;
}
- #endif
c = *str;
/*
--- 4968,4973 ----
*** ../vim-8.1.0809/src/search.c 2019-01-20 15:30:36.893328693 +0100
--- src/search.c 2019-01-24 16:41:51.655543691 +0100
***************
*** 85,94 ****
static char_u lastc[2] = {NUL, NUL}; /* last character searched for */
static int lastcdir = FORWARD; /* last direction of character search */
static int last_t_cmd = TRUE; /* last search t_cmd */
- #ifdef FEAT_MBYTE
static char_u lastc_bytes[MB_MAXBYTES + 1];
static int lastc_bytelen = 1; /* >1 for multi-byte char */
- #endif
/* copy of spats[], for keeping the search patterns while executing autocmds */
static struct spat saved_spats[2];
--- 85,92 ----
***************
*** 248,254 ****
rev_i = len;
for (s_i = 0; s_i < len; ++s_i)
{
- # ifdef FEAT_MBYTE
if (has_mbyte)
{
int mb_len;
--- 246,251 ----
***************
*** 259,265 ****
s_i += mb_len - 1;
}
else
- # endif
rev[--rev_i] = s[s_i];
}
--- 256,261 ----
***************
*** 446,452 ****
while (*p != NUL)
{
- #ifdef FEAT_MBYTE
int l;
if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1)
--- 442,447 ----
***************
*** 455,463 ****
return TRUE;
p += l;
}
! else
! #endif
! if (*p == '\\')
{
if (p[1] == '_' && p[2] != NUL) /* skip "\_X" */
p += 3;
--- 450,456 ----
return TRUE;
p += l;
}
! else if (*p == '\\')
{
if (p[1] == '_' && p[2] != NUL) /* skip "\_X" */
p += 3;
***************
*** 480,490 ****
char_u *
last_csearch(void)
{
- #ifdef FEAT_MBYTE
return lastc_bytes;
- #else
- return lastc;
- #endif
}
int
--- 473,479 ----
***************
*** 503,515 ****
set_last_csearch(int c, char_u *s UNUSED, int len UNUSED)
{
*lastc = c;
- #ifdef FEAT_MBYTE
lastc_bytelen = len;
if (len)
memcpy(lastc_bytes, s, len);
else
vim_memset(lastc_bytes, 0, sizeof(lastc_bytes));
- #endif
}
#endif
--- 492,502 ----
***************
*** 687,693 ****
* MAXCOL + 1 is zero. */
if (pos->col == MAXCOL)
start_char_len = 0;
- #ifdef FEAT_MBYTE
/* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
else if (has_mbyte
&& pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
--- 674,679 ----
***************
*** 699,705 ****
else
start_char_len = (*mb_ptr2len)(ptr + pos->col);
}
- #endif
else
start_char_len = 1;
if (dir == FORWARD)
--- 685,690 ----
***************
*** 835,846 ****
if (matchcol == matchpos.col
&& ptr[matchcol] != NUL)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
matchcol +=
(*mb_ptr2len)(ptr + matchcol);
else
- #endif
++matchcol;
}
}
--- 820,829 ----
***************
*** 849,860 ****
matchcol = matchpos.col;
if (ptr[matchcol] != NUL)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
matchcol += (*mb_ptr2len)(ptr
+ matchcol);
else
- #endif
++matchcol;
}
}
--- 832,841 ----
***************
*** 946,957 ****
if (matchcol == matchpos.col
&& ptr[matchcol] != NUL)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
matchcol +=
(*mb_ptr2len)(ptr + matchcol);
else
- #endif
++matchcol;
}
}
--- 927,936 ----
***************
*** 963,974 ****
matchcol = matchpos.col;
if (ptr[matchcol] != NUL)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
matchcol +=
(*mb_ptr2len)(ptr + matchcol);
else
- #endif
++matchcol;
}
}
--- 942,951 ----
***************
*** 1029,1042 ****
else
{
--pos->col;
- #ifdef FEAT_MBYTE
if (has_mbyte
&& pos->lnum <= buf->b_ml.ml_line_count)
{
ptr = ml_get_buf(buf, pos->lnum, FALSE);
pos->col -= (*mb_head_off)(ptr, ptr + pos->col);
}
- #endif
}
if (end_pos != NULL)
{
--- 1006,1017 ----
***************
*** 1410,1416 ****
if (msgbuf != NULL)
{
msgbuf[0] = dirc;
- #ifdef FEAT_MBYTE
if (enc_utf8 && utf_iscomposing(utf_ptr2char(p)))
{
/* Use a space to draw the composing char on. */
--- 1385,1390 ----
***************
*** 1418,1424 ****
STRCPY(msgbuf + 2, p);
}
else
- #endif
STRCPY(msgbuf + 1, p);
if (spats[0].off.line || spats[0].off.end || spats[0].off.off)
{
--- 1392,1397 ----
***************
*** 1711,1717 ****
*lastc = c;
set_csearch_direction(dir);
set_csearch_until(t_cmd);
- #ifdef FEAT_MBYTE
lastc_bytelen = (*mb_char2bytes)(c, lastc_bytes);
if (cap->ncharC1 != 0)
{
--- 1684,1689 ----
***************
*** 1721,1736 ****
lastc_bytelen += (*mb_char2bytes)(cap->ncharC2,
lastc_bytes + lastc_bytelen);
}
- #endif
}
}
else /* repeat previous search */
{
! if (*lastc == NUL
! #ifdef FEAT_MBYTE
! && lastc_bytelen == 1
! #endif
! )
return FAIL;
if (dir) /* repeat in opposite direction */
dir = -lastcdir;
--- 1693,1703 ----
lastc_bytelen += (*mb_char2bytes)(cap->ncharC2,
lastc_bytes + lastc_bytelen);
}
}
}
else /* repeat previous search */
{
! if (*lastc == NUL && lastc_bytelen == 1)
return FAIL;
if (dir) /* repeat in opposite direction */
dir = -lastcdir;
***************
*** 1758,1764 ****
while (count--)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
for (;;)
--- 1725,1730 ----
***************
*** 1787,1793 ****
}
}
else
- #endif
{
for (;;)
{
--- 1753,1758 ----
***************
*** 1804,1810 ****
{
/* backup to before the character (possibly double-byte) */
col -= dir;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
if (dir < 0)
--- 1769,1774 ----
***************
*** 1814,1820 ****
/* To previous char, which may be multi-byte. */
col -= (*mb_head_off)(p, p + col);
}
- #endif
}
curwin->w_cursor.col = col;
--- 1778,1783 ----
***************
*** 1851,1860 ****
int *prevcol)
{
--col;
- #ifdef FEAT_MBYTE
if (col > 0 && has_mbyte)
col -= (*mb_head_off)(linep, linep + col);
- #endif
if (prevcol)
*prevcol = col;
return (col >= 0 && linep[col] == ch) ? TRUE : FALSE;
--- 1814,1821 ----
***************
*** 2237,2246 ****
else
{
--pos.col;
- #ifdef FEAT_MBYTE
if (has_mbyte)
pos.col -= (*mb_head_off)(linep, linep + pos.col);
- #endif
}
}
else /* forward search */
--- 2198,2205 ----
***************
*** 2278,2288 ****
}
else
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
pos.col += (*mb_ptr2len)(linep + pos.col);
else
- #endif
++pos.col;
}
}
--- 2237,2245 ----
***************
*** 2934,2943 ****
if ((curwin->w_cursor.col = (colnr_T)STRLEN(line)) != 0)
{
--curwin->w_cursor.col;
- #ifdef FEAT_MBYTE
curwin->w_cursor.col -=
(*mb_head_off)(line, line + curwin->w_cursor.col);
- #endif
*pincl = TRUE;
}
}
--- 2891,2898 ----
***************
*** 3029,3035 ****
#endif
if (c == ' ' || c == '\t' || c == NUL)
return 0;
- #ifdef FEAT_MBYTE
if (enc_dbcs != 0 && c > 0xFF)
{
/* If cls_bigword, report multi-byte chars as class 1. */
--- 2984,2989 ----
***************
*** 3046,3052 ****
return 1;
return c;
}
- #endif
/* If cls_bigword is TRUE, report all non-blanks as class 1. */
if (cls_bigword)
--- 3000,3005 ----
***************
*** 3903,3909 ****
int lc = NUL;
pos_T pos;
- #ifdef FEAT_MBYTE
if (enc_dbcs)
{
char_u *lp = NULL;
--- 3856,3861 ----
***************
*** 3924,3930 ****
}
}
else
- #endif
{
for (p = line + curwin->w_cursor.col; p > line; )
{
--- 3876,3881 ----
***************
*** 4371,4381 ****
++col;
else if (c == quotechar)
break;
- #ifdef FEAT_MBYTE
if (has_mbyte)
col += (*mb_ptr2len)(line + col);
else
- #endif
++col;
}
return col;
--- 4322,4330 ----
***************
*** 4399,4407 ****
while (col_start > 0)
{
--col_start;
- #ifdef FEAT_MBYTE
col_start -= (*mb_head_off)(line, line + col_start);
- #endif
n = 0;
if (escape != NULL)
while (col_start - n > 0 && vim_strchr(escape,
--- 4348,4354 ----
*** ../vim-8.1.0809/src/sign.c 2019-01-19 17:43:03.425449092 +0100
--- src/sign.c 2019-01-24 16:42:16.007379451 +0100
***************
*** 820,826 ****
}
// Count cells and check for non-printable chars
- # ifdef FEAT_MBYTE
if (has_mbyte)
{
cells = 0;
--- 820,825 ----
***************
*** 832,838 ****
}
}
else
- # endif
{
for (s = text; s < endp; ++s)
if (!vim_isprintc(*s))
--- 831,836 ----
*** ../vim-8.1.0809/src/spell.c 2019-01-19 17:43:03.429449066 +0100
--- src/spell.c 2019-01-24 16:46:46.505554025 +0100
***************
*** 224,235 ****
affixID/condition */
int mi_prefcnt; /* number of entries at mi_prefarridx */
int mi_prefixlen; /* byte length of prefix */
- #ifdef FEAT_MBYTE
int mi_cprefixlen; /* byte length of prefix in original
case */
- #else
- # define mi_cprefixlen mi_prefixlen /* it's the same value */
- #endif
/* for when checking a compound word */
int mi_compoff; /* start of following word offset */
--- 224,231 ----
***************
*** 249,257 ****
static int spell_iswordp(char_u *p, win_T *wp);
- #ifdef FEAT_MBYTE
static int spell_mb_isword_class(int cl, win_T *wp);
- #endif
/*
* For finding suggestions: At each node in the tree these states are tried:
--- 245,251 ----
***************
*** 295,306 ****
char_u ts_prefixdepth; /* stack depth for end of prefix or
* PFD_PREFIXTREE or PFD_NOPREFIX */
char_u ts_flags; /* TSF_ flags */
- #ifdef FEAT_MBYTE
char_u ts_tcharlen; /* number of bytes in tword character */
char_u ts_tcharidx; /* current byte index in tword character */
char_u ts_isdiff; /* DIFF_ values */
char_u ts_fcharstart; /* index in fword where badword char started */
- #endif
char_u ts_prewordlen; /* length of word in "preword[]" */
char_u ts_splitoff; /* index in "tword" after last split */
char_u ts_splitfidx; /* "ts_fidx" at word split */
--- 289,298 ----
***************
*** 358,366 ****
static void suggest_try_change(suginfo_T *su);
static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, int soundfold);
static void go_deeper(trystate_T *stack, int depth, int score_add);
- #ifdef FEAT_MBYTE
static int nofold_len(char_u *fword, int flen, char_u *word);
- #endif
static void find_keepcap_word(slang_T *slang, char_u *fword, char_u *kword);
static void score_comp_sal(suginfo_T *su);
static void score_combine(suginfo_T *su);
--- 350,356 ----
***************
*** 380,394 ****
static int cleanup_suggestions(garray_T *gap, int maxscore, int keep);
static void spell_soundfold_sofo(slang_T *slang, char_u *inword, char_u *res);
static void spell_soundfold_sal(slang_T *slang, char_u *inword, char_u *res);
- #ifdef FEAT_MBYTE
static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res);
- #endif
static int soundalike_score(char_u *goodsound, char_u *badsound);
static int spell_edit_score(slang_T *slang, char_u *badword, char_u *goodword);
static int spell_edit_score_limit(slang_T *slang, char_u *badword, char_u *goodword, int limit);
- #ifdef FEAT_MBYTE
static int spell_edit_score_limit_w(slang_T *slang, char_u *badword, char_u *goodword, int limit);
- #endif
static void dump_word(slang_T *slang, char_u *word, char_u *pat, int *dir, int round, int flags, linenr_T lnum);
static linenr_T dump_prefixes(slang_T *slang, char_u *word, char_u *pat, int *dir, int round, int flags, linenr_T startlnum);
--- 370,380 ----
***************
*** 565,574 ****
*capcol = (int)(regmatch.endp[0] - ptr);
}
- #ifdef FEAT_MBYTE
if (has_mbyte)
return (*mb_ptr2len)(ptr);
- #endif
return 1;
}
else if (mi.mi_end == ptr)
--- 551,558 ----
***************
*** 646,654 ****
int c;
char_u *ptr;
idx_T lo, hi, m;
- #ifdef FEAT_MBYTE
char_u *s;
- #endif
char_u *p;
int res = SP_BAD;
slang_T *slang = mip->mi_lp->lp_slang;
--- 630,636 ----
***************
*** 794,803 ****
arridx = endidx[endidxcnt];
wlen = endlen[endidxcnt];
- #ifdef FEAT_MBYTE
if ((*mb_head_off)(ptr, ptr + wlen) > 0)
continue; /* not at first byte of character */
- #endif
if (spell_iswordp(ptr + wlen, mip->mi_win))
{
if (slang->sl_compprog == NULL && !slang->sl_nobreak)
--- 776,783 ----
***************
*** 810,816 ****
* has been found we try compound flags. */
prefix_found = FALSE;
- #ifdef FEAT_MBYTE
if (mode != FIND_KEEPWORD && has_mbyte)
{
/* Compute byte length in original word, length may change
--- 790,795 ----
***************
*** 824,830 ****
wlen = (int)(p - mip->mi_word);
}
}
- #endif
/* Check flags and region. For FIND_PREFIX check the condition and
* prefix ID.
--- 803,808 ----
***************
*** 896,902 ****
if (((unsigned)flags >> 24) == 0
|| wlen - mip->mi_compoff < slang->sl_compminlen)
continue;
- #ifdef FEAT_MBYTE
/* For multi-byte chars check character length against
* COMPOUNDMIN. */
if (has_mbyte
--- 874,879 ----
***************
*** 904,910 ****
&& mb_charlen_len(mip->mi_word + mip->mi_compoff,
wlen - mip->mi_compoff) < slang->sl_compminlen)
continue;
- #endif
/* Limit the number of compound words to COMPOUNDWORDMAX if no
* maximum for syllables is specified. */
--- 881,886 ----
***************
*** 938,944 ****
/* Need to check the caps type of the appended compound
* word. */
- #ifdef FEAT_MBYTE
if (has_mbyte && STRNCMP(ptr, mip->mi_word,
mip->mi_compoff) != 0)
{
--- 914,919 ----
***************
*** 948,954 ****
MB_PTR_ADV(p);
}
else
- #endif
p = mip->mi_word + mip->mi_compoff;
capflags = captype(p, mip->mi_word + wlen);
if (capflags == WF_KEEPCAP || (capflags == WF_ALLCAP
--- 923,928 ----
***************
*** 1020,1026 ****
/* Find following word in case-folded tree. */
mip->mi_compoff = endlen[endidxcnt];
- #ifdef FEAT_MBYTE
if (has_mbyte && mode == FIND_KEEPWORD)
{
/* Compute byte length in case-folded word from "wlen":
--- 994,999 ----
***************
*** 1035,1041 ****
mip->mi_compoff = (int)(p - mip->mi_fword);
}
}
- #endif
#if 0 /* Disabled, see below */
c = mip->mi_compoff;
#endif
--- 1008,1013 ----
***************
*** 1186,1200 ****
static int
can_compound(slang_T *slang, char_u *word, char_u *flags)
{
- #ifdef FEAT_MBYTE
char_u uflags[MAXWLEN * 2];
int i;
- #endif
char_u *p;
if (slang->sl_compprog == NULL)
return FALSE;
- #ifdef FEAT_MBYTE
if (enc_utf8)
{
/* Need to convert the single byte flags to utf8 characters. */
--- 1158,1169 ----
***************
*** 1205,1211 ****
p = uflags;
}
else
- #endif
p = flags;
if (!vim_regexec_prog(&slang->sl_compprog, FALSE, p, 0))
return FALSE;
--- 1174,1179 ----
***************
*** 1434,1440 ****
/* Skip over the previously found word(s). */
mip->mi_prefixlen += mip->mi_compoff;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
/* Case-folded length may differ from original length. */
--- 1402,1407 ----
***************
*** 1443,1449 ****
}
else
mip->mi_cprefixlen = mip->mi_prefixlen;
- #endif
find_word(mip, FIND_PREFIX);
--- 1410,1415 ----
***************
*** 1912,1921 ****
spell_enc(void)
{
- #ifdef FEAT_MBYTE
if (STRLEN(p_enc) < 60 && STRCMP(p_enc, "iso-8859-15") != 0)
return p_enc;
- #endif
return (char_u *)"latin1";
}
--- 1878,1885 ----
***************
*** 2015,2025 ****
vim_free(smp->sm_lead);
/* Don't free sm_oneof and sm_rules, they point into sm_lead. */
vim_free(smp->sm_to);
- #ifdef FEAT_MBYTE
vim_free(smp->sm_lead_w);
vim_free(smp->sm_oneof_w);
vim_free(smp->sm_to_w);
- #endif
}
ga_clear(gap);
--- 1979,1987 ----
***************
*** 2046,2054 ****
hash_clear_all(&lp->sl_wordcount, WC_KEY_OFF);
hash_init(&lp->sl_wordcount);
- #ifdef FEAT_MBYTE
hash_clear_all(&lp->sl_map_hash, 0);
- #endif
/* Clear info from .sug file. */
slang_clear_sug(lp);
--- 2008,2014 ----
***************
*** 2284,2296 ****
else
{
/* No recognized syllable item, at least a syllable char then? */
- #ifdef FEAT_MBYTE
c = mb_ptr2char(p);
len = (*mb_ptr2len)(p);
- #else
- c = *p;
- len = 1;
- #endif
if (vim_strchr(slang->sl_syllable, c) == NULL)
skip = FALSE; /* No, search for next syllable */
else if (!skip)
--- 2244,2251 ----
***************
*** 2352,2360 ****
if (spl_copy == NULL)
goto theend;
- #ifdef FEAT_MBYTE
wp->w_s->b_cjk = 0;
- #endif
/* Loop over comma separated language names. */
for (splp = spl_copy; *splp != NUL; )
--- 2307,2313 ----
***************
*** 2366,2374 ****
if (STRCMP(lang, "cjk") == 0)
{
- #ifdef FEAT_MBYTE
wp->w_s->b_cjk = 1;
- #endif
continue;
}
--- 2319,2325 ----
***************
*** 2633,2641 ****
clear_midword(win_T *wp)
{
vim_memset(wp->w_s->b_spell_ismw, 0, 256);
- #ifdef FEAT_MBYTE
VIM_CLEAR(wp->w_s->b_spell_ismw_mb);
- #endif
}
/*
--- 2584,2590 ----
***************
*** 2651,2657 ****
return;
for (p = lp->sl_midword; *p != NUL; )
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
int c, l, n;
--- 2600,2605 ----
***************
*** 2679,2685 ****
p += l;
}
else
- #endif
wp->w_s->b_spell_ismw[*p++] = TRUE;
}
--- 2627,2632 ----
***************
*** 2725,2735 ****
for (p = word; !spell_iswordp_nmw(p, curwin); MB_PTR_ADV(p))
if (end == NULL ? *p == NUL : p >= end)
return 0; /* only non-word characters, illegal word */
- #ifdef FEAT_MBYTE
if (has_mbyte)
c = mb_ptr2char_adv(&p);
else
- #endif
c = *p++;
firstcap = allcap = SPELL_ISUPPER(c);
--- 2672,2680 ----
***************
*** 2825,2831 ****
}
}
- #if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
/*
* Free all languages.
*/
--- 2770,2775 ----
***************
*** 2851,2859 ****
VIM_CLEAR(repl_to);
VIM_CLEAR(repl_from);
}
- #endif
- #if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Clear all spelling tables and reload them.
* Used after 'encoding' is set and when ":mkspell" was used.
--- 2795,2801 ----
***************
*** 2884,2890 ****
}
}
}
- #endif
/*
* Opposite of offset2bytes().
--- 2826,2831 ----
***************
*** 3016,3022 ****
did_set_spelltab = FALSE;
clear_spell_chartab(&spelltab);
- #ifdef FEAT_MBYTE
if (enc_dbcs)
{
/* DBCS: assume double-wide characters are word characters. */
--- 2957,2962 ----
***************
*** 3041,3047 ****
}
}
else
- #endif
{
/* Rough guess: use locale-dependent library functions. */
for (i = 128; i < 256; ++i)
--- 2981,2986 ----
***************
*** 3073,3079 ****
char_u *p,
win_T *wp) /* buffer used */
{
- #ifdef FEAT_MBYTE
char_u *s;
int l;
int c;
--- 3012,3017 ----
***************
*** 3102,3108 ****
return spell_mb_isword_class(mb_get_class(s), wp);
return spelltab.st_isw[c];
}
- #endif
return spelltab.st_isw[wp->w_s->b_spell_ismw[*p] ? p[1] : p[0]];
}
--- 3040,3045 ----
***************
*** 3114,3120 ****
int
spell_iswordp_nmw(char_u *p, win_T *wp)
{
- #ifdef FEAT_MBYTE
int c;
if (has_mbyte)
--- 3051,3056 ----
***************
*** 3124,3134 ****
return spell_mb_isword_class(mb_get_class(p), wp);
return spelltab.st_isw[c];
}
- #endif
return spelltab.st_isw[*p];
}
- #ifdef FEAT_MBYTE
/*
* Return TRUE if word class indicates a word character.
* Only for characters above 255.
--- 3060,3068 ----
***************
*** 3171,3177 ****
}
return spelltab.st_isw[*s];
}
- #endif
/*
* Case-fold "str[len]" into "buf[buflen]". The result is NUL terminated.
--- 3105,3110 ----
***************
*** 3194,3200 ****
return FAIL; /* result will not fit */
}
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
int outi = 0;
--- 3127,3132 ----
***************
*** 3215,3221 ****
buf[outi] = NUL;
}
else
- #endif
{
/* Be quick for non-multibyte encodings. */
for (i = 0; i < len; ++i)
--- 3147,3152 ----
***************
*** 4072,4092 ****
int l;
p = word;
- #ifdef FEAT_MBYTE
if (has_mbyte)
c = mb_cptr2char_adv(&p);
else
- #endif
c = *p++;
if (upper)
c = SPELL_TOUPPER(c);
else
c = SPELL_TOFOLD(c);
- #ifdef FEAT_MBYTE
if (has_mbyte)
l = mb_char2bytes(c, wcopy);
else
- #endif
{
l = 1;
wcopy[0] = c;
--- 4003,4019 ----
***************
*** 4108,4121 ****
d = wcopy;
for (s = word; *s != NUL; )
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
c = mb_cptr2char_adv(&s);
else
- #endif
c = *s++;
- #ifdef FEAT_MBYTE
/* We only change 0xdf to SS when we are certain latin1 is used. It
* would cause weird errors in other 8-bit encodings. */
if (enc_latin1like && c == 0xdf)
--- 4035,4045 ----
***************
*** 4126,4135 ****
*d++ = c;
}
else
- #endif
c = SPELL_TOUPPER(c);
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
if (d - wcopy >= MAXWLEN - MB_MAXBYTES)
--- 4050,4057 ----
***************
*** 4137,4143 ****
d += mb_char2bytes(c, d);
}
else
- #endif
{
if (d - wcopy >= MAXWLEN - 1)
break;
--- 4059,4064 ----
***************
*** 4434,4444 ****
{
/* Set su->su_badflags to the caps type at this position.
* Use the caps type until here for the prefix itself. */
- #ifdef FEAT_MBYTE
if (has_mbyte)
n = nofold_len(fword, sp->ts_fidx, su->su_badptr);
else
- #endif
n = sp->ts_fidx;
flags = badword_captype(su->su_badptr, su->su_badptr + n);
su->su_badflags = badword_captype(su->su_badptr + n,
--- 4355,4363 ----
***************
*** 4568,4574 ****
|| sp->ts_twordlen - sp->ts_splitoff
< slang->sl_compminlen)
break;
- #ifdef FEAT_MBYTE
/* For multi-byte chars check character length against
* COMPOUNDMIN. */
if (has_mbyte
--- 4487,4492 ----
***************
*** 4576,4582 ****
&& mb_charlen(tword + sp->ts_splitoff)
< slang->sl_compminlen)
break;
- #endif
compflags[sp->ts_complen] = ((unsigned)flags >> 24);
compflags[sp->ts_complen + 1] = NUL;
--- 4494,4499 ----
***************
*** 4625,4636 ****
* allcap and it's only one char long use onecap. */
c = su->su_badflags;
if ((c & WF_ALLCAP)
! #ifdef FEAT_MBYTE
! && su->su_badlen == (*mb_ptr2len)(su->su_badptr)
! #else
! && su->su_badlen == 1
! #endif
! )
c = WF_ONECAP;
c |= flags;
--- 4542,4548 ----
* allcap and it's only one char long use onecap. */
c = su->su_badflags;
if ((c & WF_ALLCAP)
! && su->su_badlen == (*mb_ptr2len)(su->su_badptr))
c = WF_ONECAP;
c |= flags;
***************
*** 4752,4762 ****
* Try word split and/or compounding.
*/
if ((sp->ts_fidx >= sp->ts_fidxtry || fword_ends)
- #ifdef FEAT_MBYTE
/* Don't split halfway a character. */
! && (!has_mbyte || sp->ts_tcharlen == 0)
! #endif
! )
{
int try_compound;
int try_split;
--- 4664,4671 ----
* Try word split and/or compounding.
*/
if ((sp->ts_fidx >= sp->ts_fidxtry || fword_ends)
/* Don't split halfway a character. */
! && (!has_mbyte || sp->ts_tcharlen == 0))
{
int try_compound;
int try_split;
***************
*** 4789,4800 ****
&& ((unsigned)flags >> 24) != 0
&& sp->ts_twordlen - sp->ts_splitoff
>= slang->sl_compminlen
- #ifdef FEAT_MBYTE
&& (!has_mbyte
|| slang->sl_compminlen == 0
|| mb_charlen(tword + sp->ts_splitoff)
>= slang->sl_compminlen)
- #endif
&& (slang->sl_compsylmax < MAXWLEN
|| sp->ts_complen + 1 - sp->ts_compsplit
< slang->sl_compmax)
--- 4698,4707 ----
***************
*** 4921,4931 ****
/* set su->su_badflags to the caps type at this
* position */
- #ifdef FEAT_MBYTE
if (has_mbyte)
n = nofold_len(fword, sp->ts_fidx, su->su_badptr);
else
- #endif
n = sp->ts_fidx;
su->su_badflags = badword_captype(su->su_badptr + n,
su->su_badptr + su->su_badlen);
--- 4828,4836 ----
***************
*** 4963,4973 ****
case STATE_ENDNUL:
/* Past the NUL bytes in the node. */
su->su_badflags = sp->ts_save_badflags;
! if (fword[sp->ts_fidx] == NUL
! #ifdef FEAT_MBYTE
! && sp->ts_tcharlen == 0
! #endif
! )
{
/* The badword ends, can't use STATE_PLAIN. */
PROF_STORE(sp->ts_state)
--- 4868,4874 ----
case STATE_ENDNUL:
/* Past the NUL bytes in the node. */
su->su_badflags = sp->ts_save_badflags;
! if (fword[sp->ts_fidx] == NUL && sp->ts_tcharlen == 0)
{
/* The badword ends, can't use STATE_PLAIN. */
PROF_STORE(sp->ts_state)
***************
*** 5005,5014 ****
* just deleted this byte, accepting it is always cheaper than
* delete + substitute. */
if (c == fword[sp->ts_fidx]
! #ifdef FEAT_MBYTE
! || (sp->ts_tcharlen > 0 && sp->ts_isdiff != DIFF_NONE)
! #endif
! )
newscore = 0;
else
newscore = SCORE_SUBST;
--- 4906,4912 ----
* just deleted this byte, accepting it is always cheaper than
* delete + substitute. */
if (c == fword[sp->ts_fidx]
! || (sp->ts_tcharlen > 0 && sp->ts_isdiff != DIFF_NONE))
newscore = 0;
else
newscore = SCORE_SUBST;
***************
*** 5034,5040 ****
++sp->ts_fidx;
tword[sp->ts_twordlen++] = c;
sp->ts_arridx = idxs[arridx];
- #ifdef FEAT_MBYTE
if (newscore == SCORE_SUBST)
sp->ts_isdiff = DIFF_YES;
if (has_mbyte)
--- 4932,4937 ----
***************
*** 5122,5128 ****
}
}
else
- #endif
{
/* If we found a similar char adjust the score.
* We do this after calling go_deeper() because
--- 5019,5024 ----
***************
*** 5139,5145 ****
break;
case STATE_DEL:
- #ifdef FEAT_MBYTE
/* When past the first byte of a multi-byte char don't try
* delete/insert/swap a character. */
if (has_mbyte && sp->ts_tcharlen > 0)
--- 5035,5040 ----
***************
*** 5148,5154 ****
sp->ts_state = STATE_FINAL;
break;
}
- #endif
/*
* Try skipping one character in the bad word (delete it).
*/
--- 5043,5048 ----
***************
*** 5181,5187 ****
* score if the same character is following "nn" -> "n". It's
* a bit illogical for soundfold tree but it does give better
* results. */
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
c = mb_ptr2char(fword + sp->ts_fidx);
--- 5075,5080 ----
***************
*** 5192,5198 ****
stack[depth].ts_score -= SCORE_DEL - SCORE_DELDUP;
}
else
- #endif
{
++stack[depth].ts_fidx;
if (fword[sp->ts_fidx] == fword[sp->ts_fidx + 1])
--- 5085,5090 ----
***************
*** 5274,5280 ****
sp = &stack[depth];
tword[sp->ts_twordlen++] = c;
sp->ts_arridx = idxs[n];
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
fl = MB_BYTE2LEN(c);
--- 5166,5171 ----
***************
*** 5291,5297 ****
else
fl = 1;
if (fl == 1)
- #endif
{
/* If the previous character was the same, thus doubling a
* character, give a bonus to the score. Also for
--- 5182,5187 ----
***************
*** 5329,5335 ****
break;
}
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
n = MB_CPTR2LEN(p);
--- 5219,5224 ----
***************
*** 5342,5348 ****
c2 = mb_ptr2char(p + n);
}
else
- #endif
{
if (p[1] == NUL)
c2 = NUL;
--- 5231,5236 ----
***************
*** 5379,5385 ****
PROF_STORE(sp->ts_state)
sp->ts_state = STATE_UNSWAP;
++depth;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
fl = mb_char2len(c2);
--- 5267,5272 ----
***************
*** 5388,5394 ****
stack[depth].ts_fidxtry = sp->ts_fidx + n + fl;
}
else
- #endif
{
p[0] = c2;
p[1] = c;
--- 5275,5280 ----
***************
*** 5406,5412 ****
case STATE_UNSWAP:
/* Undo the STATE_SWAP swap: "21" -> "12". */
p = fword + sp->ts_fidx;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
n = MB_PTR2LEN(p);
--- 5292,5297 ----
***************
*** 5415,5421 ****
mb_char2bytes(c, p);
}
else
- #endif
{
c = *p;
*p = p[1];
--- 5300,5305 ----
***************
*** 5427,5433 ****
/* Swap two bytes, skipping one: "123" -> "321". We change
* "fword" here, it's changed back afterwards at STATE_UNSWAP3. */
p = fword + sp->ts_fidx;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
n = MB_CPTR2LEN(p);
--- 5311,5316 ----
***************
*** 5440,5446 ****
c3 = mb_ptr2char(p + n + fl);
}
else
- #endif
{
c = *p;
c2 = p[1];
--- 5323,5328 ----
***************
*** 5473,5479 ****
PROF_STORE(sp->ts_state)
sp->ts_state = STATE_UNSWAP3;
++depth;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
tl = mb_char2len(c3);
--- 5355,5360 ----
***************
*** 5483,5489 ****
stack[depth].ts_fidxtry = sp->ts_fidx + n + fl + tl;
}
else
- #endif
{
p[0] = p[2];
p[2] = c;
--- 5364,5369 ----
***************
*** 5500,5506 ****
case STATE_UNSWAP3:
/* Undo STATE_SWAP3: "321" -> "123" */
p = fword + sp->ts_fidx;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
n = MB_PTR2LEN(p);
--- 5380,5385 ----
***************
*** 5514,5520 ****
p = p + tl;
}
else
- #endif
{
c = *p;
*p = p[2];
--- 5393,5398 ----
***************
*** 5546,5552 ****
sp->ts_state = STATE_UNROT3L;
++depth;
p = fword + sp->ts_fidx;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
n = MB_CPTR2LEN(p);
--- 5424,5429 ----
***************
*** 5558,5564 ****
stack[depth].ts_fidxtry = sp->ts_fidx + n + fl;
}
else
- #endif
{
c = *p;
*p = p[1];
--- 5435,5440 ----
***************
*** 5577,5583 ****
case STATE_UNROT3L:
/* Undo ROT3L: "231" -> "123" */
p = fword + sp->ts_fidx;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
n = MB_PTR2LEN(p);
--- 5453,5458 ----
***************
*** 5588,5594 ****
mb_char2bytes(c, p);
}
else
- #endif
{
c = p[2];
p[2] = p[1];
--- 5463,5468 ----
***************
*** 5611,5617 ****
sp->ts_state = STATE_UNROT3R;
++depth;
p = fword + sp->ts_fidx;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
n = MB_CPTR2LEN(p);
--- 5485,5490 ----
***************
*** 5623,5629 ****
stack[depth].ts_fidxtry = sp->ts_fidx + n + tl;
}
else
- #endif
{
c = p[2];
p[2] = p[1];
--- 5496,5501 ----
***************
*** 5642,5648 ****
case STATE_UNROT3R:
/* Undo ROT3R: "312" -> "123" */
p = fword + sp->ts_fidx;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
c = mb_ptr2char(p);
--- 5514,5519 ----
***************
*** 5653,5659 ****
mb_char2bytes(c, p + n);
}
else
- #endif
{
c = *p;
*p = p[1];
--- 5524,5529 ----
***************
*** 5738,5746 ****
}
mch_memmove(p, ftp->ft_to, tl);
stack[depth].ts_fidxtry = sp->ts_fidx + tl;
- #ifdef FEAT_MBYTE
stack[depth].ts_tcharlen = 0;
- #endif
break;
}
}
--- 5608,5614 ----
***************
*** 5809,5815 ****
stack[depth + 1].ts_flags = 0;
}
- #ifdef FEAT_MBYTE
/*
* Case-folding may change the number of bytes: Count nr of chars in
* fword[flen] and return the byte length of that many chars in "word".
--- 5677,5682 ----
***************
*** 5826,5832 ****
--i;
return (int)(p - word);
}
- #endif
/*
* "fword" is a good word with case folded. Find the matching keep-case
--- 5693,5698 ----
***************
*** 5905,5918 ****
* round[depth] == 1: Try using the folded-case character.
* round[depth] == 2: Try using the upper-case character.
*/
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
flen = MB_CPTR2LEN(fword + fwordidx[depth]);
ulen = MB_CPTR2LEN(uword + uwordidx[depth]);
}
else
- #endif
ulen = flen = 1;
if (round[depth] == 1)
{
--- 5771,5782 ----
***************
*** 6627,6633 ****
similar_chars(slang_T *slang, int c1, int c2)
{
int m1, m2;
- #ifdef FEAT_MBYTE
char_u buf[MB_MAXBYTES + 1];
hashitem_T *hi;
--- 6491,6496 ----
***************
*** 6641,6653 ****
m1 = mb_ptr2char(hi->hi_key + STRLEN(hi->hi_key) + 1);
}
else
- #endif
m1 = slang->sl_map_array[c1];
if (m1 == 0)
return FALSE;
- #ifdef FEAT_MBYTE
if (c2 >= 256)
{
buf[mb_char2bytes(c2, buf)] = 0;
--- 6504,6514 ----
***************
*** 6658,6664 ****
m2 = mb_ptr2char(hi->hi_key + STRLEN(hi->hi_key) + 1);
}
else
- #endif
m2 = slang->sl_map_array[c2];
return m1 == m2;
--- 6519,6524 ----
***************
*** 6700,6714 ****
break;
MB_PTR_BACK(goodword, pgood);
MB_PTR_BACK(su->su_badptr, pbad);
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
if (mb_ptr2char(pgood) != mb_ptr2char(pbad))
break;
}
! else
! #endif
! if (*pgood != *pbad)
break;
}
--- 6560,6571 ----
break;
MB_PTR_BACK(goodword, pgood);
MB_PTR_BACK(su->su_badptr, pbad);
if (has_mbyte)
{
if (mb_ptr2char(pgood) != mb_ptr2char(pbad))
break;
}
! else if (*pgood != *pbad)
break;
}
***************
*** 7028,7038 ****
word = fword;
}
- #ifdef FEAT_MBYTE
if (has_mbyte)
spell_soundfold_wsal(slang, word, res);
else
- #endif
spell_soundfold_sal(slang, word, res);
}
}
--- 6885,6893 ----
***************
*** 7048,7054 ****
int ri = 0;
int c;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
int prevc = 0;
--- 6903,6908 ----
***************
*** 7095,7101 ****
}
}
else
- #endif
{
/* The sl_sal_first[] table contains the translation. */
for (s = inword; (c = *s) != NUL; ++s)
--- 6949,6954 ----
***************
*** 7385,7391 ****
res[reslen] = NUL;
}
- #ifdef FEAT_MBYTE
/*
* Turn "inword" into its sound-a-like equivalent in "res[MAXWLEN]".
* Multi-byte version of spell_soundfold().
--- 7238,7243 ----
***************
*** 7698,7704 ****
}
res[l] = NUL;
}
- #endif
/*
* Compute a score for two sound-a-like words.
--- 7550,7555 ----
***************
*** 7953,7959 ****
int t;
int bc, gc;
int pbc, pgc;
- #ifdef FEAT_MBYTE
char_u *p;
int wbadword[MAXWLEN];
int wgoodword[MAXWLEN];
--- 7804,7809 ----
***************
*** 7970,7976 ****
wgoodword[goodlen++] = 0;
}
else
- #endif
{
badlen = (int)STRLEN(badword) + 1;
goodlen = (int)STRLEN(goodword) + 1;
--- 7820,7825 ----
***************
*** 7992,8005 ****
CNT(i, 0) = CNT(i - 1, 0) + SCORE_DEL;
for (j = 1; j <= goodlen; ++j)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
bc = wbadword[i - 1];
gc = wgoodword[j - 1];
}
else
- #endif
{
bc = badword[i - 1];
gc = goodword[j - 1];
--- 7841,7852 ----
***************
*** 8024,8037 ****
if (i > 1 && j > 1)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
pbc = wbadword[i - 2];
pgc = wgoodword[j - 2];
}
else
- #endif
{
pbc = badword[i - 2];
pgc = goodword[j - 2];
--- 7871,7882 ----
***************
*** 8090,8101 ****
int minscore;
int round;
- #ifdef FEAT_MBYTE
/* Multi-byte characters require a bit more work, use a different function
* to avoid testing "has_mbyte" quite often. */
if (has_mbyte)
return spell_edit_score_limit_w(slang, badword, goodword, limit);
- #endif
/*
* The idea is to go from start to end over the words. So long as
--- 7935,7944 ----
***************
*** 8250,8256 ****
return minscore;
}
- #ifdef FEAT_MBYTE
/*
* Multi-byte version of spell_edit_score_limit().
* Keep it in sync with the above!
--- 8093,8098 ----
***************
*** 8439,8445 ****
return SCORE_MAXMAX;
return minscore;
}
- #endif
/*
* ":spellinfo"
--- 8281,8286 ----
***************
*** 8554,8566 ****
n = captype(pat, NULL);
if (n == WF_ONECAP)
dumpflags |= DUMPFLAG_ONECAP;
! else if (n == WF_ALLCAP
! #ifdef FEAT_MBYTE
! && (int)STRLEN(pat) > mb_ptr2len(pat)
! #else
! && (int)STRLEN(pat) > 1
! #endif
! )
dumpflags |= DUMPFLAG_ALLCAP;
}
}
--- 8395,8401 ----
n = captype(pat, NULL);
if (n == WF_ONECAP)
dumpflags |= DUMPFLAG_ONECAP;
! else if (n == WF_ALLCAP && (int)STRLEN(pat) > mb_ptr2len(pat))
dumpflags |= DUMPFLAG_ALLCAP;
}
}
*** ../vim-8.1.0809/src/spellfile.c 2019-01-19 17:43:03.429449066 +0100
--- src/spellfile.c 2019-01-24 16:49:05.504615445 +0100
***************
*** 306,314 ****
static int read_compound(FILE *fd, slang_T *slang, int len);
static int set_sofo(slang_T *lp, char_u *from, char_u *to);
static void set_sal_first(slang_T *lp);
- #ifdef FEAT_MBYTE
static int *mb_str2wide(char_u *s);
- #endif
static int spell_read_tree(FILE *fd, char_u **bytsp, idx_T **idxsp, int prefixtree, int prefixcnt);
static idx_T read_tree_node(FILE *fd, char_u *byts, idx_T *idxs, int maxidx, idx_T startidx, int prefixtree, int maxprefcondnr);
static void set_spell_charflags(char_u *flags, int cnt, char_u *upp);
--- 306,312 ----
***************
*** 1062,1068 ****
return ccnt;
}
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
/* convert the multi-byte strings to wide char strings */
--- 1060,1065 ----
***************
*** 1088,1094 ****
return SP_OTHERERROR;
}
}
- #endif
}
if (gap->ga_len > 0)
--- 1085,1090 ----
***************
*** 1104,1110 ****
smp->sm_oneof = NULL;
smp->sm_rules = p;
smp->sm_to = NULL;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
smp->sm_lead_w = mb_str2wide(smp->sm_lead);
--- 1100,1105 ----
***************
*** 1112,1118 ****
smp->sm_oneof_w = NULL;
smp->sm_to_w = NULL;
}
- #endif
++gap->ga_len;
}
--- 1107,1112 ----
***************
*** 1268,1277 ****
* Inserting backslashes may double the length, "^\(\)$<Nul>" is 7 bytes.
* Conversion to utf-8 may double the size. */
c = todo * 2 + 7;
- #ifdef FEAT_MBYTE
if (enc_utf8)
c += todo * 2;
- #endif
pat = alloc((unsigned)c);
if (pat == NULL)
return SP_OTHERERROR;
--- 1262,1269 ----
***************
*** 1367,1377 ****
{
if (c == '?' || c == '+' || c == '~')
*pp++ = '\\'; /* "a?" becomes "a\?", "a+" becomes "a\+" */
- #ifdef FEAT_MBYTE
if (enc_utf8)
pp += mb_char2bytes(c, pp);
else
- #endif
*pp++ = c;
}
}
--- 1359,1367 ----
***************
*** 1401,1407 ****
{
int i;
- #ifdef FEAT_MBYTE
garray_T *gap;
char_u *s;
char_u *p;
--- 1391,1396 ----
***************
*** 1468,1474 ****
}
}
else
- #endif
{
/* mapping bytes to bytes is done in sl_sal_first[] */
if (STRLEN(from) != STRLEN(to))
--- 1457,1462 ----
***************
*** 1500,1518 ****
smp = (salitem_T *)gap->ga_data;
for (i = 0; i < gap->ga_len; ++i)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
/* Use the lowest byte of the first character. For latin1 it's
* the character, for other encodings it should differ for most
* characters. */
c = *smp[i].sm_lead_w & 0xff;
else
- #endif
c = *smp[i].sm_lead;
if (sfirst[c] == -1)
{
sfirst[c] = i;
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
int n;
--- 1488,1503 ----
***************
*** 1540,1551 ****
smp[i] = tsal;
}
}
- #endif
}
}
}
- #ifdef FEAT_MBYTE
/*
* Turn a multi-byte string into a wide character string.
* Return it in allocated memory (NULL for out-of-memory)
--- 1525,1534 ----
***************
*** 1566,1572 ****
}
return res;
}
- #endif
/*
* Read a tree from the .spl or .sug file.
--- 1549,1554 ----
***************
*** 1820,1830 ****
char ae_comppermit; /* COMPOUNDPERMITFLAG found */
};
! #ifdef FEAT_MBYTE
! # define AH_KEY_LEN 17 /* 2 x 8 bytes + NUL */
! #else
! # define AH_KEY_LEN 7 /* 6 digits + NUL */
! #endif
/* Affix header from ".aff" file. Used for af_pref and af_suff. */
typedef struct affheader_S
--- 1802,1808 ----
char ae_comppermit; /* COMPOUNDPERMITFLAG found */
};
! #define AH_KEY_LEN 17 /* 2 x 8 bytes + NUL */
/* Affix header from ".aff" file. Used for af_pref and af_suff. */
typedef struct affheader_S
***************
*** 2271,2277 ****
/* Convert from "SET" to 'encoding' when needed. */
vim_free(pc);
- #ifdef FEAT_MBYTE
if (spin->si_conv.vc_type != CONV_NONE)
{
pc = string_convert(&spin->si_conv, rline, NULL);
--- 2249,2254 ----
***************
*** 2284,2290 ****
line = pc;
}
else
- #endif
{
pc = NULL;
line = rline;
--- 2261,2266 ----
***************
*** 2319,2325 ****
{
if (is_aff_rule(items, itemcnt, "SET", 2) && aff->af_enc == NULL)
{
- #ifdef FEAT_MBYTE
/* Setup for conversion from "ENC" to 'encoding'. */
aff->af_enc = enc_canonize(items[1]);
if (aff->af_enc != NULL && !spin->si_ascii
--- 2295,2300 ----
***************
*** 2328,2336 ****
smsg(_("Conversion in %s not supported: from %s to %s"),
fname, aff->af_enc, p_enc);
spin->si_conv.vc_fail = TRUE;
- #else
- smsg(_("Conversion in %s not supported"), fname);
- #endif
}
else if (is_aff_rule(items, itemcnt, "FLAG", 2)
&& aff->af_flagtype == AFT_CHAR)
--- 2303,2308 ----
***************
*** 2772,2784 ****
* be empty or start with the same letter. */
if (aff_entry->ae_chop != NULL
&& aff_entry->ae_add != NULL
- #ifdef FEAT_MBYTE
&& aff_entry->ae_chop[(*mb_ptr2len)(
! aff_entry->ae_chop)] == NUL
! #else
! && aff_entry->ae_chop[1] == NUL
! #endif
! )
{
int c, c_up;
--- 2744,2751 ----
* be empty or start with the same letter. */
if (aff_entry->ae_chop != NULL
&& aff_entry->ae_add != NULL
&& aff_entry->ae_chop[(*mb_ptr2len)(
! aff_entry->ae_chop)] == NUL)
{
int c, c_up;
***************
*** 2803,2809 ****
if (aff_entry->ae_cond != NULL)
{
char_u buf[MAXLINELEN];
! #ifdef FEAT_MBYTE
if (has_mbyte)
{
onecap_copy(items[4], buf, TRUE);
--- 2770,2776 ----
if (aff_entry->ae_cond != NULL)
{
char_u buf[MAXLINELEN];
!
if (has_mbyte)
{
onecap_copy(items[4], buf, TRUE);
***************
*** 2811,2817 ****
spin, buf);
}
else
- #endif
*aff_entry->ae_cond = c_up;
if (aff_entry->ae_cond != NULL)
{
--- 2778,2783 ----
***************
*** 2947,2957 ****
/* Check that every character appears only once. */
for (p = items[1]; *p != NUL; )
{
- #ifdef FEAT_MBYTE
c = mb_ptr2char_adv(&p);
- #else
- c = *p++;
- #endif
if ((spin->si_map.ga_len > 0
&& vim_strchr(spin->si_map.ga_data, c)
!= NULL)
--- 2913,2919 ----
***************
*** 3034,3044 ****
* Don't write one for utf-8 either, we use utf_*() and
* mb_get_class(), the list of chars in the file will be incomplete.
*/
! if (!spin->si_ascii
! #ifdef FEAT_MBYTE
! && !enc_utf8
! #endif
! )
{
if (fol == NULL || low == NULL || upp == NULL)
smsg(_("Missing FOL/LOW/UPP line in %s"), fname);
--- 2996,3002 ----
* Don't write one for utf-8 either, we use utf_*() and
* mb_get_class(), the list of chars in the file will be incomplete.
*/
! if (!spin->si_ascii && !enc_utf8)
{
if (fol == NULL || low == NULL || upp == NULL)
smsg(_("Missing FOL/LOW/UPP line in %s"), fname);
***************
*** 3243,3263 ****
}
else
{
- #ifdef FEAT_MBYTE
res = mb_ptr2char_adv(pp);
- #else
- res = *(*pp)++;
- #endif
if (flagtype == AFT_LONG || (flagtype == AFT_CAPLONG
&& res >= 'A' && res <= 'Z'))
{
if (**pp == NUL)
return 0;
- #ifdef FEAT_MBYTE
res = mb_ptr2char_adv(pp) + (res << 16);
- #else
- res = *(*pp)++ + (res << 16);
- #endif
}
}
return res;
--- 3201,3213 ----
***************
*** 3381,3398 ****
case AFT_LONG:
for (p = afflist; *p != NUL; )
{
- #ifdef FEAT_MBYTE
n = mb_ptr2char_adv(&p);
- #else
- n = *p++;
- #endif
if ((flagtype == AFT_LONG || (n >= 'A' && n <= 'Z'))
&& *p != NUL)
- #ifdef FEAT_MBYTE
n = mb_ptr2char_adv(&p) + (n << 16);
- #else
- n = *p++ + (n << 16);
- #endif
if (n == flag)
return TRUE;
}
--- 3331,3340 ----
***************
*** 3589,3595 ****
continue; /* empty line */
line[l] = NUL;
- #ifdef FEAT_MBYTE
/* Convert from "SET" to 'encoding' when needed. */
if (spin->si_conv.vc_type != CONV_NONE)
{
--- 3531,3536 ----
***************
*** 3603,3609 ****
w = pc;
}
else
- #endif
{
pc = NULL;
w = line;
--- 3544,3549 ----
***************
*** 3930,3936 ****
if (ae->ae_chop != NULL)
{
/* Skip chop string. */
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
i = mb_charlen(ae->ae_chop);
--- 3870,3875 ----
***************
*** 3938,3944 ****
MB_PTR_ADV(p);
}
else
- #endif
p += STRLEN(ae->ae_chop);
}
STRCAT(newword, p);
--- 3877,3882 ----
***************
*** 4162,4168 ****
/* Convert from "/encoding={encoding}" to 'encoding' when needed. */
vim_free(pc);
- #ifdef FEAT_MBYTE
if (spin->si_conv.vc_type != CONV_NONE)
{
pc = string_convert(&spin->si_conv, rline, NULL);
--- 4100,4105 ----
***************
*** 4175,4181 ****
line = pc;
}
else
- #endif
{
pc = NULL;
line = rline;
--- 4112,4117 ----
***************
*** 4194,4200 ****
fname, lnum, line - 1);
else
{
- #ifdef FEAT_MBYTE
char_u *enc;
/* Setup for conversion to 'encoding'. */
--- 4130,4135 ----
***************
*** 4207,4215 ****
fname, line, p_enc);
vim_free(enc);
spin->si_conv.vc_fail = TRUE;
- #else
- smsg(_("Conversion in %s not supported"), fname);
- #endif
}
continue;
}
--- 4142,4147 ----
***************
*** 4981,4991 ****
l = 0;
for (i = 128; i < 256; ++i)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
l += mb_char2bytes(spelltab.st_fold[i], folchars + l);
else
- #endif
folchars[l++] = spelltab.st_fold[i];
}
put_bytes(fd, (long_u)(1 + 128 + 2 + l), 4); /* <sectionlen> */
--- 4913,4921 ----
***************
*** 6112,6121 ****
error = TRUE;
}
- #ifdef FEAT_MBYTE
/* Free any conversion stuff. */
convert_setup(&spin.si_conv, NULL, NULL);
- #endif
}
if (spin.si_compflags != NULL && spin.si_nobreak)
--- 6042,6049 ----
***************
*** 6488,6502 ****
emsg(_(e_affform));
return FAIL;
}
- #ifdef FEAT_MBYTE
f = mb_ptr2char_adv(&pf);
l = mb_ptr2char_adv(&pl);
u = mb_ptr2char_adv(&pu);
! #else
! f = *pf++;
! l = *pl++;
! u = *pu++;
! #endif
/* Every character that appears is a word character. */
if (f < 256)
new_st.st_isw[f] = TRUE;
--- 6416,6425 ----
emsg(_(e_affform));
return FAIL;
}
f = mb_ptr2char_adv(&pf);
l = mb_ptr2char_adv(&pl);
u = mb_ptr2char_adv(&pu);
!
/* Every character that appears is a word character. */
if (f < 256)
new_st.st_isw[f] = TRUE;
***************
*** 6570,6580 ****
if (*p != NUL)
{
- #ifdef FEAT_MBYTE
c = mb_ptr2char_adv(&p);
- #else
- c = *p++;
- #endif
new_st.st_fold[i + 128] = c;
if (i + 128 != c && new_st.st_isu[i + 128] && c < 256)
new_st.st_upper[c] = i + 128;
--- 6493,6499 ----
***************
*** 6675,6683 ****
/* Init the array and hash tables empty. */
for (i = 0; i < 256; ++i)
lp->sl_map_array[i] = 0;
- #ifdef FEAT_MBYTE
hash_init(&lp->sl_map_hash);
- #endif
/*
* The similar characters are stored separated with slashes:
--- 6594,6600 ----
***************
*** 6686,6696 ****
*/
for (p = map; *p != NUL; )
{
- #ifdef FEAT_MBYTE
c = mb_cptr2char_adv(&p);
- #else
- c = *p++;
- #endif
if (c == '/')
headc = 0;
else
--- 6603,6609 ----
***************
*** 6698,6704 ****
if (headc == 0)
headc = c;
- #ifdef FEAT_MBYTE
/* Characters above 255 don't fit in sl_map_array[], put them in
* the hash table. Each entry is the char, a NUL the headchar and
* a NUL. */
--- 6611,6616 ----
***************
*** 6730,6736 ****
}
}
else
- #endif
lp->sl_map_array[c] = headc;
}
}
--- 6642,6647 ----
*** ../vim-8.1.0809/src/syntax.c 2019-01-20 15:30:36.893328693 +0100
--- src/syntax.c 2019-01-24 16:51:52.891322038 +0100
***************
*** 1974,1985 ****
if (vim_iswordp_buf(line + current_col, syn_buf)
&& (current_col == 0
|| !vim_iswordp_buf(line + current_col - 1
- #ifdef FEAT_MBYTE
- (has_mbyte
? (*mb_head_off)(line, line + current_col - 1)
! : 0)
! #endif
! , syn_buf)))
{
syn_id = check_keyword_id(line, (int)current_col,
&endcol, &flags, &next_list, cur_si,
--- 1974,1982 ----
if (vim_iswordp_buf(line + current_col, syn_buf)
&& (current_col == 0
|| !vim_iswordp_buf(line + current_col - 1
- (has_mbyte
? (*mb_head_off)(line, line + current_col - 1)
! : 0) , syn_buf)))
{
syn_id = check_keyword_id(line, (int)current_col,
&endcol, &flags, &next_list, cur_si,
***************
*** 3355,3365 ****
kwlen = 0;
do
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
kwlen += (*mb_ptr2len)(kwp + kwlen);
else
- #endif
++kwlen;
}
while (vim_iswordp_buf(kwp + kwlen, syn_buf));
--- 3352,3360 ----
***************
*** 4668,4684 ****
}
else if (flagtab[fidx].argtype == 11 && arg[5] == '=')
{
- #ifdef FEAT_MBYTE
/* cchar=? */
if (has_mbyte)
{
! # ifdef FEAT_CONCEAL
*conceal_char = mb_ptr2char(arg + 6);
! # endif
arg += mb_ptr2len(arg + 6) - 1;
}
else
- #endif
{
#ifdef FEAT_CONCEAL
*conceal_char = arg[6];
--- 4663,4677 ----
}
else if (flagtab[fidx].argtype == 11 && arg[5] == '=')
{
/* cchar=? */
if (has_mbyte)
{
! #ifdef FEAT_CONCEAL
*conceal_char = mb_ptr2char(arg + 6);
! #endif
arg += mb_ptr2len(arg + 6) - 1;
}
else
{
#ifdef FEAT_CONCEAL
*conceal_char = arg[6];
***************
*** 4948,4954 ****
kw = p + 1; /* skip over the "]" */
break;
}
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
int l = (*mb_ptr2len)(p + 1);
--- 4941,4946 ----
***************
*** 4957,4963 ****
p += l;
}
else
- #endif
{
p[0] = p[1];
++p;
--- 4949,4954 ----
*** ../vim-8.1.0809/src/tag.c 2019-01-19 17:43:03.429449066 +0100
--- src/tag.c 2019-01-24 16:52:13.291152187 +0100
***************
*** 1349,1357 ****
#endif
pat_T orgpat; /* holds unconverted pattern info */
- #ifdef FEAT_MBYTE
vimconv_T vimconv;
- #endif
#ifdef FEAT_TAG_BINS
int findall = (mincount == MAXCOL || mincount == TAG_MANY);
--- 1349,1355 ----
***************
*** 1387,1395 ****
help_save = curbuf->b_help;
orgpat.pat = pat;
- #ifdef FEAT_MBYTE
vimconv.vc_type = CONV_NONE;
- #endif
/*
* Allocate memory for the buffers that are used
--- 1385,1391 ----
***************
*** 1725,1731 ****
}
line_read_in:
- #ifdef FEAT_MBYTE
if (vimconv.vc_type != CONV_NONE)
{
char_u *conv_line;
--- 1721,1726 ----
***************
*** 1752,1758 ****
}
}
}
- #endif
#ifdef FEAT_EMACS_TAGS
--- 1747,1752 ----
***************
*** 1846,1852 ****
if (STRNCMP(lbuf, "!_TAG_FILE_SORTED\t", 18) == 0)
tag_file_sorted = lbuf[18];
#endif
- #ifdef FEAT_MBYTE
if (STRNCMP(lbuf, "!_TAG_FILE_ENCODING\t", 20) == 0)
{
/* Prepare to convert every line from the specified
--- 1840,1845 ----
***************
*** 1856,1862 ****
*p = NUL;
convert_setup(&vimconv, lbuf + 20, p_enc);
}
- #endif
/* Read the next line. Unrecognized flags are ignored. */
continue;
--- 1849,1854 ----
***************
*** 2472,2481 ****
vim_free(incstack[incstack_idx].etag_fname);
}
#endif
- #ifdef FEAT_MBYTE
if (vimconv.vc_type != CONV_NONE)
convert_setup(&vimconv, NULL, NULL);
- #endif
#ifdef FEAT_TAG_BINS
tag_file_sorted = NUL;
--- 2464,2471 ----
*** ../vim-8.1.0809/src/term.c 2019-01-20 15:30:36.893328693 +0100
--- src/term.c 2019-01-24 16:53:05.898719068 +0100
***************
*** 2585,2591 ****
}
- #if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Sometimes a byte out of a multi-byte character is written with out_char().
* To avoid flushing half of the character, call this function first.
--- 2585,2590 ----
***************
*** 2596,2602 ****
if (enc_dbcs != 0 && out_pos >= OUT_SIZE - MB_MAXBYTES)
out_flush();
}
- #endif
#ifdef FEAT_GUI
/*
--- 2595,2600 ----
***************
*** 3620,3626 ****
}
}
- # if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Check how the terminal treats ambiguous character width (UAX #11).
* First, we move the cursor to (1, 0) and print a test ambiguous character
--- 3618,3623 ----
***************
*** 3666,3672 ****
(void)vpeekc_nomap();
}
}
- # endif
/*
* Similar to requesting the version string: Request the terminal background
--- 3663,3668 ----
***************
*** 4606,4614 ****
{
int col = 0;
int semicols = 0;
- #ifdef FEAT_MBYTE
int row_char = NUL;
- #endif
extra = 0;
for (i = 2 + (tp[0] != CSI); i < len
--- 4602,4608 ----
***************
*** 4617,4625 ****
if (tp[i] == ';' && ++semicols == 1)
{
extra = i + 1;
- #ifdef FEAT_MBYTE
row_char = tp[i - 1];
- #endif
}
if (i == len)
{
--- 4611,4617 ----
***************
*** 4629,4635 ****
if (extra > 0)
col = atoi((char *)tp + extra);
- #ifdef FEAT_MBYTE
/* Eat it when it has 2 arguments and ends in 'R'. Also when
* u7_status is not "sent", it may be from a previous Vim that
* just exited. But not for <S-F3>, it sends something
--- 4621,4626 ----
***************
*** 4672,4681 ****
set_vim_var_string(VV_TERMU7RESP, tp, slen);
# endif
}
- else
- #endif
/* eat it when at least one digit and ending in 'c' */
! if (*T_CRV != NUL && i > 2 + (tp[0] != CSI) && tp[i] == 'c')
{
int version = col;
--- 4663,4671 ----
set_vim_var_string(VV_TERMU7RESP, tp, slen);
# endif
}
/* eat it when at least one digit and ending in 'c' */
! else if (*T_CRV != NUL && i > 2 + (tp[0] != CSI)
! && tp[i] == 'c')
{
int version = col;
***************
*** 5973,5983 ****
if (key_name[0] == KS_KEY)
{
/* from ":set <M-b>=xx" */
- #ifdef FEAT_MBYTE
if (has_mbyte)
new_slen += (*mb_char2bytes)(key_name[1], string + new_slen);
else
- #endif
string[new_slen++] = key_name[1];
}
else if (new_slen == 0 && key_name[0] == KS_EXTRA
--- 5963,5971 ----
***************
*** 6257,6266 ****
}
}
- #ifdef FEAT_MBYTE
/* skip multibyte char correctly */
for (i = (*mb_ptr2len)(src); i > 0; --i)
- #endif
{
/*
* If the character is K_SPECIAL, replace it with K_SPECIAL
--- 6245,6252 ----
*** ../vim-8.1.0809/src/ui.c 2019-01-20 15:30:36.897328669 +0100
--- src/ui.c 2019-01-24 16:56:27.013117974 +0100
***************
*** 40,46 ****
/* Don't output anything in silent mode ("ex -s") unless 'verbose' set */
if (!(silent_mode && p_verbose == 0))
{
! #if defined(FEAT_MBYTE) && !defined(WIN3264)
char_u *tofree = NULL;
if (output_conv.vc_type != CONV_NONE)
--- 40,46 ----
/* Don't output anything in silent mode ("ex -s") unless 'verbose' set */
if (!(silent_mode && p_verbose == 0))
{
! #if !defined(WIN3264)
char_u *tofree = NULL;
if (output_conv.vc_type != CONV_NONE)
***************
*** 54,63 ****
mch_write(s, len);
! #if defined(FEAT_MBYTE) && !defined(WIN3264)
if (output_conv.vc_type != CONV_NONE)
vim_free(tofree);
! #endif
}
#endif
}
--- 54,63 ----
mch_write(s, len);
! # if !defined(WIN3264)
if (output_conv.vc_type != CONV_NONE)
vim_free(tofree);
! # endif
}
#endif
}
***************
*** 516,525 ****
{
start = VIsual;
end = curwin->w_cursor;
- #ifdef FEAT_MBYTE
if (has_mbyte)
end.col += (*mb_ptr2len)(ml_get_cursor()) - 1;
- #endif
}
else
{
--- 516,523 ----
***************
*** 821,829 ****
row = check_row(row);
col = check_col(col);
- #ifdef FEAT_MBYTE
col = mb_fix_col(col, row);
- #endif
cb->start.lnum = row;
cb->start.col = col;
--- 819,825 ----
***************
*** 927,935 ****
row = check_row(row);
col = check_col(col);
- #ifdef FEAT_MBYTE
col = mb_fix_col(col, row);
- #endif
if (col == (int)cb->prev.col && row == cb->prev.lnum && !repeated_click)
return;
--- 923,929 ----
***************
*** 995,1015 ****
cb->origin_start_col, row, (int)Columns);
else
{
- #ifdef FEAT_MBYTE
if (has_mbyte && mb_lefthalve(row, col))
slen = 2;
- #endif
clip_update_modeless_selection(cb, cb->origin_row,
cb->origin_start_col, row, col + slen);
}
}
else
{
- #ifdef FEAT_MBYTE
if (has_mbyte
&& mb_lefthalve(cb->origin_row, cb->origin_start_col))
slen = 2;
- #endif
if (col >= (int)cb->word_end_col)
clip_update_modeless_selection(cb, row, cb->word_end_col,
cb->origin_row, cb->origin_start_col + slen);
--- 989,1005 ----
***************
*** 1243,1251 ****
int line_end_col;
int add_newline_flag = FALSE;
int len;
- #ifdef FEAT_MBYTE
char_u *p;
- #endif
int row1 = clip_star.start.lnum;
int col1 = clip_star.start.col;
int row2 = clip_star.end.lnum;
--- 1233,1239 ----
***************
*** 1267,1289 ****
{
row = col1; col1 = col2; col2 = row;
}
- #ifdef FEAT_MBYTE
/* correct starting point for being on right halve of double-wide char */
p = ScreenLines + LineOffset[row1];
if (enc_dbcs != 0)
col1 -= (*mb_head_off)(p, p + col1);
else if (enc_utf8 && p[col1] == 0)
--col1;
- #endif
/* Create a temporary buffer for storing the text */
len = (row2 - row1 + 1) * Columns + 1;
- #ifdef FEAT_MBYTE
if (enc_dbcs != 0)
len *= 2; /* max. 2 bytes per display cell */
else if (enc_utf8)
len *= MB_MAXBYTES;
- #endif
buffer = lalloc((long_u)len, TRUE);
if (buffer == NULL) /* out of memory */
return;
--- 1255,1273 ----
***************
*** 1322,1328 ****
if (row < screen_Rows && end_col <= screen_Columns)
{
- #ifdef FEAT_MBYTE
if (enc_dbcs != 0)
{
int i;
--- 1306,1311 ----
***************
*** 1373,1379 ****
}
}
else
- #endif
{
STRNCPY(bufp, ScreenLines + LineOffset[row] + start_col,
end_col - start_col);
--- 1356,1361 ----
***************
*** 1421,1471 ****
int start_class;
int temp_col;
char_u *p;
- #ifdef FEAT_MBYTE
int mboff;
- #endif
if (row >= screen_Rows || col >= screen_Columns || ScreenLines == NULL)
return;
p = ScreenLines + LineOffset[row];
- #ifdef FEAT_MBYTE
/* Correct for starting in the right halve of a double-wide char */
if (enc_dbcs != 0)
col -= dbcs_screen_head_off(p, p + col);
else if (enc_utf8 && p[col] == 0)
--col;
- #endif
start_class = CHAR_CLASS(p[col]);
temp_col = col;
for ( ; temp_col > 0; temp_col--)
- #ifdef FEAT_MBYTE
if (enc_dbcs != 0
&& (mboff = dbcs_screen_head_off(p, p + temp_col - 1)) > 0)
temp_col -= mboff;
! else
! #endif
! if (CHAR_CLASS(p[temp_col - 1]) != start_class
! #ifdef FEAT_MBYTE
! && !(enc_utf8 && p[temp_col - 1] == 0)
! #endif
! )
break;
cb->word_start_col = temp_col;
temp_col = col;
for ( ; temp_col < screen_Columns; temp_col++)
- #ifdef FEAT_MBYTE
if (enc_dbcs != 0 && dbcs_ptr2cells(p + temp_col) == 2)
++temp_col;
! else
! #endif
! if (CHAR_CLASS(p[temp_col]) != start_class
! #ifdef FEAT_MBYTE
! && !(enc_utf8 && p[temp_col] == 0)
! #endif
! )
break;
cb->word_end_col = temp_col;
}
--- 1403,1437 ----
int start_class;
int temp_col;
char_u *p;
int mboff;
if (row >= screen_Rows || col >= screen_Columns || ScreenLines == NULL)
return;
p = ScreenLines + LineOffset[row];
/* Correct for starting in the right halve of a double-wide char */
if (enc_dbcs != 0)
col -= dbcs_screen_head_off(p, p + col);
else if (enc_utf8 && p[col] == 0)
--col;
start_class = CHAR_CLASS(p[col]);
temp_col = col;
for ( ; temp_col > 0; temp_col--)
if (enc_dbcs != 0
&& (mboff = dbcs_screen_head_off(p, p + temp_col - 1)) > 0)
temp_col -= mboff;
! else if (CHAR_CLASS(p[temp_col - 1]) != start_class
! && !(enc_utf8 && p[temp_col - 1] == 0))
break;
cb->word_start_col = temp_col;
temp_col = col;
for ( ; temp_col < screen_Columns; temp_col++)
if (enc_dbcs != 0 && dbcs_ptr2cells(p + temp_col) == 2)
++temp_col;
! else if (CHAR_CLASS(p[temp_col]) != start_class
! && !(enc_utf8 && p[temp_col] == 0))
break;
cb->word_end_col = temp_col;
}
***************
*** 1820,1830 ****
int len;
int try;
static int did_read_something = FALSE;
- # ifdef FEAT_MBYTE
static char_u *rest = NULL; /* unconverted rest of previous read */
static int restlen = 0;
int unconverted;
- # endif
#endif
#ifdef FEAT_GUI
--- 1786,1794 ----
***************
*** 1860,1866 ****
inbufcount = 0;
# else
- # ifdef FEAT_MBYTE
if (rest != NULL)
{
/* Use remainder of previous call, starts with an invalid character
--- 1824,1829 ----
***************
*** 1881,1896 ****
}
else
unconverted = 0;
- # endif
len = 0; /* to avoid gcc warning */
for (try = 0; try < 100; ++try)
{
size_t readlen = (size_t)((INBUFLEN - inbufcount)
! # ifdef FEAT_MBYTE
! / input_conv.vc_factor
! # endif
! );
# ifdef VMS
len = vms_read((char *)inbuf + inbufcount, readlen);
# else
--- 1844,1855 ----
}
else
unconverted = 0;
len = 0; /* to avoid gcc warning */
for (try = 0; try < 100; ++try)
{
size_t readlen = (size_t)((INBUFLEN - inbufcount)
! / input_conv.vc_factor);
# ifdef VMS
len = vms_read((char *)inbuf + inbufcount, readlen);
# else
***************
*** 1936,1942 ****
}
else
{
- # ifdef FEAT_MBYTE
/*
* May perform conversion on the input characters.
* Include the unconverted rest of the previous call.
--- 1895,1900 ----
***************
*** 1952,1958 ****
len + unconverted, INBUFLEN - inbufcount,
rest == NULL ? &rest : NULL, &restlen);
}
- # endif
while (len-- > 0)
{
/*
--- 1910,1915 ----
***************
*** 2014,2021 ****
}
#endif
- #if defined(FEAT_CLIPBOARD) || defined(FEAT_GUI) || defined(FEAT_RIGHTLEFT) \
- || defined(FEAT_MBYTE) || defined(PROTO)
/*
* Check bounds for column number
*/
--- 1971,1976 ----
***************
*** 2041,2047 ****
return (int)screen_Rows - 1;
return row;
}
- #endif
/*
* Stuff for the X clipboard. Shared between VMS and Unix.
--- 1996,2001 ----
***************
*** 2066,2075 ****
}
static Atom vim_atom; /* Vim's own special selection format */
- #ifdef FEAT_MBYTE
static Atom vimenc_atom; /* Vim's extended selection format */
static Atom utf8_atom;
- #endif
static Atom compound_text_atom;
static Atom text_atom;
static Atom targets_atom;
--- 2020,2027 ----
***************
*** 2079,2088 ****
x11_setup_atoms(Display *dpy)
{
vim_atom = XInternAtom(dpy, VIM_ATOM_NAME, False);
- #ifdef FEAT_MBYTE
vimenc_atom = XInternAtom(dpy, VIMENC_ATOM_NAME,False);
utf8_atom = XInternAtom(dpy, "UTF8_STRING", False);
- #endif
compound_text_atom = XInternAtom(dpy, "COMPOUND_TEXT", False);
text_atom = XInternAtom(dpy, "TEXT", False);
targets_atom = XInternAtom(dpy, "TARGETS", False);
--- 2031,2038 ----
***************
*** 2170,2178 ****
char_u *p;
char **text_list = NULL;
VimClipboard *cbd;
- #ifdef FEAT_MBYTE
char_u *tmpbuf = NULL;
- #endif
if (*sel_atom == clip_plus.sel_atom)
cbd = &clip_plus;
--- 2120,2126 ----
***************
*** 2193,2199 ****
len--;
}
- #ifdef FEAT_MBYTE
else if (*type == vimenc_atom)
{
char_u *enc;
--- 2141,2146 ----
***************
*** 2221,2237 ****
convert_setup(&conv, NULL, NULL);
}
}
- #endif
else if (*type == compound_text_atom
- #ifdef FEAT_MBYTE
|| *type == utf8_atom
! #endif
! || (
! #ifdef FEAT_MBYTE
! enc_dbcs != 0 &&
! #endif
! *type == text_atom))
{
XTextProperty text_prop;
int n_text = 0;
--- 2168,2177 ----
convert_setup(&conv, NULL, NULL);
}
}
else if (*type == compound_text_atom
|| *type == utf8_atom
! || (enc_dbcs != 0 && *type == text_atom))
{
XTextProperty text_prop;
int n_text = 0;
***************
*** 2241,2247 ****
text_prop.encoding = *type;
text_prop.format = *format;
text_prop.nitems = len;
! #if defined(FEAT_MBYTE) && defined(X_HAVE_UTF8_STRING)
if (*type == utf8_atom)
status = Xutf8TextPropertyToTextList(X_DISPLAY, &text_prop,
&text_list, &n_text);
--- 2181,2187 ----
text_prop.encoding = *type;
text_prop.format = *format;
text_prop.nitems = len;
! #if defined(X_HAVE_UTF8_STRING)
if (*type == utf8_atom)
status = Xutf8TextPropertyToTextList(X_DISPLAY, &text_prop,
&text_list, &n_text);
***************
*** 2261,2269 ****
if (text_list != NULL)
XFreeStringList(text_list);
- #ifdef FEAT_MBYTE
vim_free(tmpbuf);
- #endif
XtFree((char *)value);
*(int *)success = TRUE;
}
--- 2201,2207 ----
***************
*** 2281,2308 ****
time_t start_time;
int timed_out = FALSE;
! for (i =
! #ifdef FEAT_MBYTE
! 0
! #else
! 1
! #endif
! ; i < 6; i++)
{
switch (i)
{
- #ifdef FEAT_MBYTE
case 0: type = vimenc_atom; break;
- #endif
case 1: type = vim_atom; break;
- #ifdef FEAT_MBYTE
case 2: type = utf8_atom; break;
- #endif
case 3: type = compound_text_atom; break;
case 4: type = text_atom; break;
default: type = XA_STRING;
}
- #ifdef FEAT_MBYTE
if (type == utf8_atom
# if defined(X_HAVE_UTF8_STRING)
&& !enc_utf8
--- 2219,2235 ----
time_t start_time;
int timed_out = FALSE;
! for (i = 0; i < 6; i++)
{
switch (i)
{
case 0: type = vimenc_atom; break;
case 1: type = vim_atom; break;
case 2: type = utf8_atom; break;
case 3: type = compound_text_atom; break;
case 4: type = text_atom; break;
default: type = XA_STRING;
}
if (type == utf8_atom
# if defined(X_HAVE_UTF8_STRING)
&& !enc_utf8
***************
*** 2311,2317 ****
/* Only request utf-8 when 'encoding' is utf8 and
* Xutf8TextPropertyToTextList is available. */
continue;
- #endif
success = MAYBE;
XtGetSelectionValue(myShell, cbd->sel_atom, type,
clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime);
--- 2238,2243 ----
***************
*** 2406,2419 ****
*value = (XtPointer)array;
i = 0;
array[i++] = targets_atom;
- #ifdef FEAT_MBYTE
array[i++] = vimenc_atom;
- #endif
array[i++] = vim_atom;
- #ifdef FEAT_MBYTE
if (enc_utf8)
array[i++] = utf8_atom;
- #endif
array[i++] = XA_STRING;
array[i++] = text_atom;
array[i++] = compound_text_atom;
--- 2332,2341 ----
***************
*** 2427,2436 ****
}
if ( *target != XA_STRING
- #ifdef FEAT_MBYTE
&& *target != vimenc_atom
&& (*target != utf8_atom || !enc_utf8)
- #endif
&& *target != vim_atom
&& *target != text_atom
&& *target != compound_text_atom)
--- 2349,2356 ----
***************
*** 2445,2455 ****
if (*target == vim_atom)
(*length)++;
- #ifdef FEAT_MBYTE
/* Our own format with encoding: motion 'encoding' NUL text */
if (*target == vimenc_atom)
*length += STRLEN(p_enc) + 2;
- #endif
if (save_length < *length || save_length / 2 >= *length)
*value = XtRealloc((char *)save_result, (Cardinal)*length + 1);
--- 2365,2373 ----
***************
*** 2463,2473 ****
save_result = (char_u *)*value;
save_length = *length;
! if (*target == XA_STRING
! #ifdef FEAT_MBYTE
! || (*target == utf8_atom && enc_utf8)
! #endif
! )
{
mch_memmove(save_result, string, (size_t)(*length));
*type = *target;
--- 2381,2387 ----
save_result = (char_u *)*value;
save_length = *length;
! if (*target == XA_STRING || (*target == utf8_atom && enc_utf8))
{
mch_memmove(save_result, string, (size_t)(*length));
*type = *target;
***************
*** 2495,2501 ****
save_result = (char_u *)*value;
save_length = *length;
}
- #ifdef FEAT_MBYTE
else if (*target == vimenc_atom)
{
int l = STRLEN(p_enc);
--- 2409,2414 ----
***************
*** 2505,2511 ****
mch_memmove(save_result + l + 2, string, (size_t)(*length - l - 2));
*type = vimenc_atom;
}
- #endif
else
{
save_result[0] = motion_type;
--- 2418,2423 ----
***************
*** 2599,2605 ****
if (nbytes > 0)
{
- #ifdef FEAT_MBYTE
int done = FALSE;
/* CUT_BUFFER0 is supposed to be always latin1. Convert to 'enc' when
--- 2511,2516 ----
***************
*** 2625,2631 ****
}
}
if (!done) /* use the text without conversion */
- #endif
clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
XFree((void *)buffer);
if (p_verbose > 0)
--- 2536,2541 ----
*** ../vim-8.1.0809/src/version.c 2019-01-24 16:38:58.280712420 +0100
--- src/version.c 2019-01-24 17:17:24.875973757 +0100
***************
*** 459,469 ****
"+multi_byte_ime",
# endif
#else
- # ifdef FEAT_MBYTE
"+multi_byte",
- # else
- "-multi_byte",
- # endif
#endif
#ifdef FEAT_MULTI_LANG
"+multi_lang",
--- 459,465 ----
***************
*** 3052,3065 ****
for (l = 0; p[l] != NUL
&& (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
{
- #ifdef FEAT_MBYTE
if (has_mbyte)
{
clen += ptr2cells(p + l);
l += (*mb_ptr2len)(p + l) - 1;
}
else
- #endif
clen += byte2cells(p[l]);
}
screen_puts_len(p, l, row, col, *p == '<' ? HL_ATTR(HLF_8) : attr);
--- 3050,3061 ----
*** ../vim-8.1.0809/src/winclip.c 2017-02-01 13:42:34.000000000 +0100
--- src/winclip.c 2019-01-24 17:00:00.143491565 +0100
***************
*** 44,50 ****
typedef int UINT;
#endif
- #if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Convert an UTF-8 string to UTF-16.
* "instr[inlen]" is the input. "inlen" is in bytes.
--- 44,49 ----
***************
*** 179,185 ****
}
}
- #endif /* FEAT_MBYTE */
#ifdef FEAT_CLIPBOARD
/*
--- 178,183 ----
***************
*** 301,312 ****
VimClipType_t metadata = { -1, -1, -1, -1 };
HGLOBAL hMem = NULL;
char_u *str = NULL;
! #if defined(FEAT_MBYTE) && defined(WIN3264)
char_u *to_free = NULL;
#endif
- #ifdef FEAT_MBYTE
HGLOBAL rawh = NULL;
- #endif
int str_size = 0;
int maxlen;
size_t n;
--- 299,308 ----
VimClipType_t metadata = { -1, -1, -1, -1 };
HGLOBAL hMem = NULL;
char_u *str = NULL;
! #if defined(WIN3264)
char_u *to_free = NULL;
#endif
HGLOBAL rawh = NULL;
int str_size = 0;
int maxlen;
size_t n;
***************
*** 339,345 ****
}
}
- #ifdef FEAT_MBYTE
/* Check for Vim's raw clipboard format first. This is used without
* conversion, but only if 'encoding' matches. */
if (IsClipboardFormatAvailable(cbd->format_raw)
--- 335,340 ----
***************
*** 366,444 ****
}
if (str == NULL)
{
! #endif
!
! #if defined(FEAT_MBYTE) && defined(WIN3264)
! /* Try to get the clipboard in Unicode if it's not an empty string. */
! if (IsClipboardFormatAvailable(CF_UNICODETEXT) && metadata.ucslen != 0)
! {
! HGLOBAL hMemW;
!
! if ((hMemW = GetClipboardData(CF_UNICODETEXT)) != NULL)
! {
! WCHAR *hMemWstr = (WCHAR *)GlobalLock(hMemW);
!
! /* Use the length of our metadata if possible, but limit it to the
! * GlobalSize() for safety. */
! maxlen = (int)(GlobalSize(hMemW) / sizeof(WCHAR));
! if (metadata.ucslen >= 0)
! {
! if (metadata.ucslen > maxlen)
! str_size = maxlen;
else
! str_size = metadata.ucslen;
! }
! else
! {
! for (str_size = 0; str_size < maxlen; ++str_size)
! if (hMemWstr[str_size] == NUL)
! break;
}
- to_free = str = utf16_to_enc((short_u *)hMemWstr, &str_size);
- GlobalUnlock(hMemW);
}
! }
! else
#endif
! /* Get the clipboard in the Active codepage. */
! if (IsClipboardFormatAvailable(CF_TEXT))
! {
! if ((hMem = GetClipboardData(CF_TEXT)) != NULL)
{
! str = (char_u *)GlobalLock(hMem);
!
! /* The length is either what our metadata says or the strlen().
! * But limit it to the GlobalSize() for safety. */
! maxlen = (int)GlobalSize(hMem);
! if (metadata.txtlen >= 0)
! {
! if (metadata.txtlen > maxlen)
! str_size = maxlen;
! else
! str_size = metadata.txtlen;
! }
! else
{
! for (str_size = 0; str_size < maxlen; ++str_size)
! if (str[str_size] == NUL)
! break;
! }
! # if defined(FEAT_MBYTE) && defined(WIN3264)
! /* The text is in the active codepage. Convert to 'encoding',
! * going through UTF-16. */
! acp_to_enc(str, str_size, &to_free, &maxlen);
! if (to_free != NULL)
! {
! str_size = maxlen;
! str = to_free;
}
- # endif
}
}
- #ifdef FEAT_MBYTE
- }
- #endif
if (str != NULL && *str != NUL)
{
--- 361,435 ----
}
if (str == NULL)
{
! #if defined(WIN3264)
! /* Try to get the clipboard in Unicode if it's not an empty string. */
! if (IsClipboardFormatAvailable(CF_UNICODETEXT) && metadata.ucslen != 0)
! {
! HGLOBAL hMemW;
!
! if ((hMemW = GetClipboardData(CF_UNICODETEXT)) != NULL)
! {
! WCHAR *hMemWstr = (WCHAR *)GlobalLock(hMemW);
!
! /* Use the length of our metadata if possible, but limit it to
! * the GlobalSize() for safety. */
! maxlen = (int)(GlobalSize(hMemW) / sizeof(WCHAR));
! if (metadata.ucslen >= 0)
! {
! if (metadata.ucslen > maxlen)
! str_size = maxlen;
! else
! str_size = metadata.ucslen;
! }
else
! {
! for (str_size = 0; str_size < maxlen; ++str_size)
! if (hMemWstr[str_size] == NUL)
! break;
! }
! to_free = str = utf16_to_enc((short_u *)hMemWstr, &str_size);
! GlobalUnlock(hMemW);
}
}
! else
#endif
! /* Get the clipboard in the Active codepage. */
! if (IsClipboardFormatAvailable(CF_TEXT))
{
! if ((hMem = GetClipboardData(CF_TEXT)) != NULL)
{
! str = (char_u *)GlobalLock(hMem);
! /* The length is either what our metadata says or the strlen().
! * But limit it to the GlobalSize() for safety. */
! maxlen = (int)GlobalSize(hMem);
! if (metadata.txtlen >= 0)
! {
! if (metadata.txtlen > maxlen)
! str_size = maxlen;
! else
! str_size = metadata.txtlen;
! }
! else
! {
! for (str_size = 0; str_size < maxlen; ++str_size)
! if (str[str_size] == NUL)
! break;
! }
!
! #if defined(WIN3264)
! /* The text is in the active codepage. Convert to
! * 'encoding', going through UTF-16. */
! acp_to_enc(str, str_size, &to_free, &maxlen);
! if (to_free != NULL)
! {
! str_size = maxlen;
! str = to_free;
! }
! #endif
}
}
}
if (str != NULL && *str != NUL)
{
***************
*** 460,471 ****
/* unlock the global object */
if (hMem != NULL)
GlobalUnlock(hMem);
- #ifdef FEAT_MBYTE
if (rawh != NULL)
GlobalUnlock(rawh);
- #endif
CloseClipboard();
! #if defined(FEAT_MBYTE) && defined(WIN3264)
vim_free(to_free);
#endif
}
--- 451,460 ----
/* unlock the global object */
if (hMem != NULL)
GlobalUnlock(hMem);
if (rawh != NULL)
GlobalUnlock(rawh);
CloseClipboard();
! #if defined(WIN3264)
vim_free(to_free);
#endif
}
***************
*** 482,488 ****
HGLOBAL hMemRaw = NULL;
HGLOBAL hMem = NULL;
HGLOBAL hMemVim = NULL;
! # if defined(FEAT_MBYTE) && defined(WIN3264)
HGLOBAL hMemW = NULL;
# endif
--- 471,477 ----
HGLOBAL hMemRaw = NULL;
HGLOBAL hMem = NULL;
HGLOBAL hMemVim = NULL;
! # if defined(WIN3264)
HGLOBAL hMemW = NULL;
# endif
***************
*** 499,505 ****
metadata.ucslen = 0;
metadata.rawlen = 0;
- #ifdef FEAT_MBYTE
/* Always set the raw bytes: 'encoding', NUL and the text. This is used
* when copy/paste from/to Vim with the same 'encoding', so that illegal
* bytes can also be copied and no conversion is needed. */
--- 488,493 ----
***************
*** 519,527 ****
else
metadata.rawlen = 0;
}
- #endif
! # if defined(FEAT_MBYTE) && defined(WIN3264)
{
WCHAR *out;
int len = metadata.txtlen;
--- 507,514 ----
else
metadata.rawlen = 0;
}
! # if defined(WIN3264)
{
WCHAR *out;
int len = metadata.txtlen;
***************
*** 603,609 ****
{
SetClipboardData(cbd->format, hMemVim);
hMemVim = 0;
! # if defined(FEAT_MBYTE) && defined(WIN3264)
if (hMemW != NULL)
{
if (SetClipboardData(CF_UNICODETEXT, hMemW) != NULL)
--- 590,596 ----
{
SetClipboardData(cbd->format, hMemVim);
hMemVim = 0;
! # if defined(WIN3264)
if (hMemW != NULL)
{
if (SetClipboardData(CF_UNICODETEXT, hMemW) != NULL)
***************
*** 624,630 ****
GlobalFree(hMemRaw);
if (hMem)
GlobalFree(hMem);
! # if defined(FEAT_MBYTE) && defined(WIN3264)
if (hMemW)
GlobalFree(hMemW);
# endif
--- 611,617 ----
GlobalFree(hMemRaw);
if (hMem)
GlobalFree(hMem);
! # if defined(WIN3264)
if (hMemW)
GlobalFree(hMemW);
# endif
***************
*** 634,640 ****
#endif /* FEAT_CLIPBOARD */
- #if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Note: the following two functions are only guaranteed to work when using
* valid MS-Windows codepages or when iconv() is available.
--- 621,626 ----
***************
*** 759,767 ****
return enc_str;
}
- #endif /* FEAT_MBYTE */
! #if (defined(FEAT_MBYTE) && defined(WIN3264)) || defined(PROTO)
/*
* Convert from the active codepage to 'encoding'.
* Input is "str[str_size]".
--- 745,752 ----
return enc_str;
}
! #if defined(WIN3264) || defined(PROTO)
/*
* Convert from the active codepage to 'encoding'.
* Input is "str[str_size]".
*** ../vim-8.1.0809/src/window.c 2019-01-19 17:43:03.433449041 +0100
--- src/window.c 2019-01-24 17:00:20.827336604 +0100
***************
*** 6180,6191 ****
*/
while (ptr > line)
{
- #ifdef FEAT_MBYTE
if (has_mbyte && (len = (*mb_head_off)(line, ptr - 1)) > 0)
ptr -= len + 1;
! else
! #endif
! if (vim_isfilec(ptr[-1])
|| ((options & FNAME_HYP) && path_is_url(ptr - 1)))
--ptr;
else
--- 6180,6188 ----
*/
while (ptr > line)
{
if (has_mbyte && (len = (*mb_head_off)(line, ptr - 1)) > 0)
ptr -= len + 1;
! else if (vim_isfilec(ptr[-1])
|| ((options & FNAME_HYP) && path_is_url(ptr - 1)))
--ptr;
else
***************
*** 6214,6224 ****
if (ptr[len] == '\\')
/* Skip over the "\" in "\ ". */
++len;
- #ifdef FEAT_MBYTE
if (has_mbyte)
len += (*mb_ptr2len)(ptr + len);
else
- #endif
++len;
}
--- 6211,6219 ----
***************
*** 6829,6835 ****
m->match.regprog = regprog;
m->match.rmm_ic = FALSE;
m->match.rmm_maxcol = 0;
! # if defined(FEAT_CONCEAL) && defined(FEAT_MBYTE)
m->conceal_char = 0;
if (conceal_char != NULL)
m->conceal_char = (*mb_ptr2char)(conceal_char);
--- 6824,6830 ----
m->match.regprog = regprog;
m->match.rmm_ic = FALSE;
m->match.rmm_maxcol = 0;
! # if defined(FEAT_CONCEAL)
m->conceal_char = 0;
if (conceal_char != NULL)
m->conceal_char = (*mb_ptr2char)(conceal_char);
*** ../vim-8.1.0809/src/glbl_ime.cpp 2016-08-29 22:42:20.000000000 +0200
--- src/glbl_ime.cpp 2019-01-24 17:00:38.099207536 +0100
***************
*** 134,140 ****
if (pIApp == NULL || pIApp->OnDefWindowProc(hWnd, Msg,
wParam, lParam, &lResult) != S_OK)
{
! #if defined(WIN3264) && defined(FEAT_MBYTE)
if (wide_WindowProc)
lResult = DefWindowProcW(hWnd, Msg, wParam, lParam);
else
--- 134,140 ----
if (pIApp == NULL || pIApp->OnDefWindowProc(hWnd, Msg,
wParam, lParam, &lResult) != S_OK)
{
! #if defined(WIN3264)
if (wide_WindowProc)
lResult = DefWindowProcW(hWnd, Msg, wParam, lParam);
else
*** ../vim-8.1.0809/src/ex_cmds.h 2019-01-17 15:43:21.757878392 +0100
--- src/ex_cmds.h 2019-01-24 17:01:04.547010454 +0100
***************
*** 1789,1798 ****
int force_bin; /* 0, FORCE_BIN or FORCE_NOBIN */
int read_edit; /* ++edit argument */
int force_ff; /* ++ff= argument (first char of argument) */
- #ifdef FEAT_MBYTE
int force_enc; /* ++enc= argument (index in cmd[]) */
int bad_char; /* BAD_KEEP, BAD_DROP or replacement byte */
- #endif
#ifdef FEAT_USR_CMDS
int useridx; /* user command index */
#endif
--- 1789,1796 ----
*** ../vim-8.1.0809/src/globals.h 2019-01-22 22:20:13.374961397 +0100
--- src/globals.h 2019-01-24 17:01:59.414603615 +0100
***************
*** 44,50 ****
EXTERN unsigned *LineOffset INIT(= NULL);
EXTERN char_u *LineWraps INIT(= NULL); /* line wraps to next line */
- #ifdef FEAT_MBYTE
/*
* When using Unicode characters (in UTF-8 encoding) the character in
* ScreenLinesUC[] contains the Unicode for the character at this position, or
--- 44,49 ----
***************
*** 61,67 ****
/* Only used for euc-jp: Second byte of a character that starts with 0x8e.
* These are single-width. */
EXTERN schar_T *ScreenLines2 INIT(= NULL);
- #endif
/*
* Indexes for tab page line:
--- 60,65 ----
***************
*** 798,838 ****
EXTERN JMP_BUF x_jump_env;
#endif
- #if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
/*
* These flags are set based upon 'fileencoding'.
* Note that "enc_utf8" is also set for "unicode", because the characters are
* internally stored as UTF-8 (to avoid trouble with NUL bytes).
*/
! # define DBCS_JPN 932 /* japan */
! # define DBCS_JPNU 9932 /* euc-jp */
! # define DBCS_KOR 949 /* korea */
! # define DBCS_KORU 9949 /* euc-kr */
! # define DBCS_CHS 936 /* chinese */
! # define DBCS_CHSU 9936 /* euc-cn */
! # define DBCS_CHT 950 /* taiwan */
! # define DBCS_CHTU 9950 /* euc-tw */
! # define DBCS_2BYTE 1 /* 2byte- */
! # define DBCS_DEBUG -1
! #endif
- #ifdef FEAT_MBYTE
EXTERN int enc_dbcs INIT(= 0); /* One of DBCS_xxx values if
DBCS encoding */
EXTERN int enc_unicode INIT(= 0); /* 2: UCS-2 or UTF-16, 4: UCS-4 */
EXTERN int enc_utf8 INIT(= FALSE); /* UTF-8 encoded Unicode */
EXTERN int enc_latin1like INIT(= TRUE); /* 'encoding' is latin1 comp. */
! # if defined(WIN3264) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD)
/* Codepage nr of 'encoding'. Negative means it's not been set yet, zero
* means 'encoding' is not a valid codepage. */
EXTERN int enc_codepage INIT(= -1);
EXTERN int enc_latin9 INIT(= FALSE); /* 'encoding' is latin9 */
! # endif
EXTERN int has_mbyte INIT(= 0); /* any multi-byte encoding */
! # if defined(WIN3264) && defined(FEAT_MBYTE)
EXTERN int wide_WindowProc INIT(= FALSE); /* use wide WindowProc() */
! # endif
/*
* To speed up BYTELEN() we fill a table with the byte lengths whenever
--- 796,833 ----
EXTERN JMP_BUF x_jump_env;
#endif
/*
* These flags are set based upon 'fileencoding'.
* Note that "enc_utf8" is also set for "unicode", because the characters are
* internally stored as UTF-8 (to avoid trouble with NUL bytes).
*/
! #define DBCS_JPN 932 /* japan */
! #define DBCS_JPNU 9932 /* euc-jp */
! #define DBCS_KOR 949 /* korea */
! #define DBCS_KORU 9949 /* euc-kr */
! #define DBCS_CHS 936 /* chinese */
! #define DBCS_CHSU 9936 /* euc-cn */
! #define DBCS_CHT 950 /* taiwan */
! #define DBCS_CHTU 9950 /* euc-tw */
! #define DBCS_2BYTE 1 /* 2byte- */
! #define DBCS_DEBUG -1
EXTERN int enc_dbcs INIT(= 0); /* One of DBCS_xxx values if
DBCS encoding */
EXTERN int enc_unicode INIT(= 0); /* 2: UCS-2 or UTF-16, 4: UCS-4 */
EXTERN int enc_utf8 INIT(= FALSE); /* UTF-8 encoded Unicode */
EXTERN int enc_latin1like INIT(= TRUE); /* 'encoding' is latin1 comp. */
! #if defined(WIN3264) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD)
/* Codepage nr of 'encoding'. Negative means it's not been set yet, zero
* means 'encoding' is not a valid codepage. */
EXTERN int enc_codepage INIT(= -1);
EXTERN int enc_latin9 INIT(= FALSE); /* 'encoding' is latin9 */
! #endif
EXTERN int has_mbyte INIT(= 0); /* any multi-byte encoding */
! #if defined(WIN3264)
EXTERN int wide_WindowProc INIT(= FALSE); /* use wide WindowProc() */
! #endif
/*
* To speed up BYTELEN() we fill a table with the byte lengths whenever
***************
*** 875,881 ****
EXTERN int* (*iconv_errno) (void);
# endif
- #endif /* FEAT_MBYTE */
#ifdef FEAT_XIM
# ifdef FEAT_GUI_GTK
--- 870,875 ----
*** ../vim-8.1.0809/src/gui.h 2018-07-29 17:35:19.493750319 +0200
--- src/gui.h 2019-01-24 17:02:15.106487731 +0100
***************
*** 303,315 ****
GuiFont menu_font; /* menu item font */
# endif
#endif
- #ifdef FEAT_MBYTE
GuiFont wide_font; /* Normal 'guifontwide' font */
! # ifndef FEAT_GUI_GTK
GuiFont wide_bold_font; /* Bold 'guifontwide' font */
GuiFont wide_ital_font; /* Italic 'guifontwide' font */
GuiFont wide_boldital_font; /* Bold-Italic 'guifontwide' font */
- # endif
#endif
#ifdef FEAT_XFONTSET
GuiFontset fontset; /* set of fonts for multi-byte chars */
--- 303,313 ----
GuiFont menu_font; /* menu item font */
# endif
#endif
GuiFont wide_font; /* Normal 'guifontwide' font */
! #ifndef FEAT_GUI_GTK
GuiFont wide_bold_font; /* Bold 'guifontwide' font */
GuiFont wide_ital_font; /* Italic 'guifontwide' font */
GuiFont wide_boldital_font; /* Bold-Italic 'guifontwide' font */
#endif
#ifdef FEAT_XFONTSET
GuiFontset fontset; /* set of fonts for multi-byte chars */
*** ../vim-8.1.0809/src/if_py_both.h 2019-01-19 17:43:03.417449145 +0100
--- src/if_py_both.h 2019-01-24 17:02:32.870356782 +0100
***************
*** 24,34 ****
typedef int Py_ssize_t; /* Python 2.4 and earlier don't have this type. */
#endif
! #ifdef FEAT_MBYTE
! # define ENC_OPT ((char *)p_enc)
! #else
! # define ENC_OPT "latin1"
! #endif
#define DOPY_FUNC "_vim_pydo"
static const char *vim_special_path = "_vim_path_";
--- 24,30 ----
typedef int Py_ssize_t; /* Python 2.4 and earlier don't have this type. */
#endif
! #define ENC_OPT ((char *)p_enc)
#define DOPY_FUNC "_vim_pydo"
static const char *vim_special_path = "_vim_path_";
***************
*** 985,995 ****
if (!(str = StringToChars(string, &todecref)))
return NULL;
- #ifdef FEAT_MBYTE
len = mb_string2cells(str, (int)STRLEN(str));
- #else
- len = STRLEN(str);
- #endif
Py_XDECREF(todecref);
--- 981,987 ----
*** ../vim-8.1.0809/src/macros.h 2018-11-16 16:21:01.633310065 +0100
--- src/macros.h 2019-01-24 17:03:20.958003503 +0100
***************
*** 96,112 ****
* MB_ISLOWER() and MB_ISUPPER() are to be used on multi-byte characters. But
* don't use them for negative values!
*/
! #ifdef FEAT_MBYTE
! # define MB_ISLOWER(c) vim_islower(c)
! # define MB_ISUPPER(c) vim_isupper(c)
! # define MB_TOLOWER(c) vim_tolower(c)
! # define MB_TOUPPER(c) vim_toupper(c)
! #else
! # define MB_ISLOWER(c) islower(c)
! # define MB_ISUPPER(c) isupper(c)
! # define MB_TOLOWER(c) TOLOWER_LOC(c)
! # define MB_TOUPPER(c) TOUPPER_LOC(c)
! #endif
/* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
* non-zero for superscript 1. Also avoids that isdigit() crashes for numbers
--- 96,105 ----
* MB_ISLOWER() and MB_ISUPPER() are to be used on multi-byte characters. But
* don't use them for negative values!
*/
! #define MB_ISLOWER(c) vim_islower(c)
! #define MB_ISUPPER(c) vim_isupper(c)
! #define MB_TOLOWER(c) vim_tolower(c)
! #define MB_TOUPPER(c) vim_toupper(c)
/* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
* non-zero for superscript 1. Also avoids that isdigit() crashes for numbers
***************
*** 139,146 ****
* a mapping and the langnoremap option was set.
* The do-while is just to ignore a ';' after the macro.
*/
! # ifdef FEAT_MBYTE
! # define LANGMAP_ADJUST(c, condition) \
do { \
if (*p_langmap \
&& (condition) \
--- 132,138 ----
* a mapping and the langnoremap option was set.
* The do-while is just to ignore a ';' after the macro.
*/
! # define LANGMAP_ADJUST(c, condition) \
do { \
if (*p_langmap \
&& (condition) \
***************
*** 154,170 ****
c = langmap_adjust_mb(c); \
} \
} while (0)
- # else
- # define LANGMAP_ADJUST(c, condition) \
- do { \
- if (*p_langmap \
- && (condition) \
- && (p_lrm || (!p_lrm && KeyTyped)) \
- && !KeyStuffed \
- && (c) >= 0 && (c) < 256) \
- c = langmap_mapchar[c]; \
- } while (0)
- # endif
#else
# define LANGMAP_ADJUST(c, condition) /* nop */
#endif
--- 146,151 ----
***************
*** 256,288 ****
* MB_COPY_CHAR(f, t): copy one char from "f" to "t" and advance the pointers.
* PTR2CHAR(): get character from pointer.
*/
- #ifdef FEAT_MBYTE
/* Get the length of the character p points to, including composing chars */
! # define MB_PTR2LEN(p) (has_mbyte ? (*mb_ptr2len)(p) : 1)
/* Advance multi-byte pointer, skip over composing chars. */
! # define MB_PTR_ADV(p) p += has_mbyte ? (*mb_ptr2len)(p) : 1
/* Advance multi-byte pointer, do not skip over composing chars. */
! # define MB_CPTR_ADV(p) p += enc_utf8 ? utf_ptr2len(p) : has_mbyte ? (*mb_ptr2len)(p) : 1
/* Backup multi-byte pointer. Only use with "p" > "s" ! */
! # define MB_PTR_BACK(s, p) p -= has_mbyte ? ((*mb_head_off)(s, p - 1) + 1) : 1
/* get length of multi-byte char, not including composing chars */
! # define MB_CPTR2LEN(p) (enc_utf8 ? utf_ptr2len(p) : (*mb_ptr2len)(p))
! # define MB_COPY_CHAR(f, t) if (has_mbyte) mb_copy_char(&f, &t); else *t++ = *f++
! # define MB_CHARLEN(p) (has_mbyte ? mb_charlen(p) : (int)STRLEN(p))
! # define MB_CHAR2LEN(c) (has_mbyte ? mb_char2len(c) : 1)
! # define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p))
! #else
! # define MB_PTR2LEN(p) 1
! # define MB_CPTR2LEN(p) 1
! # define MB_PTR_ADV(p) ++p
! # define MB_CPTR_ADV(p) ++p
! # define MB_PTR_BACK(s, p) --p
! # define MB_COPY_CHAR(f, t) *t++ = *f++
! # define MB_CHARLEN(p) STRLEN(p)
! # define MB_CHAR2LEN(c) 1
! # define PTR2CHAR(p) ((int)*(p))
! #endif
#ifdef FEAT_AUTOCHDIR
# define DO_AUTOCHDIR do { if (p_acd) do_autochdir(); } while (0)
--- 237,257 ----
* MB_COPY_CHAR(f, t): copy one char from "f" to "t" and advance the pointers.
* PTR2CHAR(): get character from pointer.
*/
/* Get the length of the character p points to, including composing chars */
! #define MB_PTR2LEN(p) (has_mbyte ? (*mb_ptr2len)(p) : 1)
/* Advance multi-byte pointer, skip over composing chars. */
! #define MB_PTR_ADV(p) p += has_mbyte ? (*mb_ptr2len)(p) : 1
/* Advance multi-byte pointer, do not skip over composing chars. */
! #define MB_CPTR_ADV(p) p += enc_utf8 ? utf_ptr2len(p) : has_mbyte ? (*mb_ptr2len)(p) : 1
/* Backup multi-byte pointer. Only use with "p" > "s" ! */
! #define MB_PTR_BACK(s, p) p -= has_mbyte ? ((*mb_head_off)(s, p - 1) + 1) : 1
/* get length of multi-byte char, not including composing chars */
! #define MB_CPTR2LEN(p) (enc_utf8 ? utf_ptr2len(p) : (*mb_ptr2len)(p))
! #define MB_COPY_CHAR(f, t) if (has_mbyte) mb_copy_char(&f, &t); else *t++ = *f++
! #define MB_CHARLEN(p) (has_mbyte ? mb_charlen(p) : (int)STRLEN(p))
! #define MB_CHAR2LEN(c) (has_mbyte ? mb_char2len(c) : 1)
! #define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p))
#ifdef FEAT_AUTOCHDIR
# define DO_AUTOCHDIR do { if (p_acd) do_autochdir(); } while (0)
*** ../vim-8.1.0809/src/option.h 2019-01-11 22:15:00.519123428 +0100
--- src/option.h 2019-01-24 17:04:23.493546503 +0100
***************
*** 69,81 ****
#endif
- #ifdef FEAT_MBYTE
/* Possible values for 'encoding' */
! # define ENC_UCSBOM "ucs-bom" /* check for BOM at start of file */
/* default value for 'encoding' */
! # define ENC_DFLT "latin1"
! #endif
/* end-of-line style */
#define EOL_UNKNOWN -1 /* not defined yet */
--- 69,79 ----
#endif
/* Possible values for 'encoding' */
! #define ENC_UCSBOM "ucs-bom" /* check for BOM at start of file */
/* default value for 'encoding' */
! #define ENC_DFLT "latin1"
/* end-of-line style */
#define EOL_UNKNOWN -1 /* not defined yet */
***************
*** 315,324 ****
#ifdef FEAT_AUTOCHDIR
EXTERN int p_acd; /* 'autochdir' */
#endif
- #ifdef FEAT_MBYTE
EXTERN char_u *p_ambw; /* 'ambiwidth' */
EXTERN char_u *p_emoji; /* 'emoji' */
- #endif
#if defined(FEAT_GUI) && defined(MACOS_X)
EXTERN int *p_antialias; /* 'antialias' */
#endif
--- 313,320 ----
***************
*** 395,415 ****
#ifdef FEAT_LINEBREAK
EXTERN char_u *p_breakat; /* 'breakat' */
#endif
- #ifdef FEAT_MBYTE
EXTERN char_u *p_cmp; /* 'casemap' */
EXTERN unsigned cmp_flags;
! # ifdef IN_OPTION_C
static char *(p_cmp_values[]) = {"internal", "keepascii", NULL};
- # endif
- # define CMP_INTERNAL 0x001
- # define CMP_KEEPASCII 0x002
#endif
! #ifdef FEAT_MBYTE
EXTERN char_u *p_enc; /* 'encoding' */
EXTERN int p_deco; /* 'delcombine' */
! # ifdef FEAT_EVAL
EXTERN char_u *p_ccv; /* 'charconvert' */
- # endif
#endif
#ifdef FEAT_CMDWIN
EXTERN char_u *p_cedit; /* 'cedit' */
--- 391,407 ----
#ifdef FEAT_LINEBREAK
EXTERN char_u *p_breakat; /* 'breakat' */
#endif
EXTERN char_u *p_cmp; /* 'casemap' */
EXTERN unsigned cmp_flags;
! #ifdef IN_OPTION_C
static char *(p_cmp_values[]) = {"internal", "keepascii", NULL};
#endif
! #define CMP_INTERNAL 0x001
! #define CMP_KEEPASCII 0x002
EXTERN char_u *p_enc; /* 'encoding' */
EXTERN int p_deco; /* 'delcombine' */
! #ifdef FEAT_EVAL
EXTERN char_u *p_ccv; /* 'charconvert' */
#endif
#ifdef FEAT_CMDWIN
EXTERN char_u *p_cedit; /* 'cedit' */
***************
*** 482,490 ****
EXTERN char_u *p_ei; /* 'eventignore' */
EXTERN int p_ek; /* 'esckeys' */
EXTERN int p_exrc; /* 'exrc' */
- #ifdef FEAT_MBYTE
EXTERN char_u *p_fencs; /* 'fileencodings' */
- #endif
EXTERN char_u *p_ffs; /* 'fileformats' */
EXTERN long p_fic; /* 'fileignorecase' */
#ifdef FEAT_FOLDING
--- 474,480 ----
***************
*** 519,528 ****
# ifdef FEAT_POSTSCRIPT
EXTERN char_u *p_penc; /* 'printencoding' */
EXTERN char_u *p_pexpr; /* 'printexpr' */
- # ifdef FEAT_MBYTE
EXTERN char_u *p_pmfn; /* 'printmbfont' */
EXTERN char_u *p_pmcs; /* 'printmbcharset' */
- # endif
# endif
EXTERN char_u *p_pfn; /* 'printfont' */
EXTERN char_u *p_popt; /* 'printoptions' */
--- 509,516 ----
***************
*** 534,542 ****
# ifdef FEAT_XFONTSET
EXTERN char_u *p_guifontset; /* 'guifontset' */
# endif
- # ifdef FEAT_MBYTE
EXTERN char_u *p_guifontwide; /* 'guifontwide' */
- # endif
EXTERN int p_guipty; /* 'guipty' */
#endif
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
--- 522,528 ----
***************
*** 586,599 ****
#define IM_OVER_THE_SPOT 1L
EXTERN long p_imst; /* 'imstyle' */
#endif
! #if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
EXTERN char_u *p_imaf; /* 'imactivatefunc' */
EXTERN char_u *p_imsf; /* 'imstatusfunc' */
#endif
- #ifdef FEAT_MBYTE
EXTERN int p_imcmdline; /* 'imcmdline' */
EXTERN int p_imdisable; /* 'imdisable' */
- #endif
EXTERN int p_is; /* 'incsearch' */
EXTERN int p_im; /* 'insertmode' */
EXTERN char_u *p_isf; /* 'isfname' */
--- 572,583 ----
#define IM_OVER_THE_SPOT 1L
EXTERN long p_imst; /* 'imstyle' */
#endif
! #if defined(FEAT_EVAL)
EXTERN char_u *p_imaf; /* 'imactivatefunc' */
EXTERN char_u *p_imsf; /* 'imstatusfunc' */
#endif
EXTERN int p_imcmdline; /* 'imcmdline' */
EXTERN int p_imdisable; /* 'imdisable' */
EXTERN int p_is; /* 'incsearch' */
EXTERN int p_im; /* 'insertmode' */
EXTERN char_u *p_isf; /* 'isfname' */
***************
*** 629,637 ****
EXTERN int p_macatsui; /* 'macatsui' */
#endif
EXTERN int p_magic; /* 'magic' */
- #ifdef FEAT_MBYTE
EXTERN char_u *p_menc; /* 'makeencoding' */
- #endif
#ifdef FEAT_QUICKFIX
EXTERN char_u *p_mef; /* 'makeef' */
EXTERN char_u *p_mp; /* 'makeprg' */
--- 613,619 ----
***************
*** 644,652 ****
EXTERN int p_cc_cols[256]; /* array for 'colorcolumn' columns */
#endif
EXTERN long p_mat; /* 'matchtime' */
- #ifdef FEAT_MBYTE
EXTERN long p_mco; /* 'maxcombine' */
- #endif
#ifdef FEAT_EVAL
EXTERN long p_mfd; /* 'maxfuncdepth' */
#endif
--- 626,632 ----
***************
*** 850,858 ****
#ifdef FEAT_ARABIC
EXTERN int p_tbidi; /* 'termbidi' */
#endif
- #ifdef FEAT_MBYTE
EXTERN char_u *p_tenc; /* 'termencoding' */
- #endif
#ifdef FEAT_TERMGUICOLORS
EXTERN int p_tgc; /* 'termguicolors' */
#endif
--- 830,836 ----
***************
*** 1001,1009 ****
#endif
, BV_BIN
, BV_BL
- #ifdef FEAT_MBYTE
, BV_BOMB
- #endif
, BV_CI
#ifdef FEAT_CINDENT
, BV_CIN
--- 979,985 ----
***************
*** 1068,1076 ****
, BV_LISP
, BV_LW
#endif
- #ifdef FEAT_MBYTE
, BV_MENC
- #endif
, BV_MA
, BV_ML
, BV_MOD
--- 1044,1050 ----
*** ../vim-8.1.0809/src/os_mac.h 2018-09-21 14:48:49.644214400 +0200
--- src/os_mac.h 2019-01-24 17:04:40.809420405 +0100
***************
*** 37,45 ****
# include <Memory.h>
# include <OSUtils.h>
# include <Files.h>
! # ifdef FEAT_MBYTE
! # include <Script.h>
! # endif
#endif
/*
--- 37,43 ----
# include <Memory.h>
# include <OSUtils.h>
# include <Files.h>
! # include <Script.h>
#endif
/*
*** ../vim-8.1.0809/src/os_win32.h 2018-09-21 14:48:49.644214400 +0200
--- src/os_win32.h 2019-01-24 17:04:56.853303732 +0100
***************
*** 213,226 ****
#endif
/* Enable common dialogs input unicode from IME if possible. */
! #ifdef FEAT_MBYTE
! # define pDispatchMessage DispatchMessageW
! # define pGetMessage GetMessageW
! # define pIsDialogMessage IsDialogMessageW
! # define pPeekMessage PeekMessageW
! #else
! # define pDispatchMessage DispatchMessage
! # define pGetMessage GetMessage
! # define pIsDialogMessage IsDialogMessage
! # define pPeekMessage PeekMessage
! #endif
--- 213,219 ----
#endif
/* Enable common dialogs input unicode from IME if possible. */
! #define pDispatchMessage DispatchMessageW
! #define pGetMessage GetMessageW
! #define pIsDialogMessage IsDialogMessageW
! #define pPeekMessage PeekMessageW
*** ../vim-8.1.0809/src/proto.h 2019-01-22 21:45:36.553678901 +0100
--- src/proto.h 2019-01-24 17:05:20.409132700 +0100
***************
*** 168,177 ****
void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void *, const void *));
#endif
# include "move.pro"
! # if defined(FEAT_MBYTE) || defined(FEAT_XIM) || defined(FEAT_KEYMAP) \
! || defined(FEAT_POSTSCRIPT)
! # include "mbyte.pro"
! # endif
# include "normal.pro"
# include "ops.pro"
# include "option.pro"
--- 168,174 ----
void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void *, const void *));
#endif
# include "move.pro"
! # include "mbyte.pro"
# include "normal.pro"
# include "ops.pro"
# include "option.pro"
*** ../vim-8.1.0809/src/spell.h 2018-02-10 13:55:21.000000000 +0100
--- src/spell.h 2019-01-24 17:06:16.664725481 +0100
***************
*** 44,54 ****
typedef long idx_T;
#endif
- #ifdef FEAT_MBYTE
typedef int salfirst_T;
- #else
- typedef short salfirst_T;
- #endif
/*
* Structure used to store words and other info for one language, loaded from
--- 44,50 ----
***************
*** 132,143 ****
load */
int sl_has_map; /* TRUE if there is a MAP line */
- #ifdef FEAT_MBYTE
hashtab_T sl_map_hash; /* MAP for multi-byte chars */
int sl_map_array[256]; /* MAP for first 256 chars */
- #else
- char_u sl_map_array[256]; /* MAP for first 256 chars */
- #endif
hashtab_T sl_sounddone; /* table with soundfolded words that have
handled, see add_sound_suggest() */
};
--- 128,135 ----
***************
*** 213,223 ****
char_u *sm_oneof; /* letters from () or NULL */
char_u *sm_rules; /* rules like ^, $, priority */
char_u *sm_to; /* replacement. */
- #ifdef FEAT_MBYTE
int *sm_lead_w; /* wide character copy of "sm_lead" */
int *sm_oneof_w; /* wide character copy of "sm_oneof" */
int *sm_to_w; /* wide character copy of "sm_to" */
- #endif
} salitem_T;
/* Values for SP_*ERROR are negative, positive values are used by
--- 205,213 ----
***************
*** 260,300 ****
* differ from what the .spl file uses.
* These must not be called with negative number!
*/
! #ifndef FEAT_MBYTE
! /* Non-multi-byte implementation. */
! # define SPELL_TOFOLD(c) ((c) < 256 ? (int)spelltab.st_fold[c] : (c))
! # define SPELL_TOUPPER(c) ((c) < 256 ? (int)spelltab.st_upper[c] : (c))
! # define SPELL_ISUPPER(c) ((c) < 256 ? spelltab.st_isu[c] : FALSE)
! #else
! # if defined(HAVE_WCHAR_H)
! # include <wchar.h> /* for towupper() and towlower() */
! # endif
/* Multi-byte implementation. For Unicode we can call utf_*(), but don't do
* that for ASCII, because we don't want to use 'casemap' here. Otherwise use
* the "w" library function for characters above 255 if available. */
! # ifdef HAVE_TOWLOWER
! # define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
: (c) < 256 ? (int)spelltab.st_fold[c] : (int)towlower(c))
! # else
! # define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
: (c) < 256 ? (int)spelltab.st_fold[c] : (c))
! # endif
! # ifdef HAVE_TOWUPPER
! # define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
: (c) < 256 ? (int)spelltab.st_upper[c] : (int)towupper(c))
! # else
! # define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
: (c) < 256 ? (int)spelltab.st_upper[c] : (c))
! # endif
! # ifdef HAVE_ISWUPPER
! # define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
: (c) < 256 ? spelltab.st_isu[c] : iswupper(c))
! # else
! # define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
: (c) < 256 ? spelltab.st_isu[c] : (FALSE))
- # endif
#endif
#ifdef FEAT_SPELL
--- 250,283 ----
* differ from what the .spl file uses.
* These must not be called with negative number!
*/
! #if defined(HAVE_WCHAR_H)
! # include <wchar.h> /* for towupper() and towlower() */
! #endif
/* Multi-byte implementation. For Unicode we can call utf_*(), but don't do
* that for ASCII, because we don't want to use 'casemap' here. Otherwise use
* the "w" library function for characters above 255 if available. */
! #ifdef HAVE_TOWLOWER
! # define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
: (c) < 256 ? (int)spelltab.st_fold[c] : (int)towlower(c))
! #else
! # define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
: (c) < 256 ? (int)spelltab.st_fold[c] : (c))
! #endif
! #ifdef HAVE_TOWUPPER
! # define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
: (c) < 256 ? (int)spelltab.st_upper[c] : (int)towupper(c))
! #else
! # define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
: (c) < 256 ? (int)spelltab.st_upper[c] : (c))
! #endif
! #ifdef HAVE_ISWUPPER
! # define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
: (c) < 256 ? spelltab.st_isu[c] : iswupper(c))
! #else
! # define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
: (c) < 256 ? spelltab.st_isu[c] : (FALSE))
#endif
#ifdef FEAT_SPELL
*** ../vim-8.1.0809/src/structs.h 2019-01-18 22:48:30.900796633 +0100
--- src/structs.h 2019-01-24 17:06:44.200526742 +0100
***************
*** 1103,1111 ****
{
char_u *vir_line; /* text of the current line */
FILE *vir_fd; /* file descriptor */
- #ifdef FEAT_MBYTE
vimconv_T vir_conv; /* encoding conversion */
- #endif
int vir_version; /* viminfo version detected or -1 */
garray_T vir_barlines; /* lines starting with | */
} vir_T;
--- 1103,1109 ----
***************
*** 2013,2028 ****
/* for spell checking */
garray_T b_langp; /* list of pointers to slang_T, see spell.c */
char_u b_spell_ismw[256];/* flags: is midword char */
- # ifdef FEAT_MBYTE
char_u *b_spell_ismw_mb; /* multi-byte midword chars */
- # endif
char_u *b_p_spc; /* 'spellcapcheck' */
regprog_T *b_cap_prog; /* program for 'spellcapcheck' */
char_u *b_p_spf; /* 'spellfile' */
char_u *b_p_spl; /* 'spelllang' */
- # ifdef FEAT_MBYTE
int b_cjk; /* all CJK letters as OK */
- # endif
#endif
#if !defined(FEAT_SYN_HL) && !defined(FEAT_SPELL)
int dummy;
--- 2011,2022 ----
***************
*** 2233,2241 ****
unsigned b_bkc_flags; /* flags for 'backupcopy' */
int b_p_ci; /* 'copyindent' */
int b_p_bin; /* 'binary' */
- #ifdef FEAT_MBYTE
int b_p_bomb; /* 'bomb' */
- #endif
char_u *b_p_bh; /* 'bufhidden' */
char_u *b_p_bt; /* 'buftype' */
#ifdef FEAT_QUICKFIX
--- 2227,2233 ----
***************
*** 2270,2278 ****
int b_p_et; /* 'expandtab' */
int b_p_et_nobin; /* b_p_et saved for binary mode */
int b_p_et_nopaste; /* b_p_et saved for paste mode */
- #ifdef FEAT_MBYTE
char_u *b_p_fenc; /* 'fileencoding' */
- #endif
char_u *b_p_ff; /* 'fileformat' */
char_u *b_p_ft; /* 'filetype' */
char_u *b_p_fo; /* 'formatoptions' */
--- 2262,2268 ----
***************
*** 2304,2312 ****
#ifdef FEAT_LISP
int b_p_lisp; /* 'lisp' */
#endif
- #ifdef FEAT_MBYTE
char_u *b_p_menc; /* 'makeencoding' */
- #endif
char_u *b_p_mps; /* 'matchpairs' */
int b_p_ml; /* 'modeline' */
int b_p_ml_nobin; /* b_p_ml saved for binary mode */
--- 2294,2300 ----
***************
*** 2425,2435 ****
int b_start_eol; /* last line had eol when it was read */
int b_start_ffc; /* first char of 'ff' when edit started */
- #ifdef FEAT_MBYTE
char_u *b_start_fenc; /* 'fileencoding' when edit started or NULL */
int b_bad_char; /* "++bad=" argument when edit started or 0 */
int b_start_bomb; /* 'bomb' when it was read */
- #endif
#ifdef FEAT_EVAL
dictitem_T b_bufvar; /* variable for "b:" Dictionary */
--- 2413,2421 ----
***************
*** 3107,3116 ****
int prechar; /* prefix character (optional, always 'g') */
int cmdchar; /* command character */
int nchar; /* next command character (optional) */
- #ifdef FEAT_MBYTE
int ncharC1; /* first composing character (optional) */
int ncharC2; /* second composing character (optional) */
- #endif
int extra_char; /* yet another character (optional) */
long opcount; /* count before an operator */
long count0; /* count before command, default 0 */
--- 3093,3100 ----
*** ../vim-8.1.0809/src/vim.h 2019-01-19 17:43:03.433449041 +0100
--- src/vim.h 2019-01-24 17:09:28.719346216 +0100
***************
*** 210,216 ****
#endif
/* The Mac conversion stuff doesn't work under X11. */
! #if defined(FEAT_MBYTE) && defined(MACOS_X_DARWIN)
# define MACOS_CONVERT
#endif
--- 210,216 ----
#endif
/* The Mac conversion stuff doesn't work under X11. */
! #if defined(MACOS_X_DARWIN)
# define MACOS_CONVERT
#endif
***************
*** 431,446 ****
* bits. u8char_T is only used for displaying, it could be 16 bits to save
* memory.
*/
! #ifdef FEAT_MBYTE
! # ifdef UNICODE16
typedef unsigned short u8char_T; /* short should be 16 bits */
! # else
! # if VIM_SIZEOF_INT >= 4
! typedef unsigned int u8char_T; /* int is 32 bits */
! # else
! typedef unsigned long u8char_T; /* long should be 32 bits or more */
! # endif
! # endif
#endif
#ifndef UNIX /* For Unix this is included in os_unix.h */
--- 431,440 ----
* bits. u8char_T is only used for displaying, it could be 16 bits to save
* memory.
*/
! #ifdef UNICODE16
typedef unsigned short u8char_T; /* short should be 16 bits */
! #else
! typedef unsigned int u8char_T; /* int is 32 bits or more */
#endif
#ifndef UNIX /* For Unix this is included in os_unix.h */
***************
*** 1516,1529 ****
#define DIALOG_MSG_SIZE 1000 /* buffer size for dialog_msg() */
! #ifdef FEAT_MBYTE
! # define MSG_BUF_LEN 480 /* length of buffer for small messages */
! # define MSG_BUF_CLEN (MSG_BUF_LEN / 6) /* cell length (worst case: utf-8
takes 6 bytes for one cell) */
- #else
- # define MSG_BUF_LEN 80 /* length of buffer for small messages */
- # define MSG_BUF_CLEN MSG_BUF_LEN /* cell length */
- #endif
#define FOLD_TEXT_LEN 51 /* buffer size for get_foldtext() */
--- 1510,1518 ----
#define DIALOG_MSG_SIZE 1000 /* buffer size for dialog_msg() */
! #define MSG_BUF_LEN 480 /* length of buffer for small messages */
! #define MSG_BUF_CLEN (MSG_BUF_LEN / 6) /* cell length (worst case: utf-8
takes 6 bytes for one cell) */
#define FOLD_TEXT_LEN 51 /* buffer size for get_foldtext() */
***************
*** 1609,1615 ****
# endif
#endif
- #ifdef FEAT_MBYTE
/* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
* encoding because mb_stricmp() takes care of all ascii and non-ascii
* encodings, including characters with umlauts in latin1, etc., while
--- 1598,1603 ----
***************
*** 1618,1627 ****
# define MB_STRICMP(d, s) mb_strnicmp((char_u *)(d), (char_u *)(s), (int)MAXCOL)
# define MB_STRNICMP(d, s, n) mb_strnicmp((char_u *)(d), (char_u *)(s), (int)(n))
- #else
- # define MB_STRICMP(d, s) STRICMP((d), (s))
- # define MB_STRNICMP(d, s, n) STRNICMP((d), (s), (n))
- #endif
#define STRCAT(d, s) strcat((char *)(d), (char *)(s))
#define STRNCAT(d, s, n) strncat((char *)(d), (char *)(s), (size_t)(n))
--- 1606,1611 ----
***************
*** 1766,1781 ****
# endif
#endif
! #ifdef FEAT_MBYTE
! # define MAX_MCO 6 /* maximum value for 'maxcombine' */
/* Maximum number of bytes in a multi-byte character. It can be one 32-bit
* character of up to 6 bytes, or one 16-bit character of up to three bytes
* plus six following composing characters of three bytes each. */
! # define MB_MAXBYTES 21
! #else
! # define MB_MAXBYTES 1
! #endif
#if (defined(FEAT_PROFILE) || defined(FEAT_RELTIME)) && !defined(PROTO)
# ifdef WIN3264
--- 1750,1761 ----
# endif
#endif
! #define MAX_MCO 6 /* maximum value for 'maxcombine' */
/* Maximum number of bytes in a multi-byte character. It can be one 32-bit
* character of up to 6 bytes, or one 16-bit character of up to three bytes
* plus six following composing characters of three bytes each. */
! #define MB_MAXBYTES 21
#if (defined(FEAT_PROFILE) || defined(FEAT_RELTIME)) && !defined(PROTO)
# ifdef WIN3264
***************
*** 2128,2134 ****
# define USE_MCH_ERRMSG
#endif
! # if defined(FEAT_MBYTE) && defined(FEAT_EVAL) \
&& (!defined(FEAT_GUI_W32) \
|| !(defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
&& !(defined(FEAT_GUI_MAC) && defined(MACOS_CONVERT))
--- 2108,2114 ----
# define USE_MCH_ERRMSG
#endif
! # if defined(FEAT_EVAL) \
&& (!defined(FEAT_GUI_W32) \
|| !(defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
&& !(defined(FEAT_GUI_MAC) && defined(MACOS_CONVERT))
***************
*** 2139,2158 ****
# define IME_WITHOUT_XIM
#endif
! #if defined(FEAT_MBYTE) && (defined(FEAT_XIM) \
|| defined(IME_WITHOUT_XIM) \
|| (defined(FEAT_GUI_W32) \
&& (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
! || defined(FEAT_GUI_MAC))
/* im_set_active() is available */
# define HAVE_INPUT_METHOD
#endif
- #ifndef FEAT_MBYTE
- # define after_pathsep(b, p) vim_ispathsep(*((p) - 1))
- # define transchar_byte(c) transchar(c)
- #endif
-
#ifndef FEAT_LINEBREAK
/* Without the 'numberwidth' option line numbers are always 7 chars. */
# define number_width(x) 7
--- 2119,2133 ----
# define IME_WITHOUT_XIM
#endif
! #if defined(FEAT_XIM) \
|| defined(IME_WITHOUT_XIM) \
|| (defined(FEAT_GUI_W32) \
&& (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
! || defined(FEAT_GUI_MAC)
/* im_set_active() is available */
# define HAVE_INPUT_METHOD
#endif
#ifndef FEAT_LINEBREAK
/* Without the 'numberwidth' option line numbers are always 7 chars. */
# define number_width(x) 7
***************
*** 2160,2166 ****
/* This must come after including proto.h.
* For VMS this is defined in macros.h. */
! #if !(defined(FEAT_MBYTE) && defined(WIN3264)) && !defined(VMS)
# define mch_open(n, m, p) open((n), (m), (p))
# define mch_fopen(n, p) fopen((n), (p))
#endif
--- 2135,2141 ----
/* This must come after including proto.h.
* For VMS this is defined in macros.h. */
! #if !defined(WIN3264) && !defined(VMS)
# define mch_open(n, m, p) open((n), (m), (p))
# define mch_fopen(n, p) fopen((n), (p))
#endif
***************
*** 2236,2292 ****
# define vim_realloc(ptr, size) realloc((ptr), (size))
#endif
- #ifdef FEAT_MBYTE
/*
* Return byte length of character that starts with byte "b".
* Returns 1 for a single-byte character.
* MB_BYTE2LEN_CHECK() can be used to count a special key as one byte.
* Don't call MB_BYTE2LEN(b) with b < 0 or b > 255!
*/
! # define MB_BYTE2LEN(b) mb_bytelen_tab[b]
! # define MB_BYTE2LEN_CHECK(b) (((b) < 0 || (b) > 255) ? 1 : mb_bytelen_tab[b])
! #endif
- #if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
/* properties used in enc_canon_table[] (first three mutually exclusive) */
! # define ENC_8BIT 0x01
! # define ENC_DBCS 0x02
! # define ENC_UNICODE 0x04
!
! # define ENC_ENDIAN_B 0x10 /* Unicode: Big endian */
! # define ENC_ENDIAN_L 0x20 /* Unicode: Little endian */
!
! # define ENC_2BYTE 0x40 /* Unicode: UCS-2 */
! # define ENC_4BYTE 0x80 /* Unicode: UCS-4 */
! # define ENC_2WORD 0x100 /* Unicode: UTF-16 */
!
! # define ENC_LATIN1 0x200 /* Latin1 */
! # define ENC_LATIN9 0x400 /* Latin9 */
! # define ENC_MACROMAN 0x800 /* Mac Roman (not Macro Man! :-) */
! #endif
!
! #ifdef FEAT_MBYTE
! # ifdef USE_ICONV
! # ifndef EILSEQ
! # define EILSEQ 123
! # endif
! # ifdef DYNAMIC_ICONV
/* On Win32 iconv.dll is dynamically loaded. */
! # define ICONV_ERRNO (*iconv_errno())
! # define ICONV_E2BIG 7
! # define ICONV_EINVAL 22
! # define ICONV_EILSEQ 42
! # else
! # define ICONV_ERRNO errno
! # define ICONV_E2BIG E2BIG
! # define ICONV_EINVAL EINVAL
! # define ICONV_EILSEQ EILSEQ
! # endif
# endif
-
#endif
-
#define SIGN_BYTE 1 /* byte value used where sign is displayed;
attribute value is sign type */
--- 2211,2259 ----
# define vim_realloc(ptr, size) realloc((ptr), (size))
#endif
/*
* Return byte length of character that starts with byte "b".
* Returns 1 for a single-byte character.
* MB_BYTE2LEN_CHECK() can be used to count a special key as one byte.
* Don't call MB_BYTE2LEN(b) with b < 0 or b > 255!
*/
! #define MB_BYTE2LEN(b) mb_bytelen_tab[b]
! #define MB_BYTE2LEN_CHECK(b) (((b) < 0 || (b) > 255) ? 1 : mb_bytelen_tab[b])
/* properties used in enc_canon_table[] (first three mutually exclusive) */
! #define ENC_8BIT 0x01
! #define ENC_DBCS 0x02
! #define ENC_UNICODE 0x04
!
! #define ENC_ENDIAN_B 0x10 /* Unicode: Big endian */
! #define ENC_ENDIAN_L 0x20 /* Unicode: Little endian */
!
! #define ENC_2BYTE 0x40 /* Unicode: UCS-2 */
! #define ENC_4BYTE 0x80 /* Unicode: UCS-4 */
! #define ENC_2WORD 0x100 /* Unicode: UTF-16 */
!
! #define ENC_LATIN1 0x200 /* Latin1 */
! #define ENC_LATIN9 0x400 /* Latin9 */
! #define ENC_MACROMAN 0x800 /* Mac Roman (not Macro Man! :-) */
!
! #ifdef USE_ICONV
! # ifndef EILSEQ
! # define EILSEQ 123
! # endif
! # ifdef DYNAMIC_ICONV
/* On Win32 iconv.dll is dynamically loaded. */
! # define ICONV_ERRNO (*iconv_errno())
! # define ICONV_E2BIG 7
! # define ICONV_EINVAL 22
! # define ICONV_EILSEQ 42
! # else
! # define ICONV_ERRNO errno
! # define ICONV_E2BIG E2BIG
! # define ICONV_EINVAL EINVAL
! # define ICONV_EILSEQ EILSEQ
# endif
#endif
#define SIGN_BYTE 1 /* byte value used where sign is displayed;
attribute value is sign type */
*** ../vim-8.1.0809/src/version.c 2019-01-24 16:38:58.280712420 +0100
--- src/version.c 2019-01-24 17:17:24.875973757 +0100
***************
*** 793,794 ****
--- 789,792 ----
{ /* Add new patch number below this line */
+ /**/
+ 810,
/**/
--
FATHER: Make sure the Prince doesn't leave this room until I come and
get him.
FIRST GUARD: Not ... to leave the room ... even if you come and get him.
FATHER: No. Until I come and get him.
SECOND GUARD: Hic.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|