all repos — h3rald @ 5ce44db426a8f765bb63a8201daaf6191a6d8848

The sources of https://h3rald.com

assets/nimline/nimline.html

 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
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--  This file is generated by Nim. -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>

<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>

<!-- CSS -->
<title>Module nimline</title>
<style type="text/css" >
/*
Stylesheet for use with Docutils/rst2html.

See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.

Modified from Chad Skeeters' rst2html-style
https://bitbucket.org/cskeeters/rst2html-style/

Modified by Boyd Greenfield
*/
/* SCSS variables */
/* Text weights */
/* Body colors */
/* Text colors */
/* Link colors */
/* Syntax highlighting colors */
/* Pct changes */
/* Mixins */
/* Body/layout */
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%; }

/* Where we want fancier font if available */
h1, h2, h3, h4, h5, h6, p.module-desc, table.docinfo + blockquote p, table.docinfo blockquote p, h1 + blockquote p {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif !important; }

h1.title {
  font-weight: 900; }

body {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: #444;
  letter-spacing: 0.15px;
  background-color: rgba(252, 248, 244, 0.45); }

/* Skeleton grid */
.container {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box; }

.column,
.columns {
  width: 100%;
  float: left;
  box-sizing: border-box; }

/* For devices larger than 400px */
@media (min-width: 400px) {
  .container {
    width: 100%;
    padding: 0; } }
/* For devices larger than 650px */
@media (min-width: 650px) {
  .container {
    width: 100%; }

  .column,
  .columns {
    margin-left: 4%; }

  .column:first-child,
  .columns:first-child {
    margin-left: 0; }

  .one.column,
  .one.columns {
    width: 4.66666666667%; }

  .two.columns {
    width: 13.3333333333%; }

  .three.columns {
    width: 22%; }

  .four.columns {
    width: 30.6666666667%; }

  .five.columns {
    width: 39.3333333333%; }

  .six.columns {
    width: 48%; }

  .seven.columns {
    width: 56.6666666667%; }

  .eight.columns {
    width: 65.3333333333%; }

  .nine.columns {
    width: 74.0%; }

  .ten.columns {
    width: 82.6666666667%; }

  .eleven.columns {
    width: 91.3333333333%; }

  .twelve.columns {
    width: 100%;
    margin-left: 0; }

  .one-third.column {
    width: 30.6666666667%; }

  .two-thirds.column {
    width: 65.3333333333%; } }
/* Customer Overrides */
.footer {
  text-align: center;
  color: #969696;
  padding-top: 10%; }

p.module-desc {
  font-size: 1.1em;
  color: #666666; }

a.link-seesrc {
  color: #aec7d2;
  font-style: italic; }

a.link-seesrc:hover {
  color: #6c9aae; }

#toc-list {
  word-wrap: break-word; }

ul.simple-toc {
  list-style: none; }

ul.simple-toc a.reference-toplevel {
  font-weight: bold;
  color: #0077b3; }

ul.simple-toc-section {
  list-style-type: circle;
  color: #6c9aae; }

ul.simple-toc-section a.reference {
  color: #0077b3; }

cite {
  font-style: italic !important; }

dt > pre {
  border-color: rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.3);
  margin: 15px 0px 5px; }

dd > pre {
  border-color: rgba(0, 0, 0, 0.1);
  background-color: whitesmoke;
  margin-top: 8px; }

.item > dd {
  margin-left: 10px;
  margin-bottom: 30px; }

/* Nim line-numbered tables */
.line-nums-table {
  width: 100%;
  table-layout: fixed; }

/* Nim search input */
div#searchInput {
  margin-bottom: 8px;
}
div#searchInput input#searchInput {
  width: 10em;
}
div.search-groupby {
  margin-bottom: 8px;
}

table.line-nums-table {
  border-radius: 4px;
  border: 1px solid #cccccc;
  background-color: whitesmoke;
  border-collapse: separate;
  margin-top: 15px;
  margin-bottom: 25px; }

.line-nums-table tbody {
  border: none; }

.line-nums-table td pre {
  border: none;
  background-color: transparent; }

.line-nums-table td.blob-line-nums {
  width: 28px; }

.line-nums-table td.blob-line-nums pre {
  color: #b0b0b0;
  -webkit-filter: opacity(75%);
  text-align: right;
  border-color: transparent;
  background-color: transparent;
  padding-left: 0px;
  margin-left: 0px;
  padding-right: 0px;
  margin-right: 0px; }

/* Docgen styles */
/* Links */
a {
  color: #0077b3;
  text-decoration: none; }

a:hover,
a:focus {
  color: #00334d;
  text-decoration: underline; }

a:visited {
  color: #00334d; }

a:focus {
  outline: thin dotted #2d2d2d;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px; }

a:hover,
a:active {
  outline: 0; }

sub,
sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline; }

sup {
  top: -0.5em; }

sub {
  bottom: -0.25em; }

img {
  width: auto;
  height: auto;
  max-width: 100%;
  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic; }

@media print {
  * {
    color: black !important;
    text-shadow: none !important;
    background: transparent !important;
    box-shadow: none !important; }

  a,
  a:visited {
    text-decoration: underline; }

  a[href]:after {
    content: " (" attr(href) ")"; }

  abbr[title]:after {
    content: " (" attr(title) ")"; }

  .ir a:after,
  a[href^="javascript:"]:after,
  a[href^="#"]:after {
    content: ""; }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid; }

  thead {
    display: table-header-group; }

  tr,
  img {
    page-break-inside: avoid; }

  img {
    max-width: 100% !important; }

  @page {
    margin: 0.5cm; }

  h1 {
    page-break-before: always; }

  h1.title {
    page-break-before: avoid; }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3; }

  h2,
  h3 {
    page-break-after: avoid; } }
.img-rounded {
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px; }

.img-polaroid {
  padding: 4px;
  background-color: rgba(252, 248, 244, 0.75);
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }

p {
  margin: 0 0 8px; }

small {
  font-size: 85%; }

strong {
  font-weight: 600; }

em {
  font-style: italic; }

cite {
  font-style: normal; }

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
  font-weight: 600;
  line-height: 20px;
  color: inherit;
  text-rendering: optimizelegibility; }

h1 {
  font-size: 2em;
  font-weight: 400;
  padding-bottom: .15em;
  border-bottom: 1px solid #aaaaaa;
  margin-top: 1.0em;
  line-height: 1.2em; }

h1.title {
  padding-bottom: 1em;
  border-bottom: 0px;
  font-size: 2.75em; }

h2 {
  font-size: 1.5em;
  margin-top: 1.5em; }

h3 {
  font-size: 1.3em;
  font-style: italic;
  margin-top: 0.75em; }

h4 {
  font-size: 1.3em;
  margin-top: 0.5em; }

h5 {
  font-size: 1.2em;
  margin-top: 0.25em; }

h6 {
  font-size: 1.1em; }

ul,
ol {
  padding: 0;
  margin: 0 0 0px 15px; }

ul ul,
ul ol,
ol ol,
ol ul {
  margin-bottom: 0; }

li {
  line-height: 20px; }

dl {
  margin-bottom: 20px; }

dt,
dd {
  line-height: 20px; }

dt {
  font-weight: bold; }

dd {
  margin-left: 10px;
  margin-bottom: 26px; }

hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #ffffff; }

abbr[title],
abbr[data-original-title] {
  cursor: help;
  border-bottom: 1px dotted #999999; }

abbr.initialism {
  font-size: 90%;
  text-transform: uppercase; }

blockquote {
  padding: 0 0 0 15px;
  margin: 0 0 20px;
  border-left: 5px solid #EFEBE0; }

table.docinfo + blockquote, table.docinfo blockquote, h1 + blockquote {
  border-left: 5px solid #c9c9c9;
}

table.docinfo + blockquote p, table.docinfo blockquote p, h1 + blockquote p {
  margin-bottom: 0;
  font-size: 15px;
  font-weight: 200;
  line-height: 1.5;
  font-style: italic; }

q:before,
q:after,
blockquote:before,
blockquote:after {
  content: ""; }

address {
  display: block;
  margin-bottom: 20px;
  font-style: normal;
  line-height: 20px; }

code,
pre {
  font-family: "Source Code Pro", Monaco, Menlo, Consolas, "Courier New", monospace;
  padding: 0 3px 2px;
  font-weight: 500;
  font-size: 12px;
  color: #444444;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px; }

.pre {
  font-family: "Source Code Pro", Monaco, Menlo, Consolas, "Courier New", monospace;
  font-weight: 600;
  /*color: #504da6;*/
}

code {
  padding: 2px 4px;
  color: #444444;
  white-space: nowrap;
  background-color: white;
  border: 1px solid #777777; }

pre {
  display: inline-block;
  box-sizing: border-box;
  min-width: calc(100% - 19.5px);
  padding: 9.5px;
  margin: 0.25em 10px 10px 10px;
  font-size: 15px;
  line-height: 20px;
  white-space: pre !important;
  overflow-y: hidden;
  overflow-x: visible;
  background-color: rgba(0, 0, 0, 0.01);
  border: 1px solid #cccccc;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px; }

pre.prettyprint {
  margin-bottom: 20px; }

pre code {
  padding: 0;
  color: inherit;
  white-space: pre;
  overflow-x: visible;
  background-color: transparent;
  border: 0; }

.pre-scrollable {
  max-height: 340px;
  overflow-y: scroll; }

table {
  max-width: 100%;
  background-color: transparent;
  border-collapse: collapse;
  border-spacing: 0; }

table th, table td {
  padding: 0px 8px 0px;
}

.table {
  width: 100%;
  margin-bottom: 20px; }

.table th,
.table td {
  padding: 8px;
  line-height: 20px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid #444444; }

.table th {
  font-weight: bold; }

.table thead th {
  vertical-align: bottom; }

.table caption + thead tr:first-child th,
.table caption + thead tr:first-child td,
.table colgroup + thead tr:first-child th,
.table colgroup + thead tr:first-child td,
.table thead:first-child tr:first-child th,
.table thead:first-child tr:first-child td {
  border-top: 0; }

.table tbody + tbody {
  border-top: 2px solid #444444; }

.table .table {
  background-color: rgba(252, 248, 244, 0.75); }

.table-condensed th,
.table-condensed td {
  padding: 4px 5px; }

.table-bordered {
  border: 1px solid #444444;
  border-collapse: separate;
  *border-collapse: collapse;
  border-left: 0;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px; }

.table-bordered th,
.table-bordered td {
  border-left: 1px solid #444444; }

.table-bordered caption + thead tr:first-child th,
.table-bordered caption + tbody tr:first-child th,
.table-bordered caption + tbody tr:first-child td,
.table-bordered colgroup + thead tr:first-child th,
.table-bordered colgroup + tbody tr:first-child th,
.table-bordered colgroup + tbody tr:first-child td,
.table-bordered thead:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child td {
  border-top: 0; }

.table-bordered thead:first-child tr:first-child > th:first-child,
.table-bordered tbody:first-child tr:first-child > td:first-child,
.table-bordered tbody:first-child tr:first-child > th:first-child {
  -webkit-border-top-left-radius: 4px;
  border-top-left-radius: 4px;
  -moz-border-radius-topleft: 4px; }

.table-bordered thead:first-child tr:first-child > th:last-child,
.table-bordered tbody:first-child tr:first-child > td:last-child,
.table-bordered tbody:first-child tr:first-child > th:last-child {
  -webkit-border-top-right-radius: 4px;
  border-top-right-radius: 4px;
  -moz-border-radius-topright: 4px; }

.table-bordered thead:last-child tr:last-child > th:first-child,
.table-bordered tbody:last-child tr:last-child > td:first-child,
.table-bordered tbody:last-child tr:last-child > th:first-child,
.table-bordered tfoot:last-child tr:last-child > td:first-child,
.table-bordered tfoot:last-child tr:last-child > th:first-child {
  -webkit-border-bottom-left-radius: 4px;
  border-bottom-left-radius: 4px;
  -moz-border-radius-bottomleft: 4px; }

.table-bordered thead:last-child tr:last-child > th:last-child,
.table-bordered tbody:last-child tr:last-child > td:last-child,
.table-bordered tbody:last-child tr:last-child > th:last-child,
.table-bordered tfoot:last-child tr:last-child > td:last-child,
.table-bordered tfoot:last-child tr:last-child > th:last-child {
  -webkit-border-bottom-right-radius: 4px;
  border-bottom-right-radius: 4px;
  -moz-border-radius-bottomright: 4px; }

.table-bordered tfoot + tbody:last-child tr:last-child td:first-child {
  -webkit-border-bottom-left-radius: 0;
  border-bottom-left-radius: 0;
  -moz-border-radius-bottomleft: 0; }

.table-bordered tfoot + tbody:last-child tr:last-child td:last-child {
  -webkit-border-bottom-right-radius: 0;
  border-bottom-right-radius: 0;
  -moz-border-radius-bottomright: 0; }

.table-bordered caption + thead tr:first-child th:first-child,
.table-bordered caption + tbody tr:first-child td:first-child,
.table-bordered colgroup + thead tr:first-child th:first-child,
.table-bordered colgroup + tbody tr:first-child td:first-child {
  -webkit-border-top-left-radius: 4px;
  border-top-left-radius: 4px;
  -moz-border-radius-topleft: 4px; }

.table-bordered caption + thead tr:first-child th:last-child,
.table-bordered caption + tbody tr:first-child td:last-child,
.table-bordered colgroup + thead tr:first-child th:last-child,
.table-bordered colgroup + tbody tr:first-child td:last-child {
  -webkit-border-top-right-radius: 4px;
  border-top-right-radius: 4px;
  -moz-border-radius-topright: 4px; }

table.docutils th {
  background-color: #e8e8e8; }

table.docutils tr:hover {
  background-color: whitesmoke; }

.table-striped tbody > tr:nth-child(odd) > td,
.table-striped tbody > tr:nth-child(odd) > th {
  background-color: rgba(252, 248, 244, 0.75); }

.table-hover tbody tr:hover > td,
.table-hover tbody tr:hover > th {
  background-color: rgba(241, 222, 204, 0.75); }

table td[class*="span"],
table th[class*="span"],
.row-fluid table td[class*="span"],
.row-fluid table th[class*="span"] {
  display: table-cell;
  float: none;
  margin-left: 0; }

.hero-unit {
  padding: 60px;
  margin-bottom: 30px;
  font-size: 18px;
  font-weight: 200;
  line-height: 30px;
  color: inherit;
  background-color: rgba(230, 197, 164, 0.75);
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px; }

.hero-unit h1 {
  margin-bottom: 0;
  font-size: 60px;
  line-height: 1;
  letter-spacing: -1px;
  color: inherit; }

.hero-unit li {
  line-height: 30px; }

/* rst2html default used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
  border: 0; }

table.borderless td, table.borderless th {
  /* Override padding for "table.docutils td" with "! important".
     The right padding separates the table cells. */
  padding: 0 0.5em 0 0 !important; }

.first {
  /* Override more specific margin styles with "! important". */
  margin-top: 0 !important; }

.last, .with-subtitle {
  margin-bottom: 0 !important; }

.hidden {
  display: none; }

a.toc-backref {
  text-decoration: none;
  color: #444444; }

blockquote.epigraph {
  margin: 2em 5em; }

dl.docutils dd {
  margin-bottom: 0.5em; }

object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
  overflow: hidden; }

/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
  font-weight: bold }
*/
div.abstract {
  margin: 2em 5em; }

div.abstract p.topic-title {
  font-weight: bold;
  text-align: center; }

div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
  margin: 2em;
  border: medium outset;
  padding: 1em; }

div.note, div.warning {
  margin: 1.5em 0px;
  border: none; }

div.note p.admonition-title,
div.warning p.admonition-title {
  display: none; }

/* Clearfix
 * http://css-tricks.com/snippets/css/clear-fix/
 */
div.note:after,
div.warning:after {
  content: "";
  display: table;
  clear: both; }

div.note p:before,
div.warning p:before {
  display: block;
  float: left;
  font-size: 4em;
  line-height: 1em;
  margin-right: 20px;
  margin-left: 0em;
  margin-top: -10px;
  content: '\0270D';
  /*handwriting*/ }

div.warning p:before {
  content: '\026A0';
  /*warning*/ }

div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
  font-weight: bold;
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; }

div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
  color: #b30000;
  font-weight: bold;
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; }

/* Uncomment (and remove this text!) to get reduced vertical space in
   compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
  margin-bottom: 0.5em }

div.compound .compound-last, div.compound .compound-middle {
  margin-top: 0.5em }
*/
div.dedication {
  margin: 2em 5em;
  text-align: center;
  font-style: italic; }

div.dedication p.topic-title {
  font-weight: bold;
  font-style: normal; }

div.figure {
  margin-left: 2em;
  margin-right: 2em; }

div.footer, div.header {
  clear: both;
  font-size: smaller; }

div.line-block {
  display: block;
  margin-top: 1em;
  margin-bottom: 1em; }

div.line-block div.line-block {
  margin-top: 0;
  margin-bottom: 0;
  margin-left: 1.5em; }

div.sidebar {
  margin: 0 0 0.5em 1em;
  border: medium outset;
  padding: 1em;
  background-color: rgba(252, 248, 244, 0.75);
  width: 40%;
  float: right;
  clear: right; }

div.sidebar p.rubric {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
  font-size: medium; }

div.system-messages {
  margin: 5em; }

div.system-messages h1 {
  color: #b30000; }

div.system-message {
  border: medium outset;
  padding: 1em; }

div.system-message p.system-message-title {
  color: #b30000;
  font-weight: bold; }

div.topic {
  margin: 2em; }

h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  margin-top: 0.4em; }

h1.title {
  text-align: center; }

h2.subtitle {
  text-align: center; }

hr.docutils {
  width: 75%; }

img.align-left, .figure.align-left, object.align-left {
  clear: left;
  float: left;
  margin-right: 1em; }

img.align-right, .figure.align-right, object.align-right {
  clear: right;
  float: right;
  margin-left: 1em; }

img.align-center, .figure.align-center, object.align-center {
  display: block;
  margin-left: auto;
  margin-right: auto; }

.align-left {
  text-align: left; }

.align-center {
  clear: both;
  text-align: center; }

.align-right {
  text-align: right; }

/* reset inner alignment in figures */
div.align-right {
  text-align: inherit; }

/* div.align-center * { */
/*   text-align: left } */

ul.simple > li {
  margin-bottom: 0.5em }

ol.simple, ul.simple {
  margin-bottom: 1em; }

ol.arabic {
  list-style: decimal; }

ol.loweralpha {
  list-style: lower-alpha; }

ol.upperalpha {
  list-style: upper-alpha; }

ol.lowerroman {
  list-style: lower-roman; }

ol.upperroman {
  list-style: upper-roman; }

p.attribution {
  text-align: right;
  margin-left: 50%; }

p.caption {
  font-style: italic; }

p.credits {
  font-style: italic;
  font-size: smaller; }

p.label {
  white-space: nowrap; }

p.rubric {
  font-weight: bold;
  font-size: larger;
  color: maroon;
  text-align: center; }

p.sidebar-title {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
  font-weight: bold;
  font-size: larger; }

p.sidebar-subtitle {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
  font-weight: bold; }

p.topic-title {
  font-weight: bold; }

pre.address {
  margin-bottom: 0;
  margin-top: 0;
  font: inherit; }

pre.literal-block, pre.doctest-block, pre.math, pre.code {
  margin-left: 2em;
  margin-right: 2em; }

pre.code .ln {
  color: grey; }

/* line numbers */
pre.code, code {
  background-color: #eeeeee; }

pre.code .comment, code .comment {
  color: #5c6576; }

pre.code .keyword, code .keyword {
  color: #3B0D06;
  font-weight: bold; }

pre.code .literal.string, code .literal.string {
  color: #0c5404; }

pre.code .name.builtin, code .name.builtin {
  color: #352b84; }

pre.code .deleted, code .deleted {
  background-color: #DEB0A1; }

pre.code .inserted, code .inserted {
  background-color: #A3D289; }

span.classifier {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
  font-style: oblique; }

span.classifier-delimiter {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
  font-weight: bold; }

span.interpreted {
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; }

span.option {
  white-space: nowrap; }

span.pre {
  white-space: pre; }

span.problematic {
  color: #b30000; }

span.section-subtitle {
  /* font-size relative to parent (h1..h6 element) */
  font-size: 80%; }

table.citation {
  border-left: solid 1px #666666;
  margin-left: 1px; }

table.docinfo {
  margin: 0em;
  margin-top: 2em;
  margin-bottom: 2em;
  font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif !important;
  color: #444444; }

table.docutils {
  margin-top: 0.5em;
  margin-bottom: 0.5em; }

table.footnote {
  border-left: solid 1px #2d2d2d;
  margin-left: 1px; }

table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
  padding-left: 0.5em;
  padding-right: 0.5em;
  vertical-align: top; }

table.docutils th.field-name, table.docinfo th.docinfo-name {
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  padding-left: 0; }

h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  font-size: 100%; }

ul.auto-toc {
  list-style-type: none; }

span.DecNumber {
  color: #252dbe; }

span.BinNumber {
  color: #252dbe; }

span.HexNumber {
  color: #252dbe; }

span.OctNumber {
  color: #252dbe; }

span.FloatNumber {
  color: #252dbe; }

span.Identifier {
  color: #3b3b3b; }

span.Keyword {
  font-weight: 600;
  color: #5e8f60; }

span.StringLit {
  color: #a4255b; }

span.LongStringLit {
  color: #a4255b; }

span.CharLit {
  color: #a4255b; }

span.EscapeSequence {
  color: black; }

span.Operator {
  color: black; }

span.Punctuation {
  color: black; }

span.Comment, span.LongComment {
  font-style: italic;
  font-weight: 400;
  color: #484a86; }

span.RegularExpression {
  color: darkviolet; }

span.TagStart {
  color: darkviolet; }

span.TagEnd {
  color: darkviolet; }

span.Key {
  color: #252dbe; }

span.Value {
  color: #252dbe; }

span.RawData {
  color: #a4255b; }

span.Assembler {
  color: #252dbe; }

span.Preprocessor {
  color: #252dbe; }

span.Directive {
  color: #252dbe; }

span.Command, span.Rule, span.Hyperlink, span.Label, span.Reference,
span.Other {
  color: black; }

/* Pop type, const, proc, and iterator defs in nim def blocks */
dt pre > span.Identifier, dt pre > span.Operator {
  color: #155da4;
  font-weight: 700; }

dt pre > span.Identifier ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
  color: inherit;
  font-weight: inherit; }

dt pre > span.Operator ~ span.Identifier, dt pre > span.Operator ~ span.Operator {
  color: inherit;
  font-weight: inherit; }

/* Nim sprite for the footer (taken from main page favicon) */
.nim-sprite {
  display: inline-block;
  height: 12px;
  width: 12px;
  background-position: 0 0;
  background-size: 12px 12px;
  -webkit-filter: opacity(50%);
  background-repeat: no-repeat;
  background-image: url("data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA==");
  margin-bottom: -5px; }
div.pragma {
  display: none;
}
span.pragmabegin {
  cursor: pointer;
}
span.pragmaend {
  cursor: pointer;
}

div.search_results {
  background-color: antiquewhite;
  margin: 3em;
  padding: 1em;
  border: 1px solid #4d4d4d;
}

div#global-links ul {
  margin-left: 0;
  list-style-type: none;
}
</style>

<script type="text/javascript" src="../dochack.js"></script>

<script type="text/javascript">
function togglepragma(d) {
  if (d.style.display != 'inline')
    d.style.display = 'inline';
  else
    d.style.display = 'none';
}

function main() {
  var elements = document.getElementsByClassName("pragmabegin");
  for (var i = 0; i < elements.length; ++i) {
    var e = elements[i];
    e.onclick = function(event) {
      togglepragma(event.target.nextSibling);
    };
  }
  var elements = document.getElementsByClassName("pragmaend");
  for (var i = 0; i < elements.length; ++i) {
    var e = elements[i];
    e.onclick = function(event) {
      togglepragma(event.target.previousSibling);
    };
  }
}
</script>

</head>
<body onload="main()">
<div class="document" id="documentId">
  <div class="container">
    <h1 class="title">Module nimline</h1>
    <div class="row">
  <div class="three columns">
  <div id="global-links">
    <ul class="simple">
    </ul>
  </div>
  <div id="searchInput">
    Search: <input type="text" id="searchInput"
      onkeyup="search()" />
  </div>
  <div>
    Group by:
    <select onchange="groupBy(this.value)">
      <option value="section">Section</option>
      <option value="type">Type</option>
    </select>
  </div>
  <ul class="simple simple-toc" id="toc-list">
<li>
  <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  <ul class="simple simple-toc-section">
    
  </ul>
</li>
<li>
  <a class="reference reference-toplevel" href="#7" id="57">Types</a>
  <ul class="simple simple-toc-section">
      <li><a class="reference" href="#Key"
    title="Key = int"><wbr />Key<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#KeySeq"
    title="KeySeq = seq[Key]"><wbr />Key<wbr />Seq<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#KeyCallback"
    title="KeyCallback = proc (ed: var LineEditor)"><wbr />Key<wbr />Callback<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#LineError"
    title="LineError = ref Exception"><wbr />Line<wbr />Error<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#LineEditorError"
    title="LineEditorError = ref Exception"><wbr />Line<wbr />Editor<wbr />Error<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#LineEditorMode"
    title="LineEditorMode = enum
  mdInsert, mdReplace"><wbr />Line<wbr />Editor<wbr />Mode<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#Line"
    title="Line = object
  text: string
  position: int"><wbr />Line<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#LineHistory"
    title="LineHistory = object
  file: string
  tainted: bool
  position: int
  queue: Deque[string]
  max: int"><wbr />Line<wbr />History<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#LineEditor"
    title="LineEditor = object
  completionCallback*: proc (ed: LineEditor): seq[string]
  history: LineHistory
  line: Line
  mode: LineEditorMode"><wbr />Line<wbr />Editor<span class="attachedType" style="visibility:hidden"></span></a></li>

  </ul>
</li>
<li>
  <a class="reference reference-toplevel" href="#8" id="58">Vars</a>
  <ul class="simple simple-toc-section">
      <li><a class="reference" href="#KEYNAMES"
    title="KEYNAMES: array[0 .. 31, string]"><wbr />KEYNAMES<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#KEYSEQS"
    title="KEYSEQS: CritBitTree[KeySeq]"><wbr />KEYSEQS<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#KEYMAP"
    title="KEYMAP: CritBitTree[KeyCallback]"><wbr />KEYMAP<span class="attachedType" style="visibility:hidden"></span></a></li>

  </ul>
</li>
<li>
  <a class="reference reference-toplevel" href="#10" id="60">Consts</a>
  <ul class="simple simple-toc-section">
      <li><a class="reference" href="#CTRL"
    title="CTRL = {0..31}"><wbr />CTRL<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#DIGIT"
    title="DIGIT = {48..57}"><wbr />DIGIT<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#LETTER"
    title="LETTER = {65..122}"><wbr />LETTER<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#UPPERLETTER"
    title="UPPERLETTER = {65..90}"><wbr />UPPERLETTER<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#LOWERLETTER"
    title="LOWERLETTER = {97..122}"><wbr />LOWERLETTER<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#PRINTABLE"
    title="PRINTABLE = {32..126}"><wbr />PRINTABLE<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#ESCAPES"
    title="ESCAPES = {27}"><wbr />ESCAPES<span class="attachedType" style="visibility:hidden"></span></a></li>

  </ul>
</li>
<li>
  <a class="reference reference-toplevel" href="#12" id="62">Procs</a>
  <ul class="simple simple-toc-section">
      <li><a class="reference" href="#putchr,cint"
    title="putchr(c: cint)"><wbr />putchr<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#getchr,"
    title="getchr(): cint"><wbr />getchr<span class="attachedType" style="visibility:hidden"></span></a></li>
  <li><a class="reference" href="#back,LineEditor,int"
    title="back(ed: var LineEditor; n = 1)"><wbr />back<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#forward,LineEditor,int"
    title="forward(ed: var LineEditor; n = 1)"><wbr />forward<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#deletePrevious,LineEditor"
    title="deletePrevious(ed: var LineEditor)"><wbr />delete<wbr />Previous<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#deleteNext,LineEditor"
    title="deleteNext(ed: var LineEditor)"><wbr />delete<wbr />Next<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#printChar,LineEditor,int"
    title="printChar(ed: var LineEditor; c: int)"><wbr />print<wbr />Char<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#changeLine,LineEditor,string"
    title="changeLine(ed: var LineEditor; s: string)"><wbr />change<wbr />Line<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#clearLine,LineEditor"
    title="clearLine(ed: var LineEditor)"><wbr />clear<wbr />Line<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#goToStart,LineEditor"
    title="goToStart(ed: var LineEditor)"><wbr />go<wbr />To<wbr />Start<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#goToEnd,LineEditor"
    title="goToEnd(ed: var LineEditor)"><wbr />go<wbr />To<wbr />End<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#historyInit,int,string"
    title="historyInit(size = 256; file: string = nil): LineHistory"><wbr />history<wbr />Init<span class="attachedType" style="visibility:hidden">LineHistory</span></a></li>
  <li><a class="reference" href="#historyAdd,LineEditor"
    title="historyAdd(ed: var LineEditor; force = false)"><wbr />history<wbr />Add<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#historyPrevious,LineEditor"
    title="historyPrevious(ed: var LineEditor)"><wbr />history<wbr />Previous<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#historyNext,LineEditor"
    title="historyNext(ed: var LineEditor)"><wbr />history<wbr />Next<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#historyFlush,LineEditor"
    title="historyFlush(ed: var LineEditor)"><wbr />history<wbr />Flush<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#completeLine,LineEditor"
    title="completeLine(ed: var LineEditor): int"><wbr />complete<wbr />Line<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#lineText,LineEditor"
    title="lineText(ed: LineEditor): string"><wbr />line<wbr />Text<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#initEditor,int,string"
    title="initEditor(mode = mdInsert; historySize = 256; historyFile: string = nil): LineEditor"><wbr />init<wbr />Editor<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#readLine,LineEditor,string"
    title="readLine(ed: var LineEditor; prompt = &quot;&quot;; hidechars = false): string"><wbr />read<wbr />Line<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>
  <li><a class="reference" href="#password,LineEditor,string"
    title="password(ed: var LineEditor; prompt = &quot;&quot;): string"><wbr />password<span class="attachedType" style="visibility:hidden">LineEditor</span></a></li>

  </ul>
</li>

</ul>

  </div>
  <div class="nine columns" id="content">
  <div id="tocRoot"></div>
  <p class="module-desc"><p>This module provides a simple, limited but fully-functional line editing library written in pure Nim.</p>
<p>To use this library, you must first initialize a <strong>LineEditor</strong> object using the <strong>initEditor</strong> method, and then use the <strong>readLine</strong> method to capture standard input instead of <strong>stdout.readLine</strong>:</p>
<pre class="listing"><span class="Keyword">var</span> <span class="Identifier">ed</span> <span class="Operator">=</span> <span class="Identifier">initEditor</span><span class="Punctuation">(</span><span class="Identifier">historyFile</span> <span class="Operator">=</span> <span class="StringLit">&quot;history.txt&quot;</span><span class="Punctuation">)</span>
<span class="Keyword">while</span> <span class="Identifier">true</span><span class="Punctuation">:</span>
  <span class="Keyword">let</span> <span class="Identifier">str</span> <span class="Operator">=</span> <span class="Identifier">ed</span><span class="Operator">.</span><span class="Identifier">readLine</span><span class="Punctuation">(</span><span class="StringLit">&quot;-&gt; &quot;</span><span class="Punctuation">)</span>
  <span class="Identifier">echo</span> <span class="StringLit">&quot;You typed: &quot;</span><span class="Punctuation">,</span> <span class="Identifier">str</span></pre><p>Optionally, you can also configure custom key bindings for keys and key sequences:</p>
<pre class="listing"><span class="Identifier">KEYMAP</span><span class="Punctuation">[</span><span class="StringLit">&quot;ctrl+k&quot;</span><span class="Punctuation">]</span> <span class="Operator">=</span> <span class="Keyword">proc</span><span class="Punctuation">(</span><span class="Identifier">ed</span><span class="Punctuation">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Punctuation">)</span> <span class="Operator">=</span>
  <span class="Identifier">ed</span><span class="Operator">.</span><span class="Identifier">clearLine</span><span class="Punctuation">(</span><span class="Punctuation">)</span></pre><p>Additionally, you can also configure a <strong>completionCallback</strong> proc to trigger auto-completion by pressing TAB:</p>
<pre class="listing"><span class="Identifier">ed</span><span class="Operator">.</span><span class="Identifier">completionCallback</span> <span class="Operator">=</span> <span class="Keyword">proc</span><span class="Punctuation">(</span><span class="Identifier">ed</span><span class="Punctuation">:</span> <span class="Identifier">LineEditor</span><span class="Punctuation">)</span><span class="Punctuation">:</span> <span class="Identifier">seq</span><span class="Punctuation">[</span><span class="Identifier">string</span><span class="Punctuation">]</span> <span class="Operator">=</span>
  <span class="Keyword">return</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="StringLit">&quot;copy&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;list&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;delete&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;move&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;remove&quot;</span><span class="Punctuation">]</span></pre><p><strong>Note</strong> When compared to the readline or linenoise libraries, this module has the following limitations:</p>
<ul class="simple"><li>It is only possible to edit one line of text at a time. When using the <strong>readLine</strong> method, it will not be possible to physically go to the next line (this simplifies things a bit...).</li>
<li>No UTF8 support, only ASCII characters are supported.</li>
<li>No support for colorized output.</li>
<li>Only limited support for Emacs keybindings, no support for Vi mode and Vi keybindings.</li>
</ul>
</p>
  <div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
<a class="reference external" href="critbits.html">critbits</a>, <a class="reference external" href="terminal.html">terminal</a>, <a class="reference external" href="deques.html">deques</a>, <a class="reference external" href="sequtils.html">sequtils</a>, <a class="reference external" href="strutils.html">strutils</a>, <a class="reference external" href="os.html">os</a>
</dl></div>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<dt id="Key"><a name="Key"></a><pre><span class="Identifier">Key</span> <span class="Other">=</span> <span class="Identifier">int</span></pre></dt>
<dd>
The ASCII code of a keyboard key.

</dd>
<dt id="KeySeq"><a name="KeySeq"></a><pre><span class="Identifier">KeySeq</span> <span class="Other">=</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">Key</span><span class="Other">]</span></pre></dt>
<dd>
A sequence of one or more Keys.

</dd>
<dt id="KeyCallback"><a name="KeyCallback"></a><pre><span class="Identifier">KeyCallback</span> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span></pre></dt>
<dd>
A proc that can be bound to a key or a key sequence to access line editing functionalities.

</dd>
<dt id="LineError"><a name="LineError"></a><pre><span class="Identifier">LineError</span> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Identifier">Exception</span></pre></dt>
<dd>
A generic nimline error.

</dd>
<dt id="LineEditorError"><a name="LineEditorError"></a><pre><span class="Identifier">LineEditorError</span> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Identifier">Exception</span></pre></dt>
<dd>
An error occured in the LineEditor.

</dd>
<dt id="LineEditorMode"><a name="LineEditorMode"></a><pre><span class="Identifier">LineEditorMode</span> <span class="Other">=</span> <span class="Keyword">enum</span>
  <span class="Identifier">mdInsert</span><span class="Other">,</span> <span class="Identifier">mdReplace</span></pre></dt>
<dd>
The <em>mode</em> a LineEditor operates in (insert or replace).

</dd>
<dt id="Line"><a name="Line"></a><pre><span class="Identifier">Line</span> <span class="Other">=</span> <span class="Keyword">object</span>
  <span class="Identifier">text</span><span class="Other">:</span> <span class="Identifier">string</span>
  <span class="Identifier">position</span><span class="Other">:</span> <span class="Identifier">int</span>
</pre></dt>
<dd>
An object representing a line of text.

</dd>
<dt id="LineHistory"><a name="LineHistory"></a><pre><span class="Identifier">LineHistory</span> <span class="Other">=</span> <span class="Keyword">object</span>
  <span class="Identifier">file</span><span class="Other">:</span> <span class="Identifier">string</span>
  <span class="Identifier">tainted</span><span class="Other">:</span> <span class="Identifier">bool</span>
  <span class="Identifier">position</span><span class="Other">:</span> <span class="Identifier">int</span>
  <span class="Identifier">queue</span><span class="Other">:</span> <span class="Identifier">Deque</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span>
  <span class="Identifier">max</span><span class="Other">:</span> <span class="Identifier">int</span>
</pre></dt>
<dd>
An object representing the history of all commands typed in a LineEditor.

</dd>
<dt id="LineEditor"><a name="LineEditor"></a><pre><span class="Identifier">LineEditor</span> <span class="Other">=</span> <span class="Keyword">object</span>
  <span class="Identifier">completionCallback</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Identifier">LineEditor</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span>
  <span class="Identifier">history</span><span class="Other">:</span> <span class="Identifier">LineHistory</span>
  <span class="Identifier">line</span><span class="Other">:</span> <span class="Identifier">Line</span>
  <span class="Identifier">mode</span><span class="Other">:</span> <span class="Identifier">LineEditorMode</span>
</pre></dt>
<dd>
An object representing a line editor, used to process text typed in the terminal.

</dd>

</dl></div>
<div class="section" id="8">
<h1><a class="toc-backref" href="#8">Vars</a></h1>
<dl class="item">
<dt id="KEYNAMES"><a name="KEYNAMES"></a><pre><span class="Identifier">KEYNAMES</span><span class="Other">:</span> <span class="Identifier">array</span><span class="Other">[</span><span class="DecNumber">0</span> <span class="Operator">..</span> <span class="DecNumber">31</span><span class="Other">,</span> <span class="Identifier">string</span><span class="Other">]</span></pre></dt>
<dd>
The following strings can be used in keymaps instead of the correspinding ASCII codes:<pre class="listing"><span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+a&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">2</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+b&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">3</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+c&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">4</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+d&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">5</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+e&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">6</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+f&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">7</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+g&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">8</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+h&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">9</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+i&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">9</span><span class="Punctuation">]</span>    <span class="Operator">=</span>    <span class="StringLit">&quot;tab&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">10</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+j&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">11</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+k&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">12</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+l&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">13</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+m&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">14</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+n&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">15</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+o&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">16</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+p&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">17</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+q&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">18</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+r&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">19</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+s&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">20</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+t&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">21</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+u&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">22</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+v&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">23</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+w&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">24</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+x&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">25</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+y&quot;</span>
<span class="Identifier">KEYNAMES</span><span class="Punctuation">[</span><span class="DecNumber">26</span><span class="Punctuation">]</span>   <span class="Operator">=</span>    <span class="StringLit">&quot;ctrl+z&quot;</span></pre>

</dd>
<dt id="KEYSEQS"><a name="KEYSEQS"></a><pre><span class="Identifier">KEYSEQS</span><span class="Other">:</span> <span class="Identifier">CritBitTree</span><span class="Other">[</span><span class="Identifier">KeySeq</span><span class="Other">]</span></pre></dt>
<dd>
The following key sequences are defined and are used internally by <strong>LineEditor</strong>:<pre class="listing"><span class="Identifier">KEYSEQS</span><span class="Punctuation">[</span><span class="StringLit">&quot;up&quot;</span><span class="Punctuation">]</span>         <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="DecNumber">27</span><span class="Punctuation">,</span> <span class="DecNumber">91</span><span class="Punctuation">,</span> <span class="DecNumber">65</span><span class="Punctuation">]</span>      <span class="Comment"># Windows: @[224, 72]</span>
<span class="Identifier">KEYSEQS</span><span class="Punctuation">[</span><span class="StringLit">&quot;down&quot;</span><span class="Punctuation">]</span>       <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="DecNumber">27</span><span class="Punctuation">,</span> <span class="DecNumber">91</span><span class="Punctuation">,</span> <span class="DecNumber">66</span><span class="Punctuation">]</span>      <span class="Comment"># Windows: @[224, 80]</span>
<span class="Identifier">KEYSEQS</span><span class="Punctuation">[</span><span class="StringLit">&quot;right&quot;</span><span class="Punctuation">]</span>      <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="DecNumber">27</span><span class="Punctuation">,</span> <span class="DecNumber">91</span><span class="Punctuation">,</span> <span class="DecNumber">67</span><span class="Punctuation">]</span>      <span class="Comment"># Windows: @[224, 77]</span>
<span class="Identifier">KEYSEQS</span><span class="Punctuation">[</span><span class="StringLit">&quot;left&quot;</span><span class="Punctuation">]</span>       <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="DecNumber">27</span><span class="Punctuation">,</span> <span class="DecNumber">91</span><span class="Punctuation">,</span> <span class="DecNumber">68</span><span class="Punctuation">]</span>      <span class="Comment"># Windows: @[224, 75]</span>
<span class="Identifier">KEYSEQS</span><span class="Punctuation">[</span><span class="StringLit">&quot;home&quot;</span><span class="Punctuation">]</span>       <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="DecNumber">27</span><span class="Punctuation">,</span> <span class="DecNumber">91</span><span class="Punctuation">,</span> <span class="DecNumber">72</span><span class="Punctuation">]</span>      <span class="Comment"># Windows: @[224, 71]</span>
<span class="Identifier">KEYSEQS</span><span class="Punctuation">[</span><span class="StringLit">&quot;end&quot;</span><span class="Punctuation">]</span>        <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="DecNumber">27</span><span class="Punctuation">,</span> <span class="DecNumber">91</span><span class="Punctuation">,</span> <span class="DecNumber">70</span><span class="Punctuation">]</span>      <span class="Comment"># Windows: @[224, 79]</span>
<span class="Identifier">KEYSEQS</span><span class="Punctuation">[</span><span class="StringLit">&quot;insert&quot;</span><span class="Punctuation">]</span>     <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="DecNumber">27</span><span class="Punctuation">,</span> <span class="DecNumber">91</span><span class="Punctuation">,</span> <span class="DecNumber">50</span><span class="Punctuation">,</span> <span class="DecNumber">126</span><span class="Punctuation">]</span> <span class="Comment"># Windows: @[224, 82]</span>
<span class="Identifier">KEYSEQS</span><span class="Punctuation">[</span><span class="StringLit">&quot;delete&quot;</span><span class="Punctuation">]</span>     <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="DecNumber">27</span><span class="Punctuation">,</span> <span class="DecNumber">91</span><span class="Punctuation">,</span> <span class="DecNumber">51</span><span class="Punctuation">,</span> <span class="DecNumber">126</span><span class="Punctuation">]</span> <span class="Comment"># Windows: @[224, 83]</span></pre>

</dd>
<dt id="KEYMAP"><a name="KEYMAP"></a><pre><span class="Identifier">KEYMAP</span><span class="Other">:</span> <span class="Identifier">CritBitTree</span><span class="Other">[</span><span class="Identifier">KeyCallback</span><span class="Other">]</span></pre></dt>
<dd>
The following key mappings are configured by default:<ul class="simple"><li>backspace: <strong>deletePrevious</strong></li>
<li>delete: <strong>deleteNext</strong></li>
<li>insert: <em>toggle editor mode</em></li>
<li>down: <strong>historyNext</strong></li>
<li>up: <strong>historyPrevious</strong></li>
<li>ctrl+n: <strong>historyNext</strong></li>
<li>ctrl+p: <strong>historyPrevious</strong></li>
<li>left: <strong>back</strong></li>
<li>right: <strong>forward</strong></li>
<li>ctrl+b: <strong>back</strong></li>
<li>ctrl+f: <strong>forward</strong></li>
<li>ctrl+c: <em>quits the program</em></li>
<li>ctrl+d: <em>quits the program</em></li>
<li>ctrl+u: <strong>clearLine</strong></li>
<li>ctrl+a: <strong>goToStart</strong></li>
<li>ctrl+e: <strong>goToEnd</strong></li>
<li>home: <strong>goToStart</strong></li>
<li>end: <strong>goToEnd</strong></li>
</ul>


</dd>

</dl></div>
<div class="section" id="10">
<h1><a class="toc-backref" href="#10">Consts</a></h1>
<dl class="item">
<dt id="CTRL"><a name="CTRL"></a><pre><span class="Identifier">CTRL</span> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">0</span><span class="Other">..</span><span class="DecNumber">31</span><span class="Other">}</span></pre></dt>
<dd>
Control characters.

</dd>
<dt id="DIGIT"><a name="DIGIT"></a><pre><span class="Identifier">DIGIT</span> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">48</span><span class="Other">..</span><span class="DecNumber">57</span><span class="Other">}</span></pre></dt>
<dd>
Digits.

</dd>
<dt id="LETTER"><a name="LETTER"></a><pre><span class="Identifier">LETTER</span> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">65</span><span class="Other">..</span><span class="DecNumber">122</span><span class="Other">}</span></pre></dt>
<dd>
Letters.

</dd>
<dt id="UPPERLETTER"><a name="UPPERLETTER"></a><pre><span class="Identifier">UPPERLETTER</span> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">65</span><span class="Other">..</span><span class="DecNumber">90</span><span class="Other">}</span></pre></dt>
<dd>
Uppercase letters.

</dd>
<dt id="LOWERLETTER"><a name="LOWERLETTER"></a><pre><span class="Identifier">LOWERLETTER</span> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">97</span><span class="Other">..</span><span class="DecNumber">122</span><span class="Other">}</span></pre></dt>
<dd>
Lowercase letters.

</dd>
<dt id="PRINTABLE"><a name="PRINTABLE"></a><pre><span class="Identifier">PRINTABLE</span> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">32</span><span class="Other">..</span><span class="DecNumber">126</span><span class="Other">}</span></pre></dt>
<dd>
Printable characters.

</dd>
<dt id="ESCAPES"><a name="ESCAPES"></a><pre><span class="Identifier">ESCAPES</span> <span class="Other">=</span> <span class="Other">{</span><span class="DecNumber">27</span><span class="Other">}</span></pre></dt>
<dd>
Escape characters.

</dd>

</dl></div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<dt id="putchr"><a name="putchr,cint"></a><pre><span class="Keyword">proc</span> <span class="Identifier">putchr</span><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Identifier">cint</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Prints an ASCII character to stdout.

</dd>
<dt id="getchr"><a name="getchr,"></a><pre><span class="Keyword">proc</span> <span class="Identifier">getchr</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">cint</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Retrieves an ASCII character from stdin.

</dd>
<dt id="back"><a name="back,LineEditor,int"></a><pre><span class="Keyword">proc</span> <span class="Identifier">back</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">;</span> <span class="Identifier">n</span> <span class="Other">=</span> <span class="DecNumber">1</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Move the cursor back by <strong>n</strong> characters on the current line (unless the beginning of the line is reached).

</dd>
<dt id="forward"><a name="forward,LineEditor,int"></a><pre><span class="Keyword">proc</span> <span class="Identifier">forward</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">;</span> <span class="Identifier">n</span> <span class="Other">=</span> <span class="DecNumber">1</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Move the cursor forward by <strong>n</strong> characters on the current line (unless the beginning of the line is reached).

</dd>
<dt id="deletePrevious"><a name="deletePrevious,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">deletePrevious</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">LineError</span><span class="Other">]</span><span class="Other">,</span>
                                      <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Move the cursor to the left by one character (unless at the beginning of the line) and delete the existing character, if any.

</dd>
<dt id="deleteNext"><a name="deleteNext,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">deleteNext</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">LineError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
                                  <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Move the cursor to the right by one character (unless at the end of the line) and delete the existing character, if any.

</dd>
<dt id="printChar"><a name="printChar,LineEditor,int"></a><pre><span class="Keyword">proc</span> <span class="Identifier">printChar</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">;</span> <span class="Identifier">c</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">LineError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
                                       <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Prints the character <strong>c</strong> to the current line. If in the middle of the line, the following characters are shifted right or replaced depending on the editor mode.

</dd>
<dt id="changeLine"><a name="changeLine,LineEditor,string"></a><pre><span class="Keyword">proc</span> <span class="Identifier">changeLine</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
    <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Replaces the contents of the current line with the string <strong>s</strong>.

</dd>
<dt id="clearLine"><a name="clearLine,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">clearLine</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Clears the contents of the current line and reset the cursor position to the beginning of the line.

</dd>
<dt id="goToStart"><a name="goToStart,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">goToStart</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Move the cursor to the beginning of the line.

</dd>
<dt id="goToEnd"><a name="goToEnd,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">goToEnd</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Move the cursor to the end of the line.

</dd>
<dt id="historyInit"><a name="historyInit,int,string"></a><pre><span class="Keyword">proc</span> <span class="Identifier">historyInit</span><span class="Other">(</span><span class="Identifier">size</span> <span class="Other">=</span> <span class="DecNumber">256</span><span class="Other">;</span> <span class="Identifier">file</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">LineHistory</span> <span class="Other pragmabegin">{.</span><div class="pragma">
    <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">AssertionError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">IndexError</span><span class="Other">]</span><span class="Other">,</span>
    <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Creates a new <strong>LineHistory</strong> object with the specified <strong>size</strong> and <strong>file</strong>.

</dd>
<dt id="historyAdd"><a name="historyAdd,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">historyAdd</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">;</span> <span class="Identifier">force</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IndexError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
    <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Adds the current editor line to the history. If <strong>force</strong> is set to <strong>true</strong>, the line will be added even if it's blank.

</dd>
<dt id="historyPrevious"><a name="historyPrevious,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">historyPrevious</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IndexError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
                                       <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Replaces the contents of the current line with the previous line stored in the history (if any). The current line will be added to the history and the hisory will be marked as <em>tainted</em>.

</dd>
<dt id="historyNext"><a name="historyNext,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">historyNext</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Replaces the contents of the current line with the following line stored in the history (if any).

</dd>
<dt id="historyFlush"><a name="historyFlush,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">historyFlush</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
If there is at least one entry in the history, it sets the position of the cursor to the last element and sets the <strong>tainted</strong> flag to <strong>false</strong>.

</dd>
<dt id="completeLine"><a name="completeLine,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">completeLine</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">AssertionError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
                                        <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
<p>If a <strong>completionCallback</strong> proc has been specified for the current editor, attempts to auto-complete the current line by running <strong>completionProc</strong> to return a list of possible values. It is possible to cycle through the matches by pressing the same key that triggered this proc.</p>
<p>The matches provided will be filtered based on the contents of the line when this proc was first triggered. If a match starts with the contents of the line, it will be displayed.</p>
<p>The following is a real-world example of a <strong>completionCallback</strong> used to complete the last word on the line with valid file paths.</p>
<pre class="listing"><span class="Keyword">import</span> <span class="Identifier">sequtils</span><span class="Punctuation">,</span> <span class="Identifier">strutils</span><span class="Punctuation">,</span> <span class="Identifier">ospath</span>

<span class="Identifier">ed</span><span class="Operator">.</span><span class="Identifier">completionCallback</span> <span class="Operator">=</span> <span class="Keyword">proc</span><span class="Punctuation">(</span><span class="Identifier">ed</span><span class="Punctuation">:</span> <span class="Identifier">LineEditor</span><span class="Punctuation">)</span><span class="Punctuation">:</span> <span class="Identifier">seq</span><span class="Punctuation">[</span><span class="Identifier">string</span><span class="Punctuation">]</span> <span class="Operator">=</span>
  <span class="Keyword">var</span> <span class="Identifier">words</span> <span class="Operator">=</span> <span class="Identifier">ed</span><span class="Operator">.</span><span class="Identifier">lineText</span><span class="Operator">.</span><span class="Identifier">split</span><span class="Punctuation">(</span><span class="StringLit">&quot; &quot;</span><span class="Punctuation">)</span>
  <span class="Keyword">var</span> <span class="Identifier">word</span><span class="Punctuation">:</span> <span class="Identifier">string</span>
  <span class="Keyword">if</span> <span class="Identifier">words</span><span class="Operator">.</span><span class="Identifier">len</span> <span class="Operator">==</span> <span class="DecNumber">0</span><span class="Punctuation">:</span>
    <span class="Identifier">word</span> <span class="Operator">=</span> <span class="Identifier">ed</span><span class="Operator">.</span><span class="Identifier">lineText</span>
  <span class="Keyword">else</span><span class="Punctuation">:</span>
    <span class="Identifier">word</span> <span class="Operator">=</span> <span class="Identifier">words</span><span class="Punctuation">[</span><span class="Identifier">words</span><span class="Operator">.</span><span class="Identifier">len</span><span class="Operator">-</span><span class="DecNumber">1</span><span class="Punctuation">]</span>
  <span class="Keyword">var</span> <span class="Identifier">f</span> <span class="Operator">=</span> <span class="Identifier">word</span><span class="Punctuation">[</span><span class="FloatNumber">1.</span><span class="Operator">.^</span><span class="DecNumber">1</span><span class="Punctuation">]</span>
  <span class="Keyword">if</span> <span class="Identifier">f</span> <span class="Operator">==</span> <span class="StringLit">&quot;&quot;</span><span class="Punctuation">:</span>
    <span class="Identifier">f</span> <span class="Operator">=</span> <span class="Identifier">getCurrentDir</span><span class="Punctuation">(</span><span class="Punctuation">)</span><span class="Operator">.</span><span class="Identifier">replace</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\\</span><span class="StringLit">&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;/&quot;</span><span class="Punctuation">)</span>
    <span class="Keyword">return</span> <span class="Identifier">toSeq</span><span class="Punctuation">(</span><span class="Identifier">walkDir</span><span class="Punctuation">(</span><span class="Identifier">f</span><span class="Punctuation">,</span> <span class="Identifier">true</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
      <span class="Operator">.</span><span class="Identifier">mapIt</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\&quot;</span><span class="StringLit">$1&quot;</span> <span class="Operator">%</span> <span class="Identifier">it</span><span class="Operator">.</span><span class="Identifier">path</span><span class="Operator">.</span><span class="Identifier">replace</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\\</span><span class="StringLit">&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;/&quot;</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
  <span class="Keyword">elif</span> <span class="Identifier">f</span><span class="Operator">.</span><span class="Identifier">dirExists</span><span class="Punctuation">:</span>
    <span class="Identifier">f</span> <span class="Operator">=</span> <span class="Identifier">f</span><span class="Operator">.</span><span class="Identifier">replace</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\\</span><span class="StringLit">&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;/&quot;</span><span class="Punctuation">)</span>
    <span class="Keyword">if</span> <span class="Identifier">f</span><span class="Punctuation">[</span><span class="Identifier">f</span><span class="Operator">.</span><span class="Identifier">len</span><span class="Operator">-</span><span class="DecNumber">1</span><span class="Punctuation">]</span> <span class="Operator">!=</span> <span class="CharLit">'/'</span><span class="Punctuation">:</span>
      <span class="Identifier">f</span> <span class="Operator">=</span> <span class="Identifier">f</span> <span class="Operator">&amp;</span> <span class="StringLit">&quot;/&quot;</span>
    <span class="Keyword">return</span> <span class="Identifier">toSeq</span><span class="Punctuation">(</span><span class="Identifier">walkDir</span><span class="Punctuation">(</span><span class="Identifier">f</span><span class="Punctuation">,</span> <span class="Identifier">true</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
      <span class="Operator">.</span><span class="Identifier">mapIt</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\&quot;</span><span class="StringLit">$1$2&quot;</span> <span class="Operator">%</span> <span class="Punctuation">[</span><span class="Identifier">f</span><span class="Punctuation">,</span> <span class="Identifier">it</span><span class="Operator">.</span><span class="Identifier">path</span><span class="Operator">.</span><span class="Identifier">replace</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\\</span><span class="StringLit">&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;/&quot;</span><span class="Punctuation">)</span><span class="Punctuation">]</span><span class="Punctuation">)</span>
  <span class="Keyword">else</span><span class="Punctuation">:</span>
    <span class="Keyword">var</span> <span class="Identifier">dir</span><span class="Punctuation">:</span> <span class="Identifier">string</span>
    <span class="Keyword">if</span> <span class="Identifier">f</span><span class="Operator">.</span><span class="Identifier">contains</span><span class="Punctuation">(</span><span class="StringLit">&quot;/&quot;</span><span class="Punctuation">)</span> <span class="Keyword">or</span> <span class="Identifier">dir</span><span class="Operator">.</span><span class="Identifier">contains</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\\</span><span class="StringLit">&quot;</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
      <span class="Identifier">dir</span> <span class="Operator">=</span> <span class="Identifier">f</span><span class="Operator">.</span><span class="Identifier">parentDir</span>
      <span class="Keyword">let</span> <span class="Identifier">file</span> <span class="Operator">=</span> <span class="Identifier">f</span><span class="Operator">.</span><span class="Identifier">extractFileName</span>
      <span class="Keyword">return</span> <span class="Identifier">toSeq</span><span class="Punctuation">(</span><span class="Identifier">walkDir</span><span class="Punctuation">(</span><span class="Identifier">dir</span><span class="Punctuation">,</span> <span class="Identifier">true</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
        <span class="Operator">.</span><span class="Identifier">filterIt</span><span class="Punctuation">(</span><span class="Identifier">it</span><span class="Operator">.</span><span class="Identifier">path</span><span class="Operator">.</span><span class="Identifier">toLowerAscii</span><span class="Operator">.</span><span class="Identifier">startsWith</span><span class="Punctuation">(</span><span class="Identifier">file</span><span class="Operator">.</span><span class="Identifier">toLowerAscii</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
        <span class="Operator">.</span><span class="Identifier">mapIt</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\&quot;</span><span class="StringLit">$1/$2&quot;</span> <span class="Operator">%</span> <span class="Punctuation">[</span><span class="Identifier">dir</span><span class="Punctuation">,</span> <span class="Identifier">it</span><span class="Operator">.</span><span class="Identifier">path</span><span class="Operator">.</span><span class="Identifier">replace</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\\</span><span class="StringLit">&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;/&quot;</span><span class="Punctuation">)</span><span class="Punctuation">]</span><span class="Punctuation">)</span>
    <span class="Keyword">else</span><span class="Punctuation">:</span>
      <span class="Identifier">dir</span> <span class="Operator">=</span> <span class="Identifier">getCurrentDir</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
      <span class="Keyword">return</span> <span class="Identifier">toSeq</span><span class="Punctuation">(</span><span class="Identifier">walkDir</span><span class="Punctuation">(</span><span class="Identifier">dir</span><span class="Punctuation">,</span> <span class="Identifier">true</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
        <span class="Operator">.</span><span class="Identifier">filterIt</span><span class="Punctuation">(</span><span class="Identifier">it</span><span class="Operator">.</span><span class="Identifier">path</span><span class="Operator">.</span><span class="Identifier">toLowerAscii</span><span class="Operator">.</span><span class="Identifier">startsWith</span><span class="Punctuation">(</span><span class="Identifier">f</span><span class="Operator">.</span><span class="Identifier">toLowerAscii</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
        <span class="Operator">.</span><span class="Identifier">mapIt</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\&quot;</span><span class="StringLit">$1&quot;</span> <span class="Operator">%</span> <span class="Punctuation">[</span><span class="Identifier">it</span><span class="Operator">.</span><span class="Identifier">path</span><span class="Operator">.</span><span class="Identifier">replace</span><span class="Punctuation">(</span><span class="StringLit">&quot;</span><span class="EscapeSequence">\\</span><span class="StringLit">&quot;</span><span class="Punctuation">,</span> <span class="StringLit">&quot;/&quot;</span><span class="Punctuation">)</span><span class="Punctuation">]</span><span class="Punctuation">)</span></pre>

</dd>
<dt id="lineText"><a name="lineText,LineEditor"></a><pre><span class="Keyword">proc</span> <span class="Identifier">lineText</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Identifier">LineEditor</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Returns the contents of the current line.

</dd>
<dt id="initEditor"><a name="initEditor,int,string"></a><pre><span class="Keyword">proc</span> <span class="Identifier">initEditor</span><span class="Other">(</span><span class="Identifier">mode</span> <span class="Other">=</span> <span class="Identifier">mdInsert</span><span class="Other">;</span> <span class="Identifier">historySize</span> <span class="Other">=</span> <span class="DecNumber">256</span><span class="Other">;</span> <span class="Identifier">historyFile</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Other">=</span> <span class="Keyword">nil</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">LineEditor</span> <span class="Other pragmabegin">{.</span><div class="pragma">
    <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">AssertionError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">IndexError</span><span class="Other">]</span><span class="Other">,</span>
    <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Creates a <strong>LineEditor</strong> object.

</dd>
<dt id="readLine"><a name="readLine,LineEditor,string"></a><pre><span class="Keyword">proc</span> <span class="Identifier">readLine</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">;</span> <span class="Identifier">prompt</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">;</span> <span class="Identifier">hidechars</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Other pragmabegin">{.</span><div class="pragma">
    <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">IndexError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">AssertionError</span><span class="Other">]</span><span class="Other">,</span>
    <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
<p>High-level proc to be used instead of <strong>stdin.readLine</strong> to read a line from standard input using the specified <strong>LineEditor</strong> object.</p>
<p>Note that:</p>
<ul class="simple"><li><strong>prompt</strong> is a string (that <em>cannot</em> contain escape codes, so it cannot be colored) that will be prepended at the start of the line and not included in the contents of the line itself.</li>
<li>If <strong>hidechars</strong> is set to <strong>true</strong>, asterisks will be printed to stdout instead of the characters entered by the user.</li>
</ul>


</dd>
<dt id="password"><a name="password,LineEditor,string"></a><pre><span class="Keyword">proc</span> <span class="Identifier">password</span><span class="Other">(</span><span class="Identifier">ed</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">LineEditor</span><span class="Other">;</span> <span class="Identifier">prompt</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Other pragmabegin">{.</span><div class="pragma">
    <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">IndexError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">AssertionError</span><span class="Other">]</span><span class="Other">,</span>
    <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">]</span></div><span class="Other pragmaend">.}</span></pre></dt>
<dd>
Convenience method to use instead of <strong>readLine</strong> to hide the characters inputed by the user.

</dd>

</dl></div>

  </div>
</div>

    <div class="row">
      <div class="twelve-columns footer">
        <span class="nim-sprite"></span>
        <br/>
        <small>Made with Nim. Generated: 2018-08-12 22:38:27 UTC</small>
      </div>
    </div>
  </div>
</div>

</body>
</html>