Compare commits
906 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4474bc0970 | ||
|
|
926fe5f789 | ||
|
|
d0c64e8086 | ||
|
|
de3260cdb1 | ||
|
|
23c3fd9bcd | ||
|
|
c118397a14 | ||
|
|
cd5d7faa4e | ||
|
|
3ca6c9241f | ||
|
|
a847d37b24 | ||
|
|
1cb945fe8e | ||
|
|
330741b650 | ||
|
|
f773d715e8 | ||
|
|
407f2d5bcf | ||
|
|
61e8b3d542 | ||
|
|
de36e1c120 | ||
|
|
a8c1dc1402 | ||
|
|
d60e7d374c | ||
|
|
2358badc65 | ||
|
|
efdb543f8c | ||
|
|
c24545fe9a | ||
|
|
8fbadecf0a | ||
|
|
a6605dce00 | ||
|
|
9ec546d293 | ||
|
|
fccfcccd37 | ||
|
|
03148804e6 | ||
|
|
3b86c7a190 | ||
|
|
7ef5c53263 | ||
|
|
6bd94040df | ||
|
|
b3bcc8eeac | ||
|
|
fb8fdcaa0a | ||
|
|
7fac9ec51c | ||
|
|
17f5c056ca | ||
|
|
914af36546 | ||
|
|
5c3d529761 | ||
|
|
8f10e364bb | ||
|
|
b1b9770c57 | ||
|
|
78037831f8 | ||
|
|
83ff644b6a | ||
|
|
3e22240fd5 | ||
|
|
34e086f038 | ||
|
|
f2ac20114e | ||
|
|
da5643853f | ||
|
|
437cb410e9 | ||
|
|
94e563232e | ||
|
|
ef7a7c5360 | ||
|
|
64aa8757a8 | ||
|
|
4ed3591703 | ||
|
|
3534d8ff25 | ||
|
|
a8a70f0f29 | ||
|
|
1d10d79860 | ||
|
|
8441887ec0 | ||
|
|
775f007348 | ||
|
|
414a1ecc8d | ||
|
|
e0bdf671b8 | ||
|
|
13fbf13b85 | ||
|
|
96f50b8d55 | ||
|
|
76d83070c4 | ||
|
|
1194a41cdb | ||
|
|
eba470a869 | ||
|
|
9a4a5454f2 | ||
|
|
af7201f9a0 | ||
|
|
2f80193d96 | ||
|
|
23595c8376 | ||
|
|
669453506c | ||
|
|
9de376deed | ||
|
|
94907aa534 | ||
|
|
7e5524bb66 | ||
|
|
e8c7cf2071 | ||
|
|
605f031833 | ||
|
|
c88d7ce530 | ||
|
|
9f884810b6 | ||
|
|
5d5666fba6 | ||
|
|
980e334e37 | ||
|
|
9bb64fccef | ||
|
|
6e3adf31b8 | ||
|
|
c67c431239 | ||
|
|
bf0268d41d | ||
|
|
b7c2513f7d | ||
|
|
892762d99c | ||
|
|
f7d320d932 | ||
|
|
0208ae7149 | ||
|
|
26fb907aa6 | ||
|
|
ea40765904 | ||
|
|
16a7fd4bfc | ||
|
|
eca6faee5b | ||
|
|
59edef55dc | ||
|
|
f119a90fe5 | ||
|
|
4920030384 | ||
|
|
a898fa5dcc | ||
|
|
c0aa5ad258 | ||
|
|
58c3dd6cd0 | ||
|
|
5ca765f107 | ||
|
|
cf75da9888 | ||
|
|
14c62dbf11 | ||
|
|
f6fbc1572d | ||
|
|
38d7362f20 | ||
|
|
26683a9e5f | ||
|
|
d35ecd02b8 | ||
|
|
61bc248555 | ||
|
|
c38f571d4b | ||
|
|
a89437219d | ||
|
|
aa28441071 | ||
|
|
5dbd288254 | ||
|
|
8f21d256fb | ||
|
|
08cfdbcbdb | ||
|
|
6103c47f1c | ||
|
|
88cf22f804 | ||
|
|
8177e62c18 | ||
|
|
124a859516 | ||
|
|
322120c980 | ||
|
|
54e6fe2b4a | ||
|
|
fa56310454 | ||
|
|
f35c3dbd57 | ||
|
|
acb394aec0 | ||
|
|
4223b83f75 | ||
|
|
4a1302ef55 | ||
|
|
cbf7e57ed0 | ||
|
|
e36e829ad0 | ||
|
|
121c53f3b8 | ||
|
|
5b9683cd64 | ||
|
|
7c1dfea59e | ||
|
|
4a073a0f3e | ||
|
|
f8841f0927 | ||
|
|
8d692a87dc | ||
|
|
13176792f0 | ||
|
|
d7fbc70a72 | ||
|
|
1dd01eb4e1 | ||
|
|
fd0589d8bc | ||
|
|
a381021ffc | ||
|
|
0b0ddb1e5f | ||
|
|
991e49a36a | ||
|
|
b1c20629f5 | ||
|
|
7373e4cd46 | ||
|
|
5f30775d62 | ||
|
|
69bd4d1f06 | ||
|
|
d3429a7a57 | ||
|
|
e1538e6dc3 | ||
|
|
1c46551ce8 | ||
|
|
f1b87f960c | ||
|
|
b0ef2e2803 | ||
|
|
6981294c9d | ||
|
|
fc89ac11d2 | ||
|
|
9f92fb3ec4 | ||
|
|
293423bdda | ||
|
|
32719d64a1 | ||
|
|
f4321250ef | ||
|
|
908663e8fc | ||
|
|
1fb820386b | ||
|
|
9973366685 | ||
|
|
e72db0e350 | ||
|
|
87b2df6dea | ||
|
|
c24caf5fb8 | ||
|
|
8db21b68d5 | ||
|
|
cb31e45f6c | ||
|
|
588daf949e | ||
|
|
d21a9c8fc3 | ||
|
|
edbc1e5950 | ||
|
|
dc18746cbd | ||
|
|
c92b9be6cd | ||
|
|
eef7d1047a | ||
|
|
d49d4f7b56 | ||
|
|
2fbb71d555 | ||
|
|
66356ec7e2 | ||
|
|
4edc83c3c2 | ||
|
|
e6350aaba4 | ||
|
|
8bf8682b17 | ||
|
|
a9b5a0e029 | ||
|
|
026393a91a | ||
|
|
db897b574f | ||
|
|
2b1bc6866a | ||
|
|
90b959a677 | ||
|
|
116d9e6f01 | ||
|
|
6620acbff4 | ||
|
|
1cb6619d6a | ||
|
|
79a4bf81dc | ||
|
|
b77e6bd99d | ||
|
|
2bcc6d7f66 | ||
|
|
cd705a7c4c | ||
|
|
ecd18c1694 | ||
|
|
bc8a3a50a4 | ||
|
|
9b90ec877a | ||
|
|
8b483c10ba | ||
|
|
f915a28d30 | ||
|
|
cb3fc8892a | ||
|
|
06d9ee89e5 | ||
|
|
0b0b812206 | ||
|
|
eafae5d417 | ||
|
|
dfff78dffe | ||
|
|
40acb8714c | ||
|
|
d7af590c6b | ||
|
|
8c7e4f5108 | ||
|
|
1144d38316 | ||
|
|
0562d27b9c | ||
|
|
c5f49167ea | ||
|
|
9765c2faa0 | ||
|
|
85ebe971e2 | ||
|
|
fc101a6ded | ||
|
|
eb88ad980a | ||
|
|
9fa95a3680 | ||
|
|
d6cc2c40fe | ||
|
|
1df4115013 | ||
|
|
ea9f62fc0f | ||
|
|
a772194102 | ||
|
|
faf77fb1ec | ||
|
|
b0b24d9c3a | ||
|
|
c9f743f676 | ||
|
|
bd920b1f49 | ||
|
|
29e094cd21 | ||
|
|
7a8ae90dac | ||
|
|
13ec5d8ce9 | ||
|
|
30591c5e01 | ||
|
|
3f8e30efb1 | ||
|
|
e9fde7d7dc | ||
|
|
fd3423f79a | ||
|
|
a4044a7e5d | ||
|
|
2fa93ae999 | ||
|
|
c8c6340ce8 | ||
|
|
6263416355 | ||
|
|
84d6f1a5b6 | ||
|
|
ecccb8d027 | ||
|
|
173bbe11ef | ||
|
|
7531b71fa1 | ||
|
|
964c10db17 | ||
|
|
0e01080983 | ||
|
|
68a0314500 | ||
|
|
dca4ab5d8f | ||
|
|
86121cf3fc | ||
|
|
f03f5d5b51 | ||
|
|
379b1556ed | ||
|
|
bfcce57b69 | ||
|
|
4eac699df3 | ||
|
|
454f5cbdce | ||
|
|
248d7be8ef | ||
|
|
372bd0f7dd | ||
|
|
f920e0d30c | ||
|
|
0f3e303d1a | ||
|
|
c9680b8b64 | ||
|
|
656563beda | ||
|
|
8f95f9b1aa | ||
|
|
c6512a9717 | ||
|
|
07ce01c189 | ||
|
|
b5400ffe65 | ||
|
|
ac41587d4e | ||
|
|
e4b8d6fab5 | ||
|
|
72e8bcb027 | ||
|
|
7401670d58 | ||
|
|
87fbe24283 | ||
|
|
e4d452424b | ||
|
|
d48071b2b2 | ||
|
|
c1a484270b | ||
|
|
981a1d39bf | ||
|
|
925a001658 | ||
|
|
77023a749b | ||
|
|
1762920808 | ||
|
|
281a56fb74 | ||
|
|
592d0d6c9a | ||
|
|
3cc561e36e | ||
|
|
0333b87ad7 | ||
|
|
059c8efb44 | ||
|
|
eb68cd1c6b | ||
|
|
ecea413802 | ||
|
|
95253231e8 | ||
|
|
eb5968f845 | ||
|
|
f2c72bf759 | ||
|
|
e472b72565 | ||
|
|
e332d2df74 | ||
|
|
ed165827bc | ||
|
|
65bf36baa5 | ||
|
|
7598b77e75 | ||
|
|
a4132e2e64 | ||
|
|
8a66c820ab | ||
|
|
af0f81f71d | ||
|
|
ea1afac9db | ||
|
|
04aab233d0 | ||
|
|
33bc848c5b | ||
|
|
4c476bc872 | ||
|
|
9c2e270b3e | ||
|
|
0eef5610eb | ||
|
|
2a55d2b29a | ||
|
|
5416b9c09d | ||
|
|
7287300e0d | ||
|
|
ffeb0f9d4b | ||
|
|
10c9093942 | ||
|
|
b38cbfe173 | ||
|
|
702b09c859 | ||
|
|
2cd8ca4eb1 | ||
|
|
55b1403542 | ||
|
|
9d5ee16614 | ||
|
|
01bbf7e82f | ||
|
|
3ed5ddba31 | ||
|
|
6cacd1e320 | ||
|
|
d9cae81a0e | ||
|
|
83ee1feda4 | ||
|
|
c7610ba356 | ||
|
|
ae648778e2 | ||
|
|
023edffe3d | ||
|
|
2789bb0813 | ||
|
|
4d996e4c39 | ||
|
|
de2aa4f24a | ||
|
|
de95ca68f7 | ||
|
|
55878efe5d | ||
|
|
43f35fc7a9 | ||
|
|
d66ea08473 | ||
|
|
8476bf86a1 | ||
|
|
c92982d60f | ||
|
|
7a274d621a | ||
|
|
fdee0df849 | ||
|
|
00efa50385 | ||
|
|
a35803d502 | ||
|
|
7013039c3a | ||
|
|
925ad6393a | ||
|
|
3264d0c5be | ||
|
|
d9148e7b3f | ||
|
|
0a18d8912b | ||
|
|
815b326864 | ||
|
|
01bf034bb6 | ||
|
|
d716809228 | ||
|
|
8041627cc3 | ||
|
|
598e0af7af | ||
|
|
8ba57cf87b | ||
|
|
e2027aee15 | ||
|
|
97f6ae5267 | ||
|
|
fc9c7b4917 | ||
|
|
77a1a5c3e4 | ||
|
|
bc8bb7e942 | ||
|
|
08cd197bf1 | ||
|
|
4de0a5049b | ||
|
|
dc76e84657 | ||
|
|
1c2b35675e | ||
|
|
add0d698b7 | ||
|
|
09e95b2d91 | ||
|
|
03fd6f3af8 | ||
|
|
b92d35d1f2 | ||
|
|
9eeb1c8fb8 | ||
|
|
ad83ed22d9 | ||
|
|
3ddf6ff955 | ||
|
|
d04c0b7555 | ||
|
|
f13707fd1d | ||
|
|
ed9e5d7183 | ||
|
|
2fd497e3ef | ||
|
|
fd6308d6d3 | ||
|
|
1dbebbcadc | ||
|
|
57d1755d10 | ||
|
|
bace664fbc | ||
|
|
acd8809d71 | ||
|
|
7b7d2bf7c9 | ||
|
|
244de605a7 | ||
|
|
002652d263 | ||
|
|
08b770d425 | ||
|
|
2dffcf101f | ||
|
|
96fbdfbc7d | ||
|
|
272a953889 | ||
|
|
db310ac9b6 | ||
|
|
c11c688420 | ||
|
|
514cd9a099 | ||
|
|
406e5242a3 | ||
|
|
c26f58e783 | ||
|
|
5ad26f864a | ||
|
|
e7f39bc248 | ||
|
|
0242d84218 | ||
|
|
7275e11c4f | ||
|
|
77d140728d | ||
|
|
4d2ada60f5 | ||
|
|
382c9d792d | ||
|
|
aeb49a8013 | ||
|
|
c05c914eee | ||
|
|
c19f0c732e | ||
|
|
6ad3700a3d | ||
|
|
4f156aa6db | ||
|
|
6142ef87b5 | ||
|
|
da2fce90bd | ||
|
|
1e3cffbbd6 | ||
|
|
92c97c70d4 | ||
|
|
b77b1391c3 | ||
|
|
7e0c4e5726 | ||
|
|
50616148b0 | ||
|
|
3e40e5d4b5 | ||
|
|
2f9232a493 | ||
|
|
0d5fbfb91c | ||
|
|
56147434f3 | ||
|
|
21cb01e543 | ||
|
|
ea9aaee8c7 | ||
|
|
c22cd03f18 | ||
|
|
bd1c5d7c63 | ||
|
|
00b293bf70 | ||
|
|
76a960d73d | ||
|
|
97eb0e515f | ||
|
|
68010d931a | ||
|
|
c661506681 | ||
|
|
0dd2a55284 | ||
|
|
49fc528d88 | ||
|
|
928a24c204 | ||
|
|
d8031af030 | ||
|
|
f85648db68 | ||
|
|
b2e2c89b62 | ||
|
|
290d278f68 | ||
|
|
8edb096821 | ||
|
|
0a387d9d08 | ||
|
|
6c16744292 | ||
|
|
86a64b1bb5 | ||
|
|
1fd2354ad4 | ||
|
|
c8bc05b10e | ||
|
|
ee57cbfa66 | ||
|
|
bd1fcc5fe2 | ||
|
|
370406bb41 | ||
|
|
85844ee6ef | ||
|
|
e38e2c634b | ||
|
|
d80109dd5e | ||
|
|
b305911cba | ||
|
|
d60f95137e | ||
|
|
14ac47517b | ||
|
|
20058a1b63 | ||
|
|
f6dd0ad18a | ||
|
|
a7ae1766c0 | ||
|
|
faa46a3c71 | ||
|
|
03b168d0e3 | ||
|
|
2f6647687a | ||
|
|
c9e9964207 | ||
|
|
0a3a6441bc | ||
|
|
2eafe7bf58 | ||
|
|
08c51cfd45 | ||
|
|
b472f5a633 | ||
|
|
5806bf5249 | ||
|
|
90a90365a8 | ||
|
|
9cd30d4917 | ||
|
|
f33d8cae30 | ||
|
|
e471e2d462 | ||
|
|
fe38b78486 | ||
|
|
1af1f5c9f4 | ||
|
|
b9e83fe9f8 | ||
|
|
cb10b2b908 | ||
|
|
19dfd20a88 | ||
|
|
d12fdda15b | ||
|
|
3930a697e8 | ||
|
|
9322e1e6a4 | ||
|
|
b70fe38eab | ||
|
|
1c528db8da | ||
|
|
1c9ab8bf16 | ||
|
|
e295070193 | ||
|
|
91951ab22a | ||
|
|
5b0ab8be62 | ||
|
|
ecef093def | ||
|
|
6d6f5bd4a7 | ||
|
|
e3dbffc9f7 | ||
|
|
2225d54126 | ||
|
|
9115828e76 | ||
|
|
b43a72471a | ||
|
|
2b5d29b8c6 | ||
|
|
b40520b574 | ||
|
|
992533b91e | ||
|
|
f3e8991206 | ||
|
|
df7353b312 | ||
|
|
f311c0af87 | ||
|
|
c88fae3310 | ||
|
|
68cfb08888 | ||
|
|
4cff67fdde | ||
|
|
aefe26d216 | ||
|
|
8eb99e2a1d | ||
|
|
19b6f906cc | ||
|
|
c38ffdc741 | ||
|
|
a472f480a7 | ||
|
|
4416d9c941 | ||
|
|
c073c5ae54 | ||
|
|
fc0ddab349 | ||
|
|
c6dbcf91c3 | ||
|
|
8c7a38596d | ||
|
|
1c2d2a4027 | ||
|
|
1e5614b31b | ||
|
|
04b9b9c78b | ||
|
|
41ad376b70 | ||
|
|
1349c1d02c | ||
|
|
4c566c7903 | ||
|
|
73a07215cc | ||
|
|
bf091be778 | ||
|
|
103dd06347 | ||
|
|
1d4c1e0bfc | ||
|
|
b3fbb7c7ff | ||
|
|
225203d40d | ||
|
|
c2a0c78d9b | ||
|
|
97f4fe26f0 | ||
|
|
ef071255e5 | ||
|
|
afb6a5b86d | ||
|
|
a37cd9f0ef | ||
|
|
6f12992cea | ||
|
|
d88423eaae | ||
|
|
8b28de1313 | ||
|
|
8fa72fb7e7 | ||
|
|
b4babc2036 | ||
|
|
f2150d3f98 | ||
|
|
033376aec0 | ||
|
|
e33a0b6dbe | ||
|
|
0894587305 | ||
|
|
960e848cc7 | ||
|
|
b4737072a6 | ||
|
|
8507dd4bd0 | ||
|
|
62eeda3e9f | ||
|
|
06c806215e | ||
|
|
d2b25120f0 | ||
|
|
0c319f8b4b | ||
|
|
4fcc760158 | ||
|
|
0d5f918453 | ||
|
|
9c7940b599 | ||
|
|
ccfb1eb0f1 | ||
|
|
7e3a9c3aa6 | ||
|
|
a730b25ef9 | ||
|
|
500fef8314 | ||
|
|
29986e95a0 | ||
|
|
4af1da7d95 | ||
|
|
528b79b5f3 | ||
|
|
03a81aa9c5 | ||
|
|
4957c1121d | ||
|
|
d9d8eb2480 | ||
|
|
d9aad9212f | ||
|
|
8b636de1d3 | ||
|
|
aeab800490 | ||
|
|
f8c33e8630 | ||
|
|
b6efea266e | ||
|
|
8686cb3d3d | ||
|
|
91fff2a2c8 | ||
|
|
d6f43bd156 | ||
|
|
ebbe546033 | ||
|
|
cf0eed6c36 | ||
|
|
feacacc46d | ||
|
|
af53c56ec8 | ||
|
|
019d7b34ca | ||
|
|
622995fb12 | ||
|
|
03586c60da | ||
|
|
07a39e8e18 | ||
|
|
1d7c177606 | ||
|
|
2ae490cd8f | ||
|
|
6fda7a7057 | ||
|
|
1e2833e07b | ||
|
|
067b0a3367 | ||
|
|
24b10179a1 | ||
|
|
c14b581e0a | ||
|
|
bfcb4cd415 | ||
|
|
8fef94cd7d | ||
|
|
61d7ca4c41 | ||
|
|
559858a3dd | ||
|
|
ddd9c7a022 | ||
|
|
03c689c22c | ||
|
|
5270dd8b32 | ||
|
|
f33796bee1 | ||
|
|
e679c518b1 | ||
|
|
ba9214c689 | ||
|
|
68acc1dfc5 | ||
|
|
1a4ec6c2d3 | ||
|
|
6bb30978fb | ||
|
|
c0c30731c4 | ||
|
|
49eaa7c465 | ||
|
|
c2b199e926 | ||
|
|
80552aeab7 | ||
|
|
dfbabc0411 | ||
|
|
59b9b222c8 | ||
|
|
79e3eaf73c | ||
|
|
9106cc8ecc | ||
|
|
17fb6dfdc0 | ||
|
|
95f417fa9a | ||
|
|
49cb559c5b | ||
|
|
f26e88bb52 | ||
|
|
8875acf912 | ||
|
|
a025878466 | ||
|
|
9aaa835858 | ||
|
|
627f04e028 | ||
|
|
158388c5a6 | ||
|
|
3e45c9c5cf | ||
|
|
7165bd5c33 | ||
|
|
883373cd76 | ||
|
|
9536edfcc6 | ||
|
|
efa42e4a88 | ||
|
|
3e5fcec76c | ||
|
|
956fead2e1 | ||
|
|
aa09abe198 | ||
|
|
5aa1df37d1 | ||
|
|
ca2c808f69 | ||
|
|
d87c357abe | ||
|
|
ccffc548e1 | ||
|
|
83b89a49ef | ||
|
|
87a254400e | ||
|
|
9192b7fe8c | ||
|
|
5dee9fb2c6 | ||
|
|
f0c65bc988 | ||
|
|
5f4d759679 | ||
|
|
ec7b20eec6 | ||
|
|
edf230b7df | ||
|
|
0eefd2c326 | ||
|
|
f390eb8da0 | ||
|
|
9f4b4c975a | ||
|
|
0293eac1d1 | ||
|
|
0172cb0e83 | ||
|
|
56f067a284 | ||
|
|
660584c1ea | ||
|
|
e198c85053 | ||
|
|
05e2a6d259 | ||
|
|
21d9bd1107 | ||
|
|
5864d97590 | ||
|
|
3ac37642c8 | ||
|
|
b42887fe14 | ||
|
|
4172268bd2 | ||
|
|
a9f79a6130 | ||
|
|
115aeda69b | ||
|
|
17cf833b9c | ||
|
|
aaab6e57e0 | ||
|
|
fbd817fb94 | ||
|
|
e3e3f655ee | ||
|
|
3129ff687a | ||
|
|
1d3d30776a | ||
|
|
2fae87d9a5 | ||
|
|
a5b3f00d78 | ||
|
|
1bffa17c01 | ||
|
|
a151167416 | ||
|
|
6a2032f5b0 | ||
|
|
d3bd855c9d | ||
|
|
bd3f156044 | ||
|
|
3b21659661 | ||
|
|
bf64386717 | ||
|
|
1b902d6267 | ||
|
|
619044e83d | ||
|
|
e0e788e218 | ||
|
|
a617d9c05e | ||
|
|
99e6293cd0 | ||
|
|
286b6a9088 | ||
|
|
27e07d2af5 | ||
|
|
1228b2c05b | ||
|
|
d6a04b8a62 | ||
|
|
fbb6208d15 | ||
|
|
c0285682e4 | ||
|
|
60da39cdf7 | ||
|
|
2e75c22759 | ||
|
|
9576eb62e6 | ||
|
|
f9fe9a7d57 | ||
|
|
8bf5e58f37 | ||
|
|
f6fdeeb3af | ||
|
|
e65352bc8a | ||
|
|
c8f530af93 | ||
|
|
c9d1936f02 | ||
|
|
faf5227bc5 | ||
|
|
bc33539b11 | ||
|
|
906ada8fe7 | ||
|
|
a878f5f183 | ||
|
|
5cbaf5903b | ||
|
|
f7c3e1cac2 | ||
|
|
d7d3a87624 | ||
|
|
c03ce956c8 | ||
|
|
eedec06cc4 | ||
|
|
cdcd365d34 | ||
|
|
2535f51e01 | ||
|
|
58404e4ba2 | ||
|
|
36df5ceef6 | ||
|
|
3d82986725 | ||
|
|
04a230f933 | ||
|
|
71e452aef2 | ||
|
|
18bdde4aa4 | ||
|
|
0cc3da5d5e | ||
|
|
b7f1136342 | ||
|
|
2503503a2a | ||
|
|
2cd21da4f0 | ||
|
|
681f042326 | ||
|
|
73aa48b772 | ||
|
|
6698659149 | ||
|
|
06b449b22c | ||
|
|
fe9cf6f399 | ||
|
|
21edf7bb90 | ||
|
|
5e4f16da44 | ||
|
|
81b29d9a21 | ||
|
|
8ddc5e7b93 | ||
|
|
c6ec435ae9 | ||
|
|
8a5b4f616b | ||
|
|
9cbe6a640c | ||
|
|
c918c6563b | ||
|
|
577f7fafa9 | ||
|
|
338807a327 | ||
|
|
a7c158d07d | ||
|
|
97e9849d6c | ||
|
|
be4a3f8273 | ||
|
|
433c7e5dc6 | ||
|
|
9d6d5b679a | ||
|
|
f1b9ba2781 | ||
|
|
318ed6b105 | ||
|
|
402cf718c4 | ||
|
|
7b3649abc9 | ||
|
|
937c47898a | ||
|
|
cc0a3d8490 | ||
|
|
e666f8c50d | ||
|
|
05238f31f4 | ||
|
|
e21e954742 | ||
|
|
e2556274f7 | ||
|
|
e0c4f9c5fe | ||
|
|
eb871e72f5 | ||
|
|
3c8647e713 | ||
|
|
ae8df00b92 | ||
|
|
9f1a44d9e3 | ||
|
|
3ea8f42c7f | ||
|
|
02153402ec | ||
|
|
b26aaa7e42 | ||
|
|
9330aa60a5 | ||
|
|
30f3c53305 | ||
|
|
133ed4e21d | ||
|
|
53f4a9f5a8 | ||
|
|
b97c36c218 | ||
|
|
3e1d2b9049 | ||
|
|
907ba3a2e2 | ||
|
|
981b414980 | ||
|
|
06b1fcad13 | ||
|
|
92b8d6fb24 | ||
|
|
0b33ab552b | ||
|
|
2faad1230a | ||
|
|
bfe418febb | ||
|
|
41ed690791 | ||
|
|
553b7af355 | ||
|
|
2815eaa5f8 | ||
|
|
5c5fefc8cf | ||
|
|
8aeb8434d6 | ||
|
|
36ec76a508 | ||
|
|
eb2661dc2d | ||
|
|
c2518dd5f0 | ||
|
|
34a20f8839 | ||
|
|
6f185d3022 | ||
|
|
c5b8f52c07 | ||
|
|
bcdc90e85f | ||
|
|
f5c6246433 | ||
|
|
086b85215f | ||
|
|
dac0aa1d89 | ||
|
|
04013fb7fa | ||
|
|
a101b30fa8 | ||
|
|
0bffd99dcb | ||
|
|
4c075f3771 | ||
|
|
0ccdaff960 | ||
|
|
2d50c4f257 | ||
|
|
6a9e2a4d3e | ||
|
|
ff1bf88562 | ||
|
|
6414f9f000 | ||
|
|
2246029447 | ||
|
|
503654e60e | ||
|
|
e393a6c345 | ||
|
|
9d7930328b | ||
|
|
111b30008a | ||
|
|
ec295f5e68 | ||
|
|
4b5b66a806 | ||
|
|
aa1ae0a144 | ||
|
|
dbe39901b2 | ||
|
|
fc7eb69b70 | ||
|
|
023fccb966 | ||
|
|
ea4e9b3156 | ||
|
|
7ba356a62c | ||
|
|
cb17732ac2 | ||
|
|
d851ccdd41 | ||
|
|
da9ea91b37 | ||
|
|
54217ea500 | ||
|
|
ba38d61f22 | ||
|
|
4a9b97b101 | ||
|
|
28b4bd7932 | ||
|
|
dea708bf94 | ||
|
|
d92eb4fee3 | ||
|
|
5cda85caaa | ||
|
|
5cb3f09a78 | ||
|
|
686b784d04 | ||
|
|
33a6f6a1b6 | ||
|
|
284877104f | ||
|
|
5d1752c5e3 | ||
|
|
523bc0fd4f | ||
|
|
06ea93be3e | ||
|
|
5022e47940 | ||
|
|
c709c104a1 | ||
|
|
532d73ccc7 | ||
|
|
29cac04afc | ||
|
|
c98afde096 | ||
|
|
400e7ce13f | ||
|
|
b834ed3b28 | ||
|
|
23b8dfd98e | ||
|
|
f9d6aa9ba3 | ||
|
|
e258cc3e95 | ||
|
|
f45a2938e3 | ||
|
|
7561b1b026 | ||
|
|
5fe838b072 | ||
|
|
51743233ed | ||
|
|
108fe330d3 | ||
|
|
38b74e6993 | ||
|
|
7f3dc2de46 | ||
|
|
344fe558b6 | ||
|
|
6fc70cc474 | ||
|
|
3660c62bc0 | ||
|
|
4b2751c3b9 | ||
|
|
8704dde873 | ||
|
|
2f817a6740 | ||
|
|
b55e8d7b34 | ||
|
|
730b46c139 | ||
|
|
f150894d4e | ||
|
|
b8a47f4e37 | ||
|
|
b3b2fa8856 | ||
|
|
4ddf194004 | ||
|
|
036c5f9c1f | ||
|
|
e2b6572e9a | ||
|
|
1ef62490dd | ||
|
|
311f0e8734 | ||
|
|
9f93b33d29 | ||
|
|
e291131d0a | ||
|
|
fc1edf28ce | ||
|
|
3dee81bfaa | ||
|
|
01888abb22 | ||
|
|
90cffe3fd0 | ||
|
|
a6740ba3fd | ||
|
|
e753cd1c38 | ||
|
|
7098dd0cd0 | ||
|
|
988274bb70 | ||
|
|
19bc63db28 | ||
|
|
8866f728a2 | ||
|
|
7070812004 | ||
|
|
43040220bf | ||
|
|
8fea3472a9 | ||
|
|
8fbb922868 | ||
|
|
6ed6462154 | ||
|
|
57c50baa61 | ||
|
|
4712fc0615 | ||
|
|
63d59656d3 | ||
|
|
f72e16502e | ||
|
|
fa82824a59 | ||
|
|
3cb80ff7ea | ||
|
|
af40fb65ae | ||
|
|
4e8d2d6223 | ||
|
|
c5fedaa043 | ||
|
|
1786484486 | ||
|
|
d08d72a05d | ||
|
|
6e37723fbe | ||
|
|
b8aae4d872 | ||
|
|
fb7f7011ec | ||
|
|
8a5ae2130b | ||
|
|
04262f09a4 | ||
|
|
ed296525f4 | ||
|
|
837b4e66e2 | ||
|
|
2994ea9d02 | ||
|
|
2f63e8dfc1 | ||
|
|
b0bdfbb0f7 | ||
|
|
6a4d3aad80 | ||
|
|
8a244c607a | ||
|
|
90f1ccf9ac | ||
|
|
c02c182bd7 | ||
|
|
2070d3a26f | ||
|
|
ce32cb0f6b | ||
|
|
3df1a3f0f4 | ||
|
|
83975027e5 | ||
|
|
e39423b49d | ||
|
|
04669b5635 | ||
|
|
85e166b0f2 | ||
|
|
773fc447df | ||
|
|
717e697e0b | ||
|
|
a24aee417d | ||
|
|
275e9f0092 | ||
|
|
68d94a0c74 | ||
|
|
07f71e6c1a | ||
|
|
c2148cc902 | ||
|
|
1fba31e7b5 | ||
|
|
3e7591f534 | ||
|
|
07441adb14 | ||
|
|
3522751c6b | ||
|
|
2134212fa9 | ||
|
|
e74a4c26c0 | ||
|
|
4d53694a27 | ||
|
|
c3b9d29502 | ||
|
|
812f986f2e | ||
|
|
a69460001e | ||
|
|
2146942248 | ||
|
|
162d534ff6 | ||
|
|
9f98333dce | ||
|
|
486e828443 | ||
|
|
3b8989b0a9 | ||
|
|
761fa7cd3a | ||
|
|
16c037fdb0 | ||
|
|
6fef9208da | ||
|
|
f5eb316603 | ||
|
|
a9a32d6d89 | ||
|
|
287f78a26b | ||
|
|
8a2dd978f8 | ||
|
|
6a002f5196 | ||
|
|
7dd1030b15 | ||
|
|
e085ebb872 | ||
|
|
27e1e83e8c | ||
|
|
0dec394303 | ||
|
|
6a0ae5aaa2 | ||
|
|
3ed08c568f | ||
|
|
7c0e433305 | ||
|
|
c115166f5b | ||
|
|
9d8c72951f | ||
|
|
818a39cfb9 | ||
|
|
f4f9954556 | ||
|
|
814a4220a2 | ||
|
|
801b3ce675 | ||
|
|
acf19bde22 | ||
|
|
0f64fe0af2 | ||
|
|
e86dc0381c | ||
|
|
5fa5ccff43 | ||
|
|
9703934479 | ||
|
|
56cfab3df6 | ||
|
|
2163d961a1 | ||
|
|
16ba6df68c | ||
|
|
706f01422d | ||
|
|
6c0e5e3f2c | ||
|
|
8d005c8743 | ||
|
|
e540053eb3 | ||
|
|
ef16a2a250 | ||
|
|
15947ac871 | ||
|
|
f3a1d7ba06 | ||
|
|
568d2a389c | ||
|
|
ec3cd1eeae | ||
|
|
813f9f72d0 | ||
|
|
0db28259ad |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,6 +1,9 @@
|
||||
*~
|
||||
*.bak
|
||||
*.o
|
||||
*.orig
|
||||
*.patch
|
||||
*.swp
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
@@ -26,9 +29,11 @@ core
|
||||
/configure
|
||||
/depcomp
|
||||
/install-sh
|
||||
/intl
|
||||
/missing
|
||||
/mkinstalldirs
|
||||
/stamp-h1
|
||||
|
||||
/nano.spec
|
||||
/src/nano
|
||||
/src/revision.h
|
||||
|
||||
21
AUTHORS
21
AUTHORS
@@ -1,9 +1,9 @@
|
||||
This file lists people who have made significant contributions to the
|
||||
nano editor. Please see the ChangeLog for specific changes by author.
|
||||
-------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Chris Allegretta <chrisa@asty.org>
|
||||
* Original program author, former and current maintainer.
|
||||
* Original program author and long-time maintainer.
|
||||
|
||||
David Lawrence Ramsey <pooka109@gmail.com>
|
||||
* Former stable series maintainer. Multiple buffer support,
|
||||
@@ -39,11 +39,24 @@ Mike Frysinger <vapier@gentoo.org>
|
||||
* Gentoo package maintainer. Whitespace display mode,
|
||||
--enable-utf8/--disable-utf8 configure options for ncurses,
|
||||
many new color regexes and improvements to existing color
|
||||
regexes for nanorc.sample, and miscellaneous bug fixes.
|
||||
regexes in syntax/*.nanorc, and miscellaneous bug fixes.
|
||||
|
||||
Mark Majeres <mark@engine12.com>
|
||||
* A functional undo/redo system, and coloring nano's interface.
|
||||
|
||||
Mahyar Abbaspour <mahyar.abaspour@gmail.com>
|
||||
* Improved handling of SIGWINCH.
|
||||
|
||||
Mike Scalora <mike@scalora.org>
|
||||
* The comment/uncomment feature.
|
||||
|
||||
Faissal Bensefia <faissaloo@gmail.com>
|
||||
* Line numbers.
|
||||
|
||||
Sumedh Pendurkar <sumedh.pendurkar@gmail.com>
|
||||
* The word-completion feature.
|
||||
|
||||
Benno Schulenberg <bensberg@justemail.net>
|
||||
* A bunch of small bug fixes, the cutword routines, some extra
|
||||
* An array of small bug fixes, the cut-word and block-jump
|
||||
routines, text selection by holding Shift, and some extra
|
||||
key bindings. Current maintainer.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
4010
ChangeLog.2007-2015
Normal file
4010
ChangeLog.2007-2015
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,50 @@
|
||||
GNU nano upgrading information
|
||||
==============================
|
||||
Improvements in GNU nano
|
||||
========================
|
||||
|
||||
Since 2.7.0:
|
||||
- The keystroke ^] to complete a fragment to an existing full word.
|
||||
- The ability to display line numbers in front of the text (M-#).
|
||||
|
||||
Since 2.6.0:
|
||||
- Shift plus the cursor keys can be used for selecting text.
|
||||
- Ctrl+Arrow should now work also on a Linux virtual console.
|
||||
- Ctrl+Up and Ctrl+Down jump to previous or next block of text.
|
||||
- Feedback during Unicode Input (M-V followed by six digits).
|
||||
- The option 'wordchars' for specifying extra word characters.
|
||||
- Hi-bit control characters are shown in a more readable manner.
|
||||
- The ability to use negative numbers at the Go To Line prompt.
|
||||
|
||||
Noteworthy changes since 2.2
|
||||
----------------------------
|
||||
- The ability to comment/uncomment lines with a single keystroke (M-3).
|
||||
- The ability to refresh the file list in the browser (^L).
|
||||
- The ability to abort re-searches (^C after an M-W).
|
||||
- Better feedback at startup when opening large or multiple files.
|
||||
- The option 'justifytrim' for snipping whitespace from justified lines.
|
||||
- The ability to discard a buffer (^O ^Q) when --tempfile is used.
|
||||
- Replacing things in a marked region now takes place in situ, in context,
|
||||
instead of changing the view to only the marked text.
|
||||
- On some terminals Ctrl+Left / Ctrl+Right now work for PrevWord/NextWord.
|
||||
- When in the middle of a word, PrevWord now jumps to the start of this
|
||||
word (like Pico does) instead of to the start of the preceding word.
|
||||
- Invalid byte sequences are properly displayed and not mistakenly found.
|
||||
- Resizing the window does not exit from help viewer nor file browser.
|
||||
- Improved arrangement of the shortcuts in the two help lines.
|
||||
- Several small bug fixes in the syntax highlighting.
|
||||
- System syntaxes can be improved upon with the 'extendsyntax' command.
|
||||
- The ability to delete whole words with 'cutwordleft' and 'cutwordright'.
|
||||
- The ability to save a file without prompting for its name ('savefile').
|
||||
- The ability to search backward without having to toggle the direction.
|
||||
- Whitespace display (M-P) does not require configuration to be useful.
|
||||
- Undo/redo is enabled by default (M-U/M-E) and works nearly everywhere
|
||||
-- just not yet for justifying and indenting/unindenting.
|
||||
- The ability to color the title bar, the status bar and the help lines.
|
||||
- The ability to run a linter or formatter (^T) on the current buffer.
|
||||
- The ability to only write to named pipes with --noread.
|
||||
- Determination of the applicable syntax through libmagic -- when the
|
||||
file extension nor the first line give an answer.
|
||||
- The option 'positionlog' for saving/restoring the cursor position.
|
||||
- The ability to read and write vim-style lock files.
|
||||
|
||||
Visible changes since 2.0
|
||||
-------------------------
|
||||
@@ -108,4 +153,4 @@ Visible changes since 1.0
|
||||
- Creation of backup files (-B).
|
||||
- Search/replace history (-H).
|
||||
|
||||
See the GNU nano manual for detailed information on each feature.
|
||||
See the nano manual for detailed information on each feature.
|
||||
@@ -1,8 +1,12 @@
|
||||
## $Id$
|
||||
AUTOMAKE_OPTIONS = gnu no-dependencies
|
||||
|
||||
SUBDIRS = doc m4 po src
|
||||
|
||||
EXTRA_DIST = ChangeLog.pre-2.1 README.SVN UPGRADE nano.spec
|
||||
if USE_COLOR
|
||||
SUBDIRS += syntax
|
||||
endif
|
||||
|
||||
EXTRA_DIST = ChangeLog.1999-2006 ChangeLog.2007-2015 \
|
||||
IMPROVEMENTS README.GIT nano.spec
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
180
NEWS
180
NEWS
@@ -1,9 +1,124 @@
|
||||
2017.02.23 - GNU nano 2.7.5 "Nijntje" can properly search and replace
|
||||
the \B and \b regex anchors, correctly repaints things
|
||||
when multiline regexes with identical start and end are
|
||||
involved, fixes a crash with zero-length regex matches,
|
||||
does replacements at the edges of a marked region right,
|
||||
no longer hides double-width characters at the head of
|
||||
softwrapped rows, displays at most three warnings at
|
||||
startup, and documents the ability to read a file from
|
||||
standard input. Come tickle my ears.
|
||||
|
||||
2017.01.10 - GNU nano 2.7.4 "Red dress" undoes deletions in an orderly
|
||||
manner again (bug was introduced in previous version),
|
||||
sets the preferred x position for vertical movements
|
||||
more consistently, avoids some scrolling problems in
|
||||
softwrap mode, installs the Info manual also when your
|
||||
system lacks 'makeinfo', and corrects the behavior of
|
||||
the beginning-of-word anchor (\<) in regex searches.
|
||||
|
||||
2016.12.28 - GNU nano 2.7.3 "Ontbijtkoek" wipes away a handful of bugs:
|
||||
your editor is now able to handle filenames that contain
|
||||
newlines, avoids a brief flash of color when switching
|
||||
between buffers that are governed by different syntaxes,
|
||||
makes the Shift+Ctrl+Arrow keys select text again on a
|
||||
Linux console, is more resistant against malformations
|
||||
in the positionlog file, and does not crash when ^C is
|
||||
typed on systems where it produces the code KEY_CANCEL.
|
||||
Oh, and it no longer mistakenly warns about editing an
|
||||
unlocked file just after saving a new one. That's it.
|
||||
Tastes great with thick butter.
|
||||
|
||||
2016.12.12 - GNU nano 2.7.2 "Shemesh! Shemesh!" brings another feature:
|
||||
the ability to complete with one keystroke (^] by default)
|
||||
a fragment of a word to a full word existing elsewhere in
|
||||
the current buffer. Besides, this release fixes two bugs
|
||||
related to using line numbers in softwrap mode, allows to
|
||||
use the PageUp and PageDown keys together with Shift on
|
||||
VTE-based terminals, stops the help lines from flickering
|
||||
during interactive replacing, makes a "set fill" override
|
||||
an earlier "set nowrap", properly restores the selected
|
||||
region after an external spell check, and improves a few
|
||||
other tidbits. If you should find any more bugs, please
|
||||
run 'man nano | grep bugs' and report them there.
|
||||
|
||||
2016.10.29 - GNU nano 2.7.1 "Leuven" adds an often-asked-for feature: the
|
||||
ability to display line numbers beside the text. This can
|
||||
be activated with -l or --linenumbers on the command line,
|
||||
or with 'set linenumbers' in your nanorc, or toggled with
|
||||
M-#. The coloring of these numbers can be chosen via the
|
||||
option 'set numbercolor'. This release furthermore fixes
|
||||
some bugs with scrolling in softwrap mode, is more strict
|
||||
in the parsing of key rebindings, and marks a new buffer
|
||||
as modified when the output of a command (^R ^X) has been
|
||||
read into it. Come and check it out!
|
||||
|
||||
2016.09.01 - GNU nano 2.7.0 "Suni" adds a new feature: allowing text to be
|
||||
selected by holding Shift together with the cursor keys.
|
||||
Besides that, nano now works also when run in very tiny
|
||||
terminals (down to one line, one column), and improves
|
||||
the handling of the prompt in cramped spaces. Not much,
|
||||
but it's time to get it out there.
|
||||
|
||||
|
||||
2016.08.10 - nano 2.6.3 "Marika" makes the Ctrl+Arrow keys work also on
|
||||
a Linux virtual console, takes as verbatim only the very
|
||||
first keystroke after M-V, removes any lock files that it
|
||||
holds when dying, doesn't abort when a word contains digits
|
||||
(when using the default speller), fixes a small sorting bug
|
||||
in the file browser, makes searching case-insensitively in
|
||||
a UTF-8 locale a little faster, and doesn't enter invalid
|
||||
bytes when holding down both Alt keys. Santé!
|
||||
|
||||
2016.07.28 - nano 2.6.2 "Le vent nous portera" adds two new features: the
|
||||
keystrokes Ctrl+Up and Ctrl+Down for jumping between blocks
|
||||
of text, and the option 'wordchars' for specifying which
|
||||
characters (beside alphanumeric ones) should be considered
|
||||
word-forming. Further, it provides feedback during Unicode
|
||||
input (M-V followed by a six-digit hexadecimal number which
|
||||
must start with 0 or 10), avoids a crash when resizing the
|
||||
window during Verbatim input, doesn't drop a keystroke after
|
||||
having been suspended, and replaces the beginning-of-line
|
||||
anchor (^) just once per line. There are also several tiny
|
||||
improvements in screen rendering and key handling. Come get
|
||||
your hair tousled!
|
||||
|
||||
2016.06.27 - nano 2.6.1 "Stampede" is chiefly a translation update, but also
|
||||
adds one little feature (the ability to use negative numbers
|
||||
with Go To Line: -1 meaning the first line from the bottom),
|
||||
includes syntax highlighting for Rust, and fixes three tiny
|
||||
bugs (but in such far corners of the editor that they aren't
|
||||
even worth mentioning).
|
||||
|
||||
2016.06.17 - nano 2.6.0 "Rubicon" fixes more than fifty little bugs -- and
|
||||
some of them not so little. It improves moving about in
|
||||
the file browser, corrects failings of the internal spell
|
||||
checker, adds a new feature (comment/uncomment lines, with
|
||||
default binding M-3), makes some error messages clearer,
|
||||
shows more of a file when positionlog is used and the cursor
|
||||
is near the end, displays all error messages at startup if
|
||||
there are multiple ones, does not misinterpret keystrokes
|
||||
when typing very fast, is less eager to trim the filename
|
||||
on narrow terminals, speeds up case-insensitive searches,
|
||||
and allows to abort re-searches. Among bunches of other
|
||||
things. It is worth the trouble to upgrade.
|
||||
|
||||
|
||||
2016.02.25 - GNU nano 2.5.3 "Alphys" is released. This release
|
||||
contains fixes for bugs like: stray cursor positioning
|
||||
errors, many many memory leaks including file reading,
|
||||
using the file browser, searching for multibyte characters,
|
||||
history completion, and many other places.
|
||||
New features include the ability to trim whitespace
|
||||
from the ends of lines when justifying text, see nanorc(5)
|
||||
option justifytrim for deets. As always thank you for your
|
||||
continued support of nano, and keep sparing.
|
||||
|
||||
2016.02.12 - GNU nano 2.5.2 is carrying too many dogs. This release includes
|
||||
several fixes for various memory leaks, position history
|
||||
size growth, and a long standing issue with using
|
||||
nano under sudo creading root-owned files. There are also
|
||||
nano under sudo creating root-owned files. There are also
|
||||
the usual bevy of documentation and other miscellaneous
|
||||
fixes and touch ups. Upgrade today while supplies last,
|
||||
fixes and touchups. Upgrade today while supplies last,
|
||||
operators are standing by!
|
||||
|
||||
2016.01.11 - GNU nano 2.5.1 "Salzburg" is released. It includes fixes
|
||||
@@ -26,6 +141,7 @@
|
||||
undo fixes, and many more improvements! Thank you for
|
||||
using nano!
|
||||
|
||||
|
||||
2015.11.18 - GNU nano 2.4.3 "Apocalypse" is now available for your
|
||||
downloading pleasure. This release includes a myriad
|
||||
of fixes including several memory leaks, issues with
|
||||
@@ -97,7 +213,7 @@
|
||||
2014.07.17 - GNU nano 2.3.6 "Columbo" is released. This release
|
||||
contains a fix for installing internationalization
|
||||
files. Also included are scattered documentation
|
||||
(in particular man page) fixes, and a few touch ups
|
||||
(in particular man page) fixes, and a few touchups
|
||||
to syntax highlighting definitions. Oh, just one
|
||||
more thing, thanks for using nano!
|
||||
|
||||
@@ -116,7 +232,7 @@
|
||||
|
||||
2014.06.02 - GNU nano 2.3.4 won't leave you high, won't leave you dry. This
|
||||
release contains only a small number of fixes, but in
|
||||
particular allows nano to compile on non-UTF8 curses
|
||||
particular allows nano to compile on non-UTF-8 curses
|
||||
implementations (i.e. libncursesw). Other small fixes to
|
||||
the undo implementation and the default syntax config are
|
||||
also included. As always, Share and Enjoy!
|
||||
@@ -130,7 +246,7 @@
|
||||
linter support (see the nanorc man page for details). Also
|
||||
included are much improved syntax highlighting code, and
|
||||
configurations for JSON, texinfo, Go, and a default syntax
|
||||
for catch all highlighting. Finally, nano now has the
|
||||
for catch-all highlighting. Finally, nano now has the
|
||||
ability to set the color of the title bar, status bar, and
|
||||
shortcut keys (e.g. "^X") and their descriptions. Again
|
||||
see the nanorc page for details. There's much more, too
|
||||
@@ -152,7 +268,7 @@
|
||||
release includes some fixes for the new libmagic code, as
|
||||
well as a fix for improper character counts when using
|
||||
auto-indent. Also included are new syntax highlighting
|
||||
definitions for RPM spec and lua files. Thanks for
|
||||
definitions for RPM spec and Lua files. Thanks for
|
||||
using nano and keep circulating the tapes.
|
||||
|
||||
2011.02.26 - GNU nano 2.3.0 "Septic surprise" is released. This first
|
||||
@@ -168,6 +284,7 @@
|
||||
for the "set allow_insecure_backup" nanorc option.
|
||||
Don't stop, get it get it, don't stop, get it get it.
|
||||
|
||||
|
||||
2010.11.22 - GNU nano 2.2.6 "Pimp my BBS" wants you to go to
|
||||
www.desertbus.org and donate a few bucks for the great
|
||||
Child's Play Charity! This is just a small release to
|
||||
@@ -263,6 +380,7 @@
|
||||
stable release, and apologies for all those bugs we
|
||||
didn't yet find :-) Peace to all.
|
||||
|
||||
|
||||
2009.11.21 - GNU nano 2.1.99pre2 is available for a special pre-Black
|
||||
Friday discount. Included are some (hopefully
|
||||
final) fixes for issues with last page display
|
||||
@@ -429,7 +547,8 @@
|
||||
https://savannah.gnu.org/bugs/?group=nano and
|
||||
thanks for sticking with us!
|
||||
|
||||
2007.12.20- GNU nano 2.0.7 keeps its balance. This release fixes
|
||||
|
||||
2007.12.20 - GNU nano 2.0.7 keeps its balance. This release fixes
|
||||
several bugs, among others: a segfault and several
|
||||
cursor positioning problems when uncutting text or
|
||||
inserting files into the current buffer; a problem where
|
||||
@@ -451,12 +570,12 @@
|
||||
under the GNU GPL version 3 or later and the GNU FDL
|
||||
version 1.2 or later. Have fun.
|
||||
|
||||
2007.04.26- GNU nano 2.0.6 "that was quick" is released. This release
|
||||
2007.04.26 - GNU nano 2.0.6 "that was quick" is released. This release
|
||||
fixes a potential segfault after justifying text marked
|
||||
from the bottom up. It also adds one more minor
|
||||
documentation update. Enjoy.
|
||||
|
||||
2007.04.22- GNU nano 2.0.5 braces for impact. Among other things, this
|
||||
2007.04.22 - GNU nano 2.0.5 braces for impact. Among other things, this
|
||||
release fixes various problems (including a segfault)
|
||||
when trying to open or save a file in a directory
|
||||
beginning with "~" that isn't a home directory; fixes a
|
||||
@@ -517,6 +636,7 @@
|
||||
color syntaxes. See the UPGRADE file for more
|
||||
information, and enjoy the new stable release.
|
||||
|
||||
|
||||
2006.10.25 - GNU nano 1.9.99pre3 learns to appreciate life. This
|
||||
release fixes a bug where the screen sometimes wouldn't
|
||||
be updated properly after copying text into the
|
||||
@@ -563,7 +683,7 @@
|
||||
properly at all times; lines of text containing tabs are
|
||||
now wrapped at the right place; double-column characters
|
||||
are now properly displayed when past the right edge of
|
||||
the screen; invalid multi-line color regexes are now
|
||||
the screen; invalid multiline color regexes are now
|
||||
ignored; and so on. Enjoy.
|
||||
|
||||
2006.03.30 - GNU nano 1.3.11 awakens from its fever dream. This release
|
||||
@@ -775,6 +895,7 @@
|
||||
display routines to make them behave more intuitively.
|
||||
It also includes the usual load of bugfixes. Enjoy.
|
||||
|
||||
|
||||
2003.08.11 - GNU nano 1.2.2 is released, only four months since the
|
||||
last version :-). This release includes fixes for
|
||||
broken regex detection, search history recall, and
|
||||
@@ -802,6 +923,7 @@
|
||||
much more. Please read the UPGRADE file for details,
|
||||
and enjoy GNU nano 1.2.0.
|
||||
|
||||
|
||||
2003.02.13 - GNU nano 1.1.99pre3 "The last testing version, no
|
||||
really!" is released. This release includes fixes for
|
||||
wrapping (again), resizing, color syntax highlighting,
|
||||
@@ -899,7 +1021,7 @@
|
||||
0.11.2 of gettext, building with automake 1.6, some new
|
||||
code for displaying control characters, browser
|
||||
improvements, a new backup file option (-B, --backup), a
|
||||
new option to ignore rc files (-I,--ignorercfiles),
|
||||
new option to ignore rc files (-I, --ignorercfiles),
|
||||
compatibility with -pedantic, handling null characters
|
||||
before EOF, a slightly sportier nanorc.sample and more.
|
||||
Fixes are included for justification,
|
||||
@@ -933,19 +1055,19 @@
|
||||
Also, the "show position" code now shows the starting
|
||||
column as 1 instead of 0. Have fun!
|
||||
|
||||
2002.03.05 - GNU nano 1.1.7 "lets change everything and see what breaks"
|
||||
is released. New features include new flags
|
||||
-N, --noconvert to stop any file format conversion and
|
||||
-Q, --quotestr for the new quoted text justification, a
|
||||
new tempnam() implementation to avoid silly warnings,
|
||||
2002.03.05 - GNU nano 1.1.7 "let's change everything and see what breaks"
|
||||
is released. New features include the new flags
|
||||
-N, --noconvert (to stop any file format conversion) and
|
||||
-Q, --quotestr (for the new quoted text justification),
|
||||
a new tempnam() implementation to avoid silly warnings,
|
||||
DOS and Mac file options in the Write File dialog,
|
||||
multiple save files (file.1) for abnormal exits, ^C now
|
||||
shows column as well as character position, and
|
||||
multibuffer allows duplicate files, even unnamed ones.
|
||||
Also, the static shortcut and toggle lengths are
|
||||
history, nano now reads SYSCONFDIR/nanorc if rc file
|
||||
support is enabled, and nano is now built with (and
|
||||
requires for rebuilding) autoconf 2.5.
|
||||
multiple save files (file.1) for abnormal exits,
|
||||
^C now showing column as well as character position, and
|
||||
multibuffer allowing duplicate files, even unnamed ones.
|
||||
Also, the static shortcut and toggle lengths are history,
|
||||
nano now reads SYSCONFDIR/nanorc if rc file support is
|
||||
enabled, and nano is now built with (and for rebuilding
|
||||
requires) autoconf 2.5.
|
||||
This release also includes fixes for some memory
|
||||
leaks, detecting DOS and Mac file format, justification,
|
||||
suspending keys, search & replace under various
|
||||
@@ -1053,6 +1175,7 @@
|
||||
introduce lots of bugs ;-) Have fun with it, but be
|
||||
careful, unstable means unstable.
|
||||
|
||||
|
||||
2001.07.01 - GNU nano 1.0.3 is the "mutt" release. This release
|
||||
features oodles of bug fixes with cutting text,
|
||||
especially with the -k (cut to end) option. There is
|
||||
@@ -1093,6 +1216,7 @@
|
||||
this first stable release of nano, and as always,
|
||||
feedback is welcome! nano@nano-editor.org.
|
||||
|
||||
|
||||
2001.02.19 - Nano 0.9.99pre3 brings a lot of changes! The most
|
||||
important being that nano is now officially a GNU
|
||||
program. Some changes have been made for GNU
|
||||
@@ -1126,7 +1250,7 @@
|
||||
nasty segfault when trying to insert one's home
|
||||
directory (~), some checks for the NumLock key making
|
||||
the keypad go awry, window size sanity checks, many
|
||||
autoconf fixes, and support for the KDE konsole keypad
|
||||
autoconf fixes, and support for the KDE Konsole keypad
|
||||
layout. Have fun.
|
||||
|
||||
2001.01.07 - Nano 0.9.25 is the "Just one more feature I swear!"
|
||||
@@ -1219,7 +1343,7 @@
|
||||
New features include better (not yet perfect) binary
|
||||
display support and toggle support for most of the
|
||||
program flags (M-c, M-i, M-z, M-x, M-p, M-w, M-m, M-k
|
||||
and M-e for -c, -i, -x, -p, -w, -k, and -R).
|
||||
and M-e for -c, -i, -z, -x, -p, -w, -m, -k, and -R).
|
||||
|
||||
2000.08.09 - Nano 0.9.16, after some struggling, is released. This
|
||||
release should fix a few of the holes that 0.9.15 dug.
|
||||
@@ -1254,8 +1378,8 @@
|
||||
other major changes, this should be the feature set for
|
||||
nano 1.0, whenever it might be released =-)
|
||||
|
||||
2000.07.07 - Nano 0.9.12 (The "lucky day" release) is bursting with new
|
||||
features, bug fixes, and yummy fruit flavor. For
|
||||
2000.07.07 - Nano 0.9.12 (the "lucky day" release) is bursting with
|
||||
new features, bug fixes, and yummy fruit flavor. For
|
||||
changes, the alternate replace keystroke ^W^T is now
|
||||
^W^R to be compatible with later versions of Pico. ^W^T
|
||||
is now goto line, again for Pico compatibility. As for
|
||||
@@ -1352,7 +1476,7 @@
|
||||
path. The bug was in the new code for checking whether
|
||||
nano is invoked as 'pico'.
|
||||
|
||||
2000.04.14 - 0.9.1 has some more Pico compatibility built-in. The
|
||||
2000.04.14 - Nano 0.9.1 has some more Pico compatibility built-in. The
|
||||
option to switch to/from Search and Search/Replace (^T)
|
||||
is now available, and nano now displays the more
|
||||
Pico-like shortcut list when invoked as 'pico' (i.e. if
|
||||
|
||||
88
README
88
README
@@ -1,73 +1,69 @@
|
||||
|
||||
GNU nano - an enhanced clone of the Pico text editor.
|
||||
GNU nano -- an enhanced clone of the Pico text editor
|
||||
|
||||
Overview
|
||||
|
||||
The nano project was started because of a few "problems" with the
|
||||
wonderfully easy-to-use and friendly Pico text editor.
|
||||
The nano project was started because of a few "problems" with the
|
||||
wonderfully easy-to-use and friendly Pico text editor.
|
||||
|
||||
First and foremost was its license: the Pine suite does not use
|
||||
the GPL or a GPL-friendly license, and has unclear restrictions on
|
||||
redistribution. Because of this, Pine and Pico are not included
|
||||
with many GNU/Linux distributions. Also, other features (like
|
||||
go-to-line-number or search-and-replace) were unavailable until
|
||||
recently or require a command-line flag. Yuck.
|
||||
First and foremost was its license: the Pine suite does not use
|
||||
the GPL or a GPL-friendly license, and has unclear restrictions on
|
||||
redistribution. Because of this, Pine and Pico are not included
|
||||
with many GNU/Linux distributions. Also, other features (like
|
||||
go-to-line-number or search-and-replace) were unavailable until
|
||||
recently or require a command-line flag. Yuck.
|
||||
|
||||
nano aims to solve these problems by emulating the functionality of
|
||||
Pico as closely as possible while addressing the problems above and
|
||||
providing other extra functionality.
|
||||
nano aims to solve these problems by emulating the functionality of
|
||||
Pico as closely as possible while addressing the problems above and
|
||||
providing other extra functionality.
|
||||
|
||||
The nano editor is an official GNU package. For more information on
|
||||
GNU and the Free Software Foundation, please see http://www.gnu.org/.
|
||||
The nano editor is an official GNU package. For more information on
|
||||
GNU and the Free Software Foundation, please see http://www.gnu.org/.
|
||||
|
||||
How to compile and install nano
|
||||
|
||||
Download the nano source code, then:
|
||||
Download the nano source code, then:
|
||||
|
||||
tar zxvf nano-x.y.z.tar.gz
|
||||
cd nano-x.y.z
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
tar xvzf nano-x.y.z.tar.gz
|
||||
cd nano-x.y.z
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
It's that simple. Use --prefix with configure to override the
|
||||
default installation directory of /usr/local.
|
||||
It's that simple. Use --prefix with configure to override the
|
||||
default installation directory of /usr/local.
|
||||
|
||||
If you haven't configured with the "--disable-nanorc" option, after
|
||||
installation you may want to copy the doc/nanorc.sample to your
|
||||
home directory, rename it to ".nanorc", and then edit it according
|
||||
to your taste.
|
||||
If you haven't configured with the --disable-nanorc option, after
|
||||
installation you may want to copy the doc/sample.nanorc file to
|
||||
your home directory, rename it to ".nanorc", and then edit it
|
||||
according to your taste.
|
||||
|
||||
Web Page
|
||||
|
||||
http://www.nano-editor.org/
|
||||
https://nano-editor.org/
|
||||
|
||||
Mailing Lists and Bug Reports
|
||||
Mailing Lists
|
||||
|
||||
Savannah hosts all the nano-related mailing-lists.
|
||||
There are three nano-related mailing-lists.
|
||||
|
||||
+ info-nano@gnu.org is a very low traffic list used to announce
|
||||
new nano versions or other important information about the
|
||||
project.
|
||||
new nano versions or other important info about the project.
|
||||
+ help-nano@gnu.org is for those seeking to get help without
|
||||
wanting to hear about the technical details of its development.
|
||||
+ nano-devel@gnu.org is the list used by the people that make
|
||||
nano and a general development discussion list, with moderate
|
||||
traffic.
|
||||
+ nano-devel@gnu.org is the list used by the people that make nano
|
||||
and a general development discussion list, with moderate traffic.
|
||||
|
||||
To subscribe, send email to <name>-request@gnu.org with a
|
||||
subject of "subscribe", where <name> is the list you want to
|
||||
subscribe to.
|
||||
To subscribe, send email to <name>-request@gnu.org with a subject
|
||||
of "subscribe", where <name> is the list you want to subscribe to.
|
||||
|
||||
For general bug reports, please file a description of the problem
|
||||
on the Savannah bug tracker page for nano
|
||||
(https://savannah.gnu.org/bugs/?group=nano). The issue may have
|
||||
already been reported, and we are better able to track the state
|
||||
of the issue and whom to notify when fixed, the more the bug
|
||||
tracker is used.
|
||||
Bug Reports
|
||||
|
||||
To report a bug, please file a description of the problem on nano's
|
||||
bug tracker (https://savannah.gnu.org/bugs/?group=nano -- hover on
|
||||
"Bugs", then click "Submit new"). The issue may have already been
|
||||
reported, so please look first.
|
||||
|
||||
Current Status
|
||||
|
||||
GNU nano has reached its fifth stable milestone, 2.4.x.
|
||||
Development of new features will continue in the 2.5.x branch,
|
||||
while 2.4.x versions are dedicated to bug-fixing and polishing.
|
||||
GNU nano has reached its seventh milestone, 2.6.x. Since 2.5.0, it
|
||||
is a "rolling" release: bug fixing and development go hand in hand.
|
||||
|
||||
108
README.GIT
Normal file
108
README.GIT
Normal file
@@ -0,0 +1,108 @@
|
||||
INSTRUCTIONS FOR COMPILING AND INSTALLING NANO FROM GIT
|
||||
=======================================================
|
||||
|
||||
The latest changes and fixes for GNU nano are available via git, but
|
||||
building this needs a bit more care than the official tarballs.
|
||||
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
To successfully compile GNU nano from git, you'll need the following
|
||||
packages:
|
||||
|
||||
- autoconf (version >= 2.61)
|
||||
- automake (version >= 1.7)
|
||||
- autopoint (version >= 0.11.5)
|
||||
- gettext (version >= 0.11.5)
|
||||
- git (version >= 2.7.4)
|
||||
- groff (version >= 1.12)
|
||||
- pkg-config (version >= 0.22)
|
||||
- texinfo (version >= 4.0)
|
||||
- gcc (any version)
|
||||
- make (any version)
|
||||
|
||||
If you want UTF-8 support, you will also need libncursesw5-dev installed
|
||||
(version >= 5.7), or libslang2-dev (version >= 2.0) if you use --with-slang.
|
||||
If your system doesn't have 'snprintf' or 'vsnprintf' (which the configure
|
||||
script will check for), you will also need glib-2.x installed.
|
||||
|
||||
These should all be available in your distro's package manager or software
|
||||
center, or otherwise on any GNU mirror.
|
||||
|
||||
|
||||
Download the source
|
||||
-------------------
|
||||
|
||||
To obtain the current nano development branch (called 'master'), use the
|
||||
following command. It will create in your current working directory a
|
||||
subdirectory called 'nano' containing a copy of all of the files:
|
||||
|
||||
$ git clone git://git.savannah.gnu.org/nano.git nano
|
||||
|
||||
|
||||
Generate the configure script
|
||||
-----------------------------
|
||||
|
||||
Once you have the sources in the "nano" directory,
|
||||
|
||||
$ cd nano
|
||||
$ ./autogen.sh
|
||||
|
||||
This will set up a configure script and a Makefile.in file.
|
||||
|
||||
|
||||
Configure your build
|
||||
--------------------
|
||||
|
||||
To configure your build, run the configure script from the nano source
|
||||
directory:
|
||||
|
||||
$ ./configure [--add-options-here]
|
||||
|
||||
|
||||
Build and install
|
||||
-----------------
|
||||
|
||||
From the nano source directory, build the code with:
|
||||
|
||||
$ make
|
||||
|
||||
Then, once it's done compiling, run:
|
||||
|
||||
$ make install
|
||||
|
||||
which should copy various files (i.e. the nano executable, the info and
|
||||
man pages, and syntax highlighting pattern files) to their appropriate
|
||||
directories.
|
||||
|
||||
If you're installing into the default install directory (/usr/local),
|
||||
you'll need to run that "make install" command with root privileges.
|
||||
|
||||
|
||||
Problems?
|
||||
---------
|
||||
|
||||
Please submit any bugs you find in the code in git via the bug tracker
|
||||
on Savannah (https://savannah.gnu.org/bugs/?group=nano).
|
||||
|
||||
|
||||
Contributing something
|
||||
----------------------
|
||||
|
||||
If you have a fix for a bug, or the code for a new or improved feature,
|
||||
first create a branch off of master:
|
||||
|
||||
$ git checkout -b somename
|
||||
|
||||
Then change the code so it does what you want, and commit it, with in the
|
||||
commit message (after the one-line summary) a rationale for the change:
|
||||
|
||||
$ git commit -as
|
||||
|
||||
Then create a patch (or patches):
|
||||
|
||||
$ git format-patch master
|
||||
|
||||
Send that patch (or patches) to <nano-devel@gnu.org>, as an attachment
|
||||
or with git send-email.
|
||||
86
README.SVN
86
README.SVN
@@ -1,86 +0,0 @@
|
||||
INSTRUCTIONS TO COMPILE AND INSTALL NANO CVS VERSIONS
|
||||
=====================================================
|
||||
|
||||
GNU nano is available from SVN, but building this needs a bit more care
|
||||
than the official stable and unstable tarballs.
|
||||
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
To successfully compile GNU nano from CVS, you'll need the following
|
||||
packages:
|
||||
|
||||
- autoconf (version >= 2.54)
|
||||
- automake (version >= 1.7)
|
||||
- gettext (version >= 0.11.5)
|
||||
- groff (version >= 1.12)
|
||||
- texinfo (version >= 4.0)
|
||||
- subversion (aka svn)
|
||||
- glib 2.x (if your system doesn't have vsnprintf(), which the configure
|
||||
script will check for)
|
||||
- make, gcc and the normal development libraries (curses or slang, etc.)
|
||||
|
||||
These should be available on your GNU mirror. Note that you'll need a
|
||||
version of curses or slang with wide character support if you want nano
|
||||
to use UTF-8.
|
||||
|
||||
|
||||
Download the source
|
||||
-------------------
|
||||
|
||||
To obtain the current nano development code (called 'trunk'), use the
|
||||
following command. It will create a copy of the files in a subdirectory
|
||||
of your current working directory called 'nano':
|
||||
|
||||
$ svn co svn://svn.savannah.gnu.org/nano/trunk/nano
|
||||
|
||||
If you want to download the stable SVN branch instead, use:
|
||||
|
||||
$ svn co svn://svn.savannah.gnu.org/nano/branches/nano_2_2_branch/nano
|
||||
|
||||
|
||||
Generate the configure script
|
||||
-----------------------------
|
||||
|
||||
Once you have the sources in the "nano" directory,
|
||||
|
||||
$ cd nano
|
||||
$ ./autogen.sh
|
||||
|
||||
This will set up a configure script and a Makefile.in file.
|
||||
|
||||
|
||||
Configure your build
|
||||
--------------------
|
||||
|
||||
To configure your build, run the configure script from the nano source
|
||||
directory:
|
||||
|
||||
$ ./configure [--add-options-here]
|
||||
|
||||
|
||||
Build and install
|
||||
-----------------
|
||||
|
||||
From the nano source directory, build the code with:
|
||||
|
||||
$ make
|
||||
|
||||
Then, once it's done compiling, run
|
||||
|
||||
$ make install
|
||||
|
||||
which should copy various files (i.e. the nano executable, the info and
|
||||
man pages, and syntax highlighting pattern files) to their appropriate
|
||||
directories.
|
||||
|
||||
If you're installing into the default install directory (/usr/local),
|
||||
you'll need to run that "make install" command with root privileges.
|
||||
|
||||
|
||||
Problems?
|
||||
---------
|
||||
|
||||
Please submit any bugs in the SVN branch using the Savannah project's
|
||||
bug tracker (https://savannah.gnu.org/bugs/?group=nano).
|
||||
93
TODO
93
TODO
@@ -1,11 +1,8 @@
|
||||
TODO file (? means the feature may be implemented, but not definitely)
|
||||
------------------------------------------------------------------------
|
||||
A list of desired features
|
||||
--------------------------
|
||||
|
||||
For the future (no targeted version, catch-all)
|
||||
- Compatibility with vi/emacs status files so we can let other editors
|
||||
know we're in a file?
|
||||
Vague musings:
|
||||
- FriBidi support?
|
||||
- Port to DJGPP?
|
||||
- Make matching bracket searches sophisticated enough to skip over
|
||||
brackets inside comments?
|
||||
- Allow indentation of marked text by spaces as well as tabs?
|
||||
@@ -14,42 +11,43 @@ For the future (no targeted version, catch-all)
|
||||
- Allow conversion between different character sets. Maybe use glib's
|
||||
iconv() if the system's iconv() is inadequate, since we already use
|
||||
glib's vsnprintf() if the system lacks vsnprintf()?
|
||||
- Allow setting marks (saved positions, not to be confused with the mark
|
||||
set via Ctrl-^) at various lines and/or columns in the buffer, and
|
||||
allow movement between them with a single keystroke?
|
||||
- Allow searching for and replacing newlines?
|
||||
See also https://savannah.gnu.org/bugs/?47053.
|
||||
- New regression framework built on expect?
|
||||
- Add the ability to move to different lines of the screen with a single
|
||||
keystroke, e.g. M-` (M-~) to go to the top line, M-& (M-7) to go to
|
||||
the center line, and M-' (M-") to go to the last line?
|
||||
|
||||
Somewhat urgent:
|
||||
- Allow text searches in the help viewer.
|
||||
See https://savannah.gnu.org/bugs/?28994.
|
||||
- Detect when text is being pasted, so that we can handle it faster.
|
||||
See https://savannah.gnu.org/bugs/?40060.
|
||||
- Allow color syntaxes to apply to more than just color, so that we can
|
||||
e.g. specify a different alternate spell checker depending on which
|
||||
file type we have open.
|
||||
- Allow setting marks (saved positions, not to be confused with the mark
|
||||
set via Ctrl-^) at various lines and/or columns in the buffer, and
|
||||
allow movement between them with a single keystroke? (We're running
|
||||
out of keystrokes, though.)
|
||||
- Allow searching for and replacing newlines.
|
||||
- Fix handling of bad/incomplete UTF-8 sequences to display one Unicode
|
||||
FFFD (Replacement Character) per sequence instead of one per byte.
|
||||
|
||||
For version 2.6:
|
||||
- New regression framework built on expect.
|
||||
- Allow text searches in the help viewer.
|
||||
- Add the ability to move to different lines of the screen with a single
|
||||
keystroke, e.g. M-` (M-~) to go to the top line, M-& (M-7) to go to
|
||||
the center line, and M-' (M-") to go to the last line.
|
||||
- Detect when we're pasting text, so that we can handle it differently
|
||||
(i.e. faster than currently with screen redraws).
|
||||
- Allow piping marked text to an external command and replacing it with
|
||||
the command's output (as the internal spell checker already does with
|
||||
the "spell" command)?
|
||||
the command's output -- that is: generalize the spell-check flow.
|
||||
See also https://savannah.gnu.org/bugs/?28993.
|
||||
|
||||
For version 2.4:
|
||||
- Handle window resizes better. After we've resized, we should stay
|
||||
wherever we were before we resized, as Pico does. [DONE]
|
||||
- Allow even better file-type detection than we have currently, e.g.
|
||||
through libmagic. [DONE]
|
||||
- Compatibility with vim status files to let other editors know we're
|
||||
in a file. [DONE]
|
||||
|
||||
For version 2.2:
|
||||
- Rebindable keys? [DONE]
|
||||
- Undo/Redo keys (M-U and M-E)? [DONE]
|
||||
- Fix problems with color syntaxes' highlighting lines too aggressively [DONE]
|
||||
- Allow nano to work like a pager (read from stdin) [DONE]
|
||||
- Fix problems with color syntaxes highlighting lines too aggressively. [DONE]
|
||||
- Allow nano to work like a pager (reading from stdin). [DONE]
|
||||
- Allow color syntaxes to be selected based on more than just filename
|
||||
extension, [DONE]
|
||||
extension. [DONE]
|
||||
- Allow soft wrapping as well as hard wrapping? [DONE]
|
||||
|
||||
For version 2.0:
|
||||
@@ -66,36 +64,29 @@ For version 2.0:
|
||||
- Fix resetstatuspos global which we shouldn't have. [DONE]
|
||||
|
||||
For version 1.2:
|
||||
- Single line scroll up/down? [DONE]
|
||||
- Color syntax highlighting? (certainly seems like there's a demand for
|
||||
- Single-line scroll up/down? [DONE]
|
||||
- Color syntax highlighting? (Certainly seems like there's a demand for
|
||||
it.) [DONE]
|
||||
- .nanorc [DONE]
|
||||
- Backup making (filename~)? [DONE]
|
||||
- Search (etc.) string history [DONE]
|
||||
- Implement Pico's -j and -g flags, as they are pretty easy to do.
|
||||
[DONE]
|
||||
- Make mouse support work with clicking on the shortcuts (-m). Must
|
||||
make global variable pointing to current shortcut list to determine
|
||||
what keystroke to ungetch(). [DONE].
|
||||
- Implement -o (chroot of sorts) [DONE]
|
||||
- Search/replace string history. [DONE]
|
||||
- Implement Pico's -j and -g flags, as they are pretty easy to do. [DONE]
|
||||
- Make mouse support work with clicking on the shortcuts (-m). [DONE]
|
||||
- Implement -o (chroot of sorts). [DONE]
|
||||
- Allow -r to take a negative argument, meaning right margin instead of
|
||||
left (allows resizing that way), formerly -W arg. [DONE]
|
||||
|
||||
For version 1.0:
|
||||
- Implement Spelling [DONE]
|
||||
- Implement Help [DONE]
|
||||
- Implement Spelling. [DONE]
|
||||
- Implement Help. [DONE]
|
||||
- Internationalization [In progress, translators welcome!]
|
||||
- Allow nano to be resized in X. [DONE]
|
||||
- On page up/down, put the cursor on the first line (like Pico), not the
|
||||
center line [DONE]
|
||||
- Rewrite edit_refresh, if at all possible [DONE]
|
||||
- Implement justify function [DONE]
|
||||
- Cut to end of line [DONE]
|
||||
- Built-in speller command [needed for version 1.0] [DONE]
|
||||
- Better statusbar interaction (scrolling, tab completion for filename)
|
||||
[needed for version 1.0] [DONE]
|
||||
- Now do username completion [DONE].
|
||||
- Unjustify command (^U after ^J) [DONE =-].
|
||||
- Username completion (~user) [DONE =-].
|
||||
|
||||
$Id$
|
||||
- On PageUp/Down, put the cursor on the first line (like Pico), not the
|
||||
center line. [DONE]
|
||||
- Rewrite edit_refresh, if at all possible. [DONE]
|
||||
- Implement justify function. [DONE]
|
||||
- Cut to end of line. [DONE]
|
||||
- Built-in speller command. [DONE]
|
||||
- Better statusbar interaction (scrolling, tab completion). [DONE]
|
||||
- Unjustify command (^U after ^J). [DONE]
|
||||
- Username completion (~user). [DONE]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
# Generate configure & friends for CVS users.
|
||||
# Generate configure & friends for GIT users.
|
||||
|
||||
autoreconf -f -i -s
|
||||
|
||||
126
configure.ac
126
configure.ac
@@ -3,24 +3,20 @@
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
|
||||
# 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc.
|
||||
#
|
||||
# GNU nano is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 3, or (at your option) any
|
||||
# later version.
|
||||
# GNU nano is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# GNU nano is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
# GNU nano is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU nano; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
|
||||
# USA.
|
||||
#
|
||||
# $Id$
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
AC_INIT([GNU nano], [2.5.2], [nano-devel@gnu.org], [nano])
|
||||
AC_INIT([GNU nano], [2.7.5], [nano-devel@gnu.org], [nano])
|
||||
AC_CONFIG_SRCDIR([src/nano.c])
|
||||
AC_CANONICAL_HOST
|
||||
AM_INIT_AUTOMAKE
|
||||
@@ -86,6 +82,21 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(comment,
|
||||
AS_HELP_STRING([--disable-comment], [Disable comment/uncomment functions]))
|
||||
if test "x$enable_tiny" = xyes; then
|
||||
if test "x$enable_comment" = xyes; then
|
||||
AC_MSG_ERROR([--enable-comment cannot work with --enable-tiny])
|
||||
else
|
||||
enable_comment=no
|
||||
fi
|
||||
fi
|
||||
if test "x$disable_comment" != xyes; then
|
||||
if test "x$enable_comment" != xno; then
|
||||
AC_DEFINE(ENABLE_COMMENT, 1, [Define this to enable the comment/uncomment function.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(extra,
|
||||
AS_HELP_STRING([--disable-extra], [Disable extra features, currently only easter eggs]))
|
||||
if test "x$enable_extra" = xno; then
|
||||
@@ -113,6 +124,19 @@ fi
|
||||
AC_ARG_ENABLE(libmagic,
|
||||
AS_HELP_STRING([--disable-libmagic], [Disable detection of file types via libmagic]))
|
||||
|
||||
AC_ARG_ENABLE(linenumbers,
|
||||
AS_HELP_STRING([--disable-linenumbers], [Disable line numbering]))
|
||||
if test "x$enable_tiny" = xyes; then
|
||||
if test "x$enable_linenumbers" != xyes; then
|
||||
enable_linenumbers=no
|
||||
fi
|
||||
fi
|
||||
if test "x$disable_linenumbers" != xyes; then
|
||||
if test "x$enable_linenumbers" != xno; then
|
||||
AC_DEFINE(ENABLE_LINENUMBERS, 1, [Define this to enable line numbering.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(mouse,
|
||||
AS_HELP_STRING([--disable-mouse], [Disable mouse support (and -m flag)]))
|
||||
if test "x$enable_mouse" = xno; then
|
||||
@@ -148,7 +172,22 @@ fi
|
||||
AC_ARG_ENABLE(tabcomp,
|
||||
AS_HELP_STRING([--disable-tabcomp], [Disable tab completion functions]))
|
||||
if test "x$enable_tabcomp" = xno; then
|
||||
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab completion functions for files and search strings.])
|
||||
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab completion functions for filenames and search strings.])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(wordcomp,
|
||||
AS_HELP_STRING([--disable-wordcomp], [Disable the word completion function]))
|
||||
if test "x$enable_tiny" = xyes; then
|
||||
if test "x$enable_wordcomp" = xyes; then
|
||||
AC_MSG_ERROR([--enable-wordcomp cannot work with --enable-tiny])
|
||||
else
|
||||
enable_wordcomp=no
|
||||
fi
|
||||
fi
|
||||
if test "x$disable_wordcomp" != xyes; then
|
||||
if test "x$enable_wordcomp" != xno; then
|
||||
AC_DEFINE(ENABLE_WORDCOMPLETION, 1, [Define this to enable the word completion function.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(wrapping,
|
||||
@@ -526,8 +565,12 @@ else
|
||||
AC_MSG_RESULT([Using $CURSES_LIB_NAME as the curses library])
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors() command.]))
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], key_defined, AC_DEFINE(HAVE_KEY_DEFINED, 1, [Define this if your curses library has the key_defined() command.]))
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], [use_default_colors],
|
||||
[AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors() command.])],
|
||||
[], [$CURSES_LIB])
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], [key_defined],
|
||||
[AC_DEFINE(HAVE_KEY_DEFINED, 1, [Define this if your curses library has the key_defined() command.])],
|
||||
[], [$CURSES_LIB])
|
||||
|
||||
dnl Parse any configure options.
|
||||
|
||||
@@ -572,12 +615,23 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$color_support = xyes; then
|
||||
# Now check for the end-of-word boundary support (/< and />).
|
||||
AC_MSG_CHECKING([for GNU-style word boundary regex support])
|
||||
AC_CACHE_CHECK([for enhanced regular expression flag], nano_cv_flag_reg_extended,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <regex.h>]],
|
||||
[[
|
||||
#ifndef REG_ENHANCED
|
||||
error: No REG_ENHANCED support!
|
||||
#endif
|
||||
]])],
|
||||
[nano_cv_flag_reg_extended="REG_EXTENDED | REG_ENHANCED"],
|
||||
[nano_cv_flag_reg_extended="REG_EXTENDED"])])
|
||||
|
||||
AC_ARG_WITH(wordbounds,
|
||||
AS_HELP_STRING([--with-wordbounds], [Use GNU-style word boundary delimiters]),
|
||||
AC_DEFINE_UNQUOTED(NANO_REG_EXTENDED, $nano_cv_flag_reg_extended,
|
||||
[Flag(s) to use to get the full range of extended regular expressions])
|
||||
|
||||
# Check for word-boundary support (/< and />).
|
||||
AC_MSG_CHECKING([for GNU-style word boundary regex support])
|
||||
AC_ARG_WITH(wordbounds,
|
||||
AS_HELP_STRING([--with-wordbounds], [Use GNU-style word boundary delimiters]),
|
||||
[ case "$with_wordbounds" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -601,7 +655,7 @@ int main(void)
|
||||
size_t nmatch;
|
||||
regmatch_t pmatch;
|
||||
|
||||
if (regcomp(&r, "\\\\>", REG_EXTENDED|REG_NOSUB))
|
||||
if (regcomp(&r, "\\\\>", $nano_cv_flag_reg_extended|REG_NOSUB))
|
||||
return 1;
|
||||
if (regexec(&r, "word boundary", nmatch, &pmatch, 0))
|
||||
return 1;
|
||||
@@ -614,6 +668,7 @@ int main(void)
|
||||
)
|
||||
])
|
||||
|
||||
if test x$color_support = xyes; then
|
||||
# if test x$CURSES_LIB_NAME = xcurses; then
|
||||
AC_MSG_CHECKING([whether _XOPEN_SOURCE_EXTENDED is needed])
|
||||
AC_TRY_RUN([
|
||||
@@ -639,8 +694,8 @@ int main(void)
|
||||
AC_MSG_WARN([*** Couldn't successfully compile basic color test with or without _XOPEN_SOURCE_EXTENDED])
|
||||
AC_MSG_WARN([*** This build may not compile. Consider configuring with --disable-color or installing ncurses])),
|
||||
AC_MSG_WARN([*** Can't check need for _XOPEN_SOURCE_EXTENDED when cross-compiling]))
|
||||
fi
|
||||
#fi
|
||||
# fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether LINES and COLS can be redefined])
|
||||
AC_TRY_RUN([
|
||||
@@ -677,22 +732,25 @@ else
|
||||
fi
|
||||
AM_CONDITIONAL(GROFF_HTML, test x$groff_html_support = xyes)
|
||||
|
||||
# Check for the availability of makeinfo.
|
||||
AC_CHECK_PROG(haveit, makeinfo, yes, no)
|
||||
AM_CONDITIONAL(HAVE_MAKEINFO, test x$haveit = xyes)
|
||||
|
||||
# Check whether this is a git repository.
|
||||
AC_MSG_CHECKING([whether building from git])
|
||||
if test -d .git ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
from_git=yes
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
from_git=no
|
||||
fi
|
||||
AM_CONDITIONAL(BUILDING_FROM_GIT, test x$from_git = xyes)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
doc/Makefile
|
||||
doc/nanorc.sample
|
||||
doc/man/Makefile
|
||||
doc/man/fr/Makefile
|
||||
doc/syntax/Makefile
|
||||
doc/texinfo/Makefile
|
||||
doc/sample.nanorc
|
||||
m4/Makefile
|
||||
po/Makefile.in
|
||||
src/Makefile
|
||||
syntax/Makefile
|
||||
nano.spec
|
||||
])
|
||||
|
||||
|
||||
8
doc/.gitignore
vendored
8
doc/.gitignore
vendored
@@ -1 +1,7 @@
|
||||
/nanorc.sample
|
||||
nano.1.html
|
||||
rnano.1.html
|
||||
nanorc.5.html
|
||||
texinfo.tex
|
||||
nano.info
|
||||
nano.html
|
||||
sample.nanorc
|
||||
|
||||
@@ -1,11 +1,33 @@
|
||||
SUBDIRS = man
|
||||
|
||||
if HAVE_MAKEINFO
|
||||
SUBDIRS += texinfo
|
||||
endif
|
||||
|
||||
if USE_COLOR
|
||||
SUBDIRS += syntax
|
||||
endif
|
||||
SUBDIRS =
|
||||
BUILT_SOURCES =
|
||||
|
||||
dist_html_DATA = faq.html
|
||||
|
||||
dist_man_MANS = nano.1 rnano.1
|
||||
html_pages = nano.1.html rnano.1.html
|
||||
|
||||
if USE_NANORC
|
||||
dist_man_MANS += nanorc.5
|
||||
html_pages += nanorc.5.html
|
||||
endif
|
||||
|
||||
nano.1.html: nano.1
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
nanorc.5.html: nanorc.5
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
rnano.1.html: rnano.1
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
|
||||
if GROFF_HTML
|
||||
BUILT_SOURCES += $(html_pages)
|
||||
dist_html_DATA += $(html_pages)
|
||||
endif
|
||||
|
||||
info_TEXINFOS = nano.texi
|
||||
|
||||
BUILT_SOURCES += nano.html
|
||||
dist_html_DATA += nano.html
|
||||
|
||||
AM_MAKEINFOHTMLFLAGS = --no-split
|
||||
|
||||
EXTRA_DIST = $(BUILT_SOURCES) $(info_TEXINFOS)
|
||||
|
||||
264
doc/faq.html
264
doc/faq.html
@@ -5,6 +5,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
</head>
|
||||
<body text="#330000" bgcolor="#ffffff" link="#0000ef" vlink="#51188e" alink="#ff0000">
|
||||
|
||||
<h1>The GNU nano editor FAQ</h1>
|
||||
<h2>Table of Contents</h2>
|
||||
<h2><a href="#1">1. General</a></h2>
|
||||
@@ -19,7 +20,7 @@
|
||||
<blockquote><p><a href="#2.1">2.1. FTP and WWW sites that carry nano.</a><br>
|
||||
<a href="#2.2">2.2. RedHat and derivatives (.rpm) packages.</a><br>
|
||||
<a href="#2.3">2.3. Debian (.deb) packages.</a><br>
|
||||
<a href="#2.4">2.4. By subversion (for the brave).</a></p></blockquote>
|
||||
<a href="#2.4">2.4. By GIT (for the brave).</a></p></blockquote>
|
||||
<h2><a href="#3">3. Installation and Configuration</a></h2>
|
||||
<blockquote><p><a href="#3.1">3.1. How do I install the RPM or DEB package?</a><br>
|
||||
<a href="#3.2">3.2. Compiling from source: WHAT THE HECK DO I DO NOW?</a><br>
|
||||
@@ -38,15 +39,11 @@
|
||||
<a href="#4.5">4.5. How do I type the F13-F16 keys shown in the help browser? My keyboard only has F1-F12!</a><br>
|
||||
<a href="#4.6">4.6. nano crashes when I type <insert keystroke here>!</a><br>
|
||||
<a href="#4.7">4.7. nano crashes when I resize my window. How can I fix that?</a><br>
|
||||
<a href="#4.8">4.8. [version 1.3.12 and later] I'm using glibc 2.2.3, and nano crashes when I use color support or do regular expression searches. How can I fix that?</a><br>
|
||||
<a href="#4.9">4.9. [version 1.1.12 and earlier] Why does nano show ^\ in the shortcut list instead of ^J?</a><br>
|
||||
<a href="#4.10a">4.10a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</a><br>
|
||||
<a href="#4.10b">4.10b. [version 1.1.99pre1 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</a><br>
|
||||
<a href="#4.11">4.11. How do I make nano my default editor (in Pine, mutt, etc.)?</a><br>
|
||||
<a href="#4.12">4.12. I've compiled nano with color support, but I don't see any color when I run it!</a><br>
|
||||
<a href="#4.13">4.13. How do I select text for or paste text from the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</a><br>
|
||||
<a href="#4.14">4.14. When I paste text into a document, each line gets indented further than the last. Why does nano do this, and how can I avoid it?</a><br>
|
||||
<a href="#4.15">4.15. On startup I get a message that says "Detected a legacy nano history file". Now older nano versions can't find my search history!</a></p></blockquote>
|
||||
<a href="#4.8">4.8. When I paste text into a document, each line gets indented further than the last. Why does nano do this, and how can I avoid it?</a><br>
|
||||
<a href="#4.9">4.9. I've compiled nano with color support, but I don't see any color when I run it!</a><br>
|
||||
<a href="#4.10">4.10. How do I make nano my default editor (in Pine, mutt, etc.)?</a><br>
|
||||
<a href="#4.11">4.11. How do I select text for or paste text from the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</a><br>
|
||||
<a href="#4.12">4.12. On startup I get a message that says "Detected a legacy nano history file". Now older nano versions can't find my search history!</a></p></blockquote>
|
||||
<h2><a href="#5">5. Internationalization</a></h2>
|
||||
<blockquote><p><a href="#5.1">5.1. There's no translation for my language!</a><br>
|
||||
<a href="#5.2">5.2. I don't like the translation for <x> in my language. How can I fix it?</a><br>
|
||||
@@ -61,16 +58,17 @@
|
||||
<a href="#7.2">7.2. I want to send the development team a big load of cash (or just a thank you).</a><br>
|
||||
<a href="#7.3">7.3. How do I submit a bug report or patch?</a><br>
|
||||
<a href="#7.4">7.4. How do I join the development team?</a><br>
|
||||
<a href="#7.5">7.5. Can I have write access to the subversion tree?</a></p></blockquote>
|
||||
<a href="#7.5">7.5. Can I have write access to the GIT tree?</a></p></blockquote>
|
||||
<h2><a href="#8">8. ChangeLog</a></h2>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="1"></a>1. General</h1>
|
||||
<h2><a name="1.1"></a>1.1 About this FAQ</h2>
|
||||
<blockquote><p>This FAQ was originally written and maintained by Chris Allegretta <<a href="mailto:chrisa@asty.org">chrisa@asty.org</a>>, who also happens to be the creator of nano. It was then maintained by David Lawrence Ramsey <<a href="mailto:pooka109@gmail.com">pooka109@gmail.com</a>>. Maybe someone else will volunteer to maintain this FAQ someday, who knows...</p></blockquote>
|
||||
<h2><a name="1.2"></a>1.2. How do I contribute to it?</h2>
|
||||
<blockquote><p>Your best bet is to send it to the nano email address, <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a> and if it is useful enough it will be included in future versions.</p></blockquote>
|
||||
<h2><a name="1.3"></a>1.3. What is GNU nano?</h2>
|
||||
<blockquote><p>GNU nano is designed to be a free replacement for the Pico text editor, part of the Pine email suite from <a href="http://www.washington.edu/pine/">The University of Washington</a>. It aims to "emulate Pico as closely as possible and perhaps include extra functionality".</p></blockquote>
|
||||
<blockquote><p>GNU nano is designed to be a free replacement for the Pico text editor, part of the Pine email suite from <a href="http://www.washington.edu/pine/">The University of Washington</a>. It aims to "emulate Pico as closely as possible and then include extra functionality".</p></blockquote>
|
||||
<h2><a name="1.4"></a>1.4. What is the history behind nano?</h2>
|
||||
<blockquote><p>Funny you should ask!</p>
|
||||
<p><b>In the beginning...</b></p>
|
||||
@@ -79,30 +77,32 @@
|
||||
<p>The <a href="http://www.debian.org/">Debian GNU/Linux</a> distribution, known for its strict standards in distributing truly "free" software (i.e. software with no restrictions on redistribution), would not include a binary package for Pine or Pico. Many people had a serious dilemma: they loved these programs, but the versions available at the time were not truly free software in the <a href="http://www.gnu.org/philosophy/free-sw.html">GNU</a> sense of the word.</p>
|
||||
<p><b>The event...</b></p>
|
||||
<p>It was in late 1999 when Chris Allegretta (our hero) was yet again complaining to himself about the less-than-perfect license Pico was distributed under, the 1000 makefiles that came with it and how just a few small improvements could make it the Best Editor in the World (TM). Having been a convert from Slackware to Debian, he missed having a simple binary package that included Pine and Pico, and had grown tired of downloading them himself.</p>
|
||||
<p>Finally something snapped inside and Chris coded and hacked like a madman for many hours straight one weekend to make a (barely usable) Pico clone, at the time called TIP (Tip Isn't Pico). The program could not be invoked without a filename, could not save files, had no help text display, spell checker, and so forth. But over time it improved, and with the help of a few great coders it matured to the (hopefully) stable state it is today.</p>
|
||||
<p>Finally something snapped inside and Chris coded and hacked like a madman for many hours straight one weekend to make a (barely usable) Pico clone, at the time called TIP (Tip Isn't Pico). The program could not be invoked without a filename, could not save files, had no help text display, spell checker, and so forth. But over time it improved, and with the help of a few great coders it matured to the (hopefully) stable state it is in today.</p>
|
||||
<p>In February 2001, nano was declared an official GNU program by Richard Stallman. nano also reached its first production release on March 22, 2001.</p></blockquote>
|
||||
<h2><a name="1.5"></a>1.5. Why the name change from TIP?</h2>
|
||||
<blockquote><p>On January 10, 2000, TIP was officially renamed to nano because of a namespace conflict with another program called 'tip'. The original 'tip' program "establishes a full duplex terminal connection to a remote host", and was included with many older Unix systems (and newer ones like Solaris). The conflict was not noticed at first because there is no 'tip' utility included with most GNU/Linux distributions (where nano was developed).</p></blockquote>
|
||||
<h2><a name="1.6"></a>1.6. What is the current version of nano?</h2>
|
||||
<blockquote><p>The current stable version of nano *should* be 2.4.2. Of course, you should always check the <a href="http://www.nano-editor.org/">nano homepage</a> to see what the latest and greatest version is.</p></blockquote>
|
||||
<blockquote><p>The current version of nano <i>should</i> be <b>2.7.5</b>. Of course, you should always check the <a href="https://nano-editor.org/">nano homepage</a> to see what the latest and greatest version is.</p></blockquote>
|
||||
<h2><a name="1.7"></a>1.7. I want to read the man page without having to download the program!</h2>
|
||||
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="http://www.nano-editor.org/dist/v2.4/nano.1.html">here</a>.</p></blockquote>
|
||||
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="https://nano-editor.org/dist/latest/nano.1.html">here</a>.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="2"></a>2. Where to get GNU nano.</h1>
|
||||
<h2><a name="2.1"></a>2.1. FTP and WWW sites that carry nano.</h2>
|
||||
<blockquote><p>The nano distribution can be downloaded at the following fine web and ftp sites:</p>
|
||||
<h2><a name="2.1"></a>2.1. Web sites that carry nano.</h2>
|
||||
<blockquote><p>The nano source tarballs can be downloaded from the following web sites:</p>
|
||||
<ul>
|
||||
<li><a href="http://www.nano-editor.org/dist/">http://www.nano-editor.org/dist/</a></li>
|
||||
<li><a href="ftp://ftp.gnu.org/pub/gnu/nano/">ftp://ftp.gnu.org/pub/gnu/nano/</a></li>
|
||||
<li><a href="https://nano-editor.org/dist/">https://nano-editor.org/dist/</a></li>
|
||||
<li><a href="https://ftp.gnu.org/gnu/nano/">https://ftp.gnu.org/gnu/nano/</a></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<h2><a name="2.2"></a>2.2. RedHat and derivatives (.rpm) packages.</h2>
|
||||
<h2><a name="2.2"></a>2.2. RPM packages (RedHat, OpenSuse, and derivatives).</h2>
|
||||
<blockquote>
|
||||
<ul>
|
||||
<li><a href="http://www.nano-editor.org/dist/v2.2/RPMS/">http://www.nano-editor.org/dist/v2.2/RPMS/</a></li>
|
||||
<li><a href="https://kojipkgs.fedoraproject.org//packages/nano/">https://kojipkgs.fedoraproject.org//packages/nano/</a></li>
|
||||
<li><a href="https://software.opensuse.org/package/nano">https://software.opensuse.org/package/nano</a></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<h2><a name="2.3"></a>2.3. Debian (.deb) packages.</h2>
|
||||
<h2><a name="2.3"></a>2.3. Deb packages (Debian and derivatives):</h2>
|
||||
<blockquote><p>Debian users can check out the current nano packages for:</p>
|
||||
<ul>
|
||||
<li><a href="http://packages.debian.org/stable/editors/nano">stable</a></li>
|
||||
@@ -111,9 +111,10 @@
|
||||
</ul>
|
||||
<p>You can also have a look at the <a href="ftp://ftp.debian.org/debian/pool/main/n/nano/">Package Pool</a> to see all the available binary and source packages.</p>
|
||||
</blockquote>
|
||||
<h2><a name="2.4"></a>2.4. By subversion (for the brave).</h2>
|
||||
<blockquote><p>For the 'bleeding edge' current version of nano, you can use subversion to download the current source code. <b>Note:</b> believe it or not, by downloading code that has not yet stabilized into an official release, there could quite possibly be bugs, in fact the code may not even compile! Anyway, see <a href="http://svn.savannah.gnu.org/viewvc/trunk/nano/README.SVN?root=nano&view=markup">the nano SVN document</a> for info on anonymous SVN access to the nano source.</p></blockquote>
|
||||
<h2><a name="2.4"></a>2.4. By GIT (for the brave).</h2>
|
||||
<blockquote><p>For the 'bleeding edge' current version of nano, you can use GIT to download the current source code. <b>Note:</b> believe it or not, by downloading code that has not yet stabilized into an official release, there could quite possibly be bugs, in fact the code may not even compile! Anyway, see <a href="http://git.savannah.gnu.org/cgit/nano.git/tree/README.GIT">the nano GIT document</a> for info on anonymous GIT access to the nano source.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="3"></a>3. Installation and Configuration</h1>
|
||||
<h2><a name="3.1"></a>3.1. How do I install the RPM or DEB package?</h2>
|
||||
<blockquote><p>It's simple really! As root, type <b>rpm -Uvh nano-x.y.z-1.i386.rpm</b> if you have a RedHat-ish system or <b>dpkg -i nano_x.y.z-1.deb</b> if you have a Debian-ish system, where <b>x.y.z</b> is the release of nano. There are other programs to install packages, and if you wish to use those, knock yourself out.</p></blockquote>
|
||||
@@ -148,23 +149,25 @@
|
||||
<b>--disable-operatingdir</b> Disable the setting of an operating directory
|
||||
<b>--disable-speller</b> Disable spell checker functions
|
||||
<b>--disable-tabcomp</b> Disable tab completion functions
|
||||
<b>--disable-wordcomp</b> Disable the word completion function
|
||||
<b>--disable-wrapping</b> Disable all hard-wrapping of text</pre>
|
||||
<p>There's also the <b>--enable-tiny</b> option which disables everything above, as well as some larger chunks of the program (like the marker code that you use with Control-^ to select text). Also, if you know you aren't going to be using other languages you can use <b>--disable-nls</b> to disable internationalization and save a few K to a few dozen K depending on if you have locale support on your system. And finally there's always good old <b>strip</b> to strip all debugging code and code that exists in libraries on your system.</p>
|
||||
<p>There's also the <b>--enable-tiny</b> option which disables everything above, as well as some larger chunks of the program (like the marker code that you use with Control-^ to select text). Also, if you know you aren't going to be using other languages, you can use <b>--disable-nls</b> to disable internationalization and save a few K to a few dozen K depending on whether you have locale support on your system. And finally, there's always good old <b>strip</b> to strip all debugging code and code that exists in libraries on your system.</p>
|
||||
<p>With <b>--disable-wrapping-as-root</b> you can disable any hard-wrapping by default when the user is root, useful to prevent accidentally changing long lines in system configuration files.</p>
|
||||
</blockquote>
|
||||
<h2><a name="3.7"></a>3.7. Tell me more about this multibuffer stuff!</h2>
|
||||
<blockquote><p>To use multiple file buffers, you must be using nano 1.1.0 or newer, and you must not have configured it with <b>--disable-multibuffer</b> nor with <b>--enable-tiny</b> (use <b>nano -V</b> to check the compilation options). Then when you want to insert a file into its own buffer instead of into the current file, just hit <b>Meta-F</b>, then insert the file as normal with <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano.</p>
|
||||
<p>You can move between the buffers you have open with the <b>Meta-<</b> and <b>Meta-></b> keys, or more easily with <b>Meta-,</b> and <b>Meta-.</b> (clear as mud, right? =-). When you have more than one file buffer open, the ^X shortcut will say "Close", instead of the normal "Exit" when only one buffer is open.</p></blockquote>
|
||||
<blockquote><p>To use multiple file buffers, you must not have configured nano with <b>--disable-multibuffer</b> nor with <b>--enable-tiny</b> (use <b>nano -V</b> to check the compilation options). Then when you want to insert a file into its own buffer instead of into the current file, just hit <b>Meta-F</b>, then insert the file as normal with <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano.</p>
|
||||
<p>You can move between the buffers you have open with the <b>Meta-<</b> and <b>Meta-></b> keys, or more easily without holding Shift: <b>Meta-,</b> and <b>Meta-.</b> (clear as mud, right? =-). When you have more than one file buffer open, the ^X shortcut will say "Close", instead of the normal "Exit" when only one buffer is open.</p></blockquote>
|
||||
<h2><a name="3.8"></a>3.8. Tell me more about this verbatim input stuff!</h2>
|
||||
<blockquote><p>To use verbatim input, you must be using nano 1.3.1 or newer. When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press <b>Meta-V</b> (if you're not at a prompt, you'll get the message "Verbatim Input"), then press the key(s) that generate the character you want.</p>
|
||||
<p>Alternatively, if you've enabled Unicode support (see section <a href="#5.3">5.3</a>), you can press <b>Meta-V</b> and then type a six-digit hexadecimal code (from 000000 to 10FFFF, case-insensitive), and the character with the corresponding value will be inserted instead. The prompt will change to "Unicode Input" when you do this.</p></blockquote>
|
||||
<h2><a name="3.9a"></a>3.9a. How do I make a .nanorc file that nano will read when I start it?</h2>
|
||||
<blockquote><p>It's not hard at all! But, your version of nano must <b>not</b> have been compiled with <b>--disable-nanorc</b>, and must be version 1.1.12 or newer (use nano -V to check your version and compiled features). Then simply copy the <b>nanorc.sample</b> that came with the nano source or your nano package (most likely in /usr/doc/nano) to .nanorc in your home directory. If you didn't get one, the syntax is simple. Flags are turned on and off by using the words <b>set</b> and <b>unset</b> plus the long option name for the feature. For example, "set nowrap" or "set smarthome".</p></blockquote>
|
||||
<blockquote><p>When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press <b>Meta-V</b> (if you're not at a prompt, you'll get the message "Verbatim Input" on the statusbar), then press the key(s) that generate the character you want.</p>
|
||||
<p>Alternatively, if you've enabled Unicode support (see section <a href="#5.3">5.3</a>), you can press <b>Meta-V</b> and then type a six-digit hexadecimal code (from 000000 to 10FFFF, case-insensitive), and the character with the corresponding value will be inserted. The statubar will change to "Unicode Input: ......" when you do this.</p></blockquote>
|
||||
<h2><a name="3.9a"></a>3.9a. How do I make a .nanorc file that will be read when I start nano?</h2>
|
||||
<blockquote><p>It's not hard at all! But, your nano must <b>not</b> have been compiled with <b>--disable-nanorc</b>. Then simply copy the <b>sample.nanorc</b> that came with the nano source or your nano package (most likely in /usr/doc/nano) to .nanorc in your home directory. If you didn't get one, the syntax of the file is simple. Flags are turned on and off by using the words <b>set</b> and <b>unset</b> plus the long option name for the feature. For example, "set nowrap" or "set smarthome".</p></blockquote>
|
||||
<h2><a name="3.9b"></a>3.9b. How about in Win32?</h2>
|
||||
<blockquote><p>If you're using the official nano .zip file and have extracted all the files, you should take the file nano.rc and place it somewhere on your Win32 system (for example, if you have write permission to do so, at the top of C:\). Then you must create an Environment variable called HOME which points to the directory where you put nano.rc. In Windows XP, you can get to Environment variables by right-clicking "My Computer" either on the desktop or in the Start Menu, and selecting Properties. This should bring up the System Properties panel. Then click the Advanced Tab, and there should be a button called Environment Variables. Click that to bring up the Environment Variables section. Now, under User Variables you should be able to click the New button, and make a new Variables Name called HOME, with the Variable Value of whatever path you copied nano.rc into (just the directory name; don't add nano.rc onto the end).</p>
|
||||
<p>We're still working on documentation for enabling syntax highlighting on Win32; please bear with us.</p>
|
||||
<p>Note that the nano.rc file must remain Unix-formatted in order for nano to understand it. In other words, you should probably use only nano to edit its config file. Other programs like Wordpad and Notepad will convert the file to DOS format when saving, and the latter does not even properly read Unix-formatted files to begin with.</p></blockquote>
|
||||
<p>We're still working on documentation for enabling syntax highlighting on Win32; please bear with us.</p>
|
||||
<p>Note that the nano.rc file must remain Unix-formatted in order for nano to understand it. In other words, you should probably use only nano to edit its config file. Other programs like Wordpad and Notepad will convert the file to DOS format when saving, and the latter does not even properly read Unix-formatted files to begin with.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="4"></a>4. Running</h1>
|
||||
<h2><a name="4.1"></a>4.1. How do I open a file with a name beginning with '+' from the command line?</h2>
|
||||
<blockquote><p>If a command-line option that begins with '+' is followed by another option, the former is always treated as a starting line and column number, and the latter is always treated as a filename. If a command-line option that begins with '+' isn't followed by another option, it's always treated as a filename. Examples:</p>
|
||||
@@ -186,16 +189,12 @@
|
||||
<h2><a name="4.6"></a>4.6. nano crashes when I type <insert keystroke here>!</h2>
|
||||
<blockquote><p>If you aren't trying some bizarre keystroke combination with some bizarre $TERM entry, chances are you have found a bug. You are welcome to submit it to the <a href="mailto:nano-devel@gnu.org">nano-devel</a> list or in the <a href="https://savannah.gnu.org/bugs/?group=nano">bug tracker</a> on Savannah.</p></blockquote>
|
||||
<h2><a name="4.7"></a>4.7. nano crashes when I resize my window. How can I fix that?</h2>
|
||||
<blockquote><p>Older versions of nano had this problem, please upgrade to a newer version (at least 0.9.9, but 2.4.2 is recommended).</p></blockquote>
|
||||
<h2><a name="4.8"></a>4.8. [version 1.3.12 and later] I'm using glibc 2.2.3, and nano crashes when I use color support or do regular expression searches. How can I fix that?</h2>
|
||||
<blockquote><p>It's a bug in glibc 2.2.3. You should upgrade to at least glibc 2.2.4.</p></blockquote>
|
||||
<h2><a name="4.9"></a>4.9. [version 1.1.12 and earlier] Why does nano show ^\ in the shortcut list instead of ^J?</h2>
|
||||
<blockquote><p>The help (^G) and justify (^J) functions were among the last to be written. To show the improvements that nano had over Pico (go to line number, and replace), ^_ and ^\ were put on the shortcut list. Later, ^G came back in place of ^_ as it proved to be very valuable for new Unix users.</p></blockquote>
|
||||
<h2><a name="4.10a"></a>4.10a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</h2>
|
||||
<blockquote><p>Since nano version 0.9.20, the default was to have a completely consistent user interface across all user input functions. This means that regardless of whether you're being asked for a filename to insert or write, or a string to search for, the previous value is already inserted before the cursor.</p></blockquote>
|
||||
<h2><a name="4.10b"></a>4.10b. [version 1.1.99pre1 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</h2>
|
||||
<blockquote><p>It was decided that consistency was nice, but people are used to Pico's inconsistent behavior. Also, in version 1.1.99pre1, search and replace history was introduced. If you wish to edit your previous search/replace entry (or any previous entry), you can do so by hitting the up arrow to cycle through your history. This method allows the best of both worlds: You don't need to erase the previous string if you want to enter a new one, but you can with one keystroke recall previous entries for editing. Therefore there is now no "Pico mode", nano is and has always been a Pico <b>clone</b>, and clones by default should be compatible.</p></blockquote>
|
||||
<h2><a name="4.11"></a>4.11. How do I make nano my default editor (in Pine, mutt, etc.)?</h2>
|
||||
<blockquote><p>Older versions of nano had this problem. Please upgrade to version 2.7.0 or newer.</p></blockquote>
|
||||
<h2><a name="4.8"></a>4.8. When I paste text into a document, each line gets indented further than the last. Why does nano do this, and how can I avoid it?</h2>
|
||||
<blockquote><p>You have the autoindent feature turned on. Hit Meta-I to turn it off, paste your text, and then hit Meta-I again to turn it back on.</p></blockquote>
|
||||
<h2><a name="4.9"></a>4.9. I've compiled nano with color support, but I don't see any color when I run it!</h2>
|
||||
<blockquote><p>If you want nano to actually use color, you have to specify the color configurations you want it to use in your .nanorc. Several example configurations are in the <b>doc/syntax</b> subdirectory of the nano source, which are normally installed to <b>/usr/local/share/nano</b>. To enable all of them, uncomment the line <b># include "/usr/local/share/nano/*.nanorc"</b> in your nanorc. See also section <a href="#3.9a">3.9a</a>.</p></blockquote>
|
||||
<h2><a name="4.10"></a>4.10. How do I make nano my default editor (in Pine, mutt, etc.)?</h2>
|
||||
<blockquote><p>You need to make nano your $EDITOR. If you want this to be saved, you should put a line like this in your <b>.bashrc</b> if you use bash (or <b>.zshrc</b> if you believe in zsh):</p>
|
||||
<p><b>export EDITOR=/usr/local/bin/nano</b></p>
|
||||
<p>or, if you use tcsh, put this in your <b>.cshrc</b> file:</p>
|
||||
@@ -208,39 +207,37 @@
|
||||
<p>If you're a mutt user, you should see an effect immediately the next time you log in. No further configuration is needed. However, if you want to let people know you use nano to compose your email messages, you can put a line like this in your <b>.muttrc</b>:</p>
|
||||
<p><b>my_hdr X-Composer: nano x.y.z</b></p>
|
||||
<p>Again, replace x.y.z with the version of nano you use.</p></blockquote>
|
||||
<h2><a name="4.12"></a>4.12. I've compiled nano with color support, but I don't see any color when I run it!</h2>
|
||||
<blockquote><p>If you want nano to actually use color, you have to specify the color configurations you want it to use in your .nanorc. Several example configurations are in the <b>doc/syntax</b> subdirectory of the nano source, which are normally installed to <b>/usr/local/share/nano</b>. To enable all of them, uncomment the line <b># include "/usr/local/share/nano/*.nanorc"</b> in your nanorc. See also section <a href="#3.9a">3.9a</a>.</p></blockquote>
|
||||
<h2><a name="4.13"></a>4.13. How do I select text for or paste text from the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</h2>
|
||||
<h2><a name="4.11"></a>4.11. How do I select text for or paste text from the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</h2>
|
||||
<blockquote><p>Try holding down the Shift key and selecting or pasting the text as you normally would.</p></blockquote>
|
||||
<h2><a name="4.14"></a>4.14. When I paste text into a document, each line gets indented further than the last. Why does nano do this, and how can I avoid it?</h2>
|
||||
<blockquote><p>You have the autoindent feature turned on. Hit Meta-I to turn it off, paste your text, and then hit Meta-I again to turn it back on.</p></blockquote>
|
||||
<h2><a name="4.15"></a>4.15. On startup I get a message that says "Detected a legacy nano history file". Now older nano versions can't find my search history!</h2>
|
||||
<blockquote><p>In nano 2.3.0, cursor-position history was introduced, and both history files now reside under a .nano directory in your home. nano was trying to move this file into the new location so it could continue to use it. This means that if you try and use an earlier version of nano, it will be unable to see your current search history. To fix this, run the following commands:<br>
|
||||
<p><b>mv ~/.nano/search_history ~/.nano_history</b><br>
|
||||
<b>ln -sf ~/.nano_history ~/.nano/search_history</b></p>
|
||||
</p></blockquote>
|
||||
<h2><a name="4.12"></a>4.12. On startup I get a message that says "Detected a legacy nano history file". Now older nano versions can't find my search history!</h2>
|
||||
<blockquote><p>In nano 2.3.0, cursor-position history was introduced, and both history files now reside in a .nano subdirectory in your home directory. A newer nano will move an existing search-history file to this new location so it can continue to be used. This means that if you then try and use an earlier version of nano, it will be unable to see your current search history. To fix this, run the following command:</p>
|
||||
<p><b>ln -sf ~/.nano/search_history ~/.nano_history</b></p>
|
||||
<p>The "migration service" (moving the search-history file to its new location) will be deleted from nano in early 2018.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="5"></a>5. Internationalization</h1>
|
||||
<h2><a name="5.1"></a>5.1. There's no translation for my language!</h2>
|
||||
<blockquote><p>On June of 2001, GNU nano entered the <a href="http://translationproject.org/html/welcome.html">Translation Project</a> and since then, translations should be managed from there.</p>
|
||||
<blockquote><p>In June 2001, GNU nano entered the <a href="http://translationproject.org/html/welcome.html">Translation Project</a> and since then, translations should be managed from there.</p>
|
||||
<p>If there isn't a translation for your language, you could ask <a href="http://translationproject.org/team/">your language team</a> to translate nano, or better still, join that team and do it yourself. Joining a team is easy. You just need to ask the team leader to add you, and then send a <a href="http://translationproject.org/disclaim.txt">translation disclaimer to the FSF</a> (this is necessary as nano is an official GNU package, but it does <b>not</b> mean that you transfer the rights of your work to the FSF, it's just so the FSF can legally manage them).</p>
|
||||
<p>In any case, translating nano is very easy. Just grab the latest <b>nano.pot</b> file listed on <a href="http://translationproject.org/domain/nano.html">nano's page</a> at the TP, and translate each <b>msgid</b> line into your native language on the <b>msgstr</b> line. When you're done, you should send it to the TP's central po repository.</p></blockquote>
|
||||
<h2><a name="5.2"></a>5.2. I don't like the translation for <x> in my language. How can I fix it?</h2>
|
||||
<blockquote><p>The best way would probably be to send an e-mail to the team's mailing listed mentione in the <code>Language-Team:</code> field in the <b><your_language>.po</b> file with your suggested corrections, and then they can make the changes reach the nano-devel list.</p></blockquote>
|
||||
<h2><a name="5.3"></a>5.3. What is the status of Unicode support?</h2>
|
||||
<blockquote><p>In version 1.3.12 or later, Unicode should be usable. With your terminal, locale (LC_ALL and similar environment variables), and encoding configured to properly support UTF-8, you should be able to enter and save Unicode text.</p></blockquote>
|
||||
<blockquote><p>Since versions 1.3.12, Unicode should be usable. With your terminal, locale (LC_ALL and similar environment variables), and encoding configured to properly support UTF-8, you should be able to enter and save Unicode text.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="6"></a>6. Advocacy and Licensing</h1>
|
||||
<h2><a name="6.1"></a>6.1. Why should I use nano instead of Pico?</h2>
|
||||
<blockquote><p>There are many reasons to use nano instead of Pico. A more complete list can be found at the <a href="http://www.nano-editor.org/">nano homepage</a>.</p></blockquote>
|
||||
<blockquote><p>There are many reasons to use nano instead of Pico. A more complete list can be found at the <a href="https://nano-editor.org/">nano homepage</a>.</p></blockquote>
|
||||
<h2><a name="6.2"></a>6.2. Why should I use Pico instead of nano?</h2>
|
||||
<blockquote><p>Again, check out the <a href="http://www.nano-editor.org/">nano homepage</a> for a good summary of reasons. It really is a matter of personal preference as to which editor you should use. If you're the type of person who likes using the original version of a program, then Pico is the editor for you. If you don't mind sacrificing mailer integration with Pine, and are looking for a few more features, as well as a 'better' license in terms of adding your own changes, nano is the way to go.</p><p>Note that the last of these no longer applies to the new version of Pine, <a href="http://www.washington.edu/alpine/">Alpine</a>, which is under the Apache License, version 2.0.</p></blockquote>
|
||||
<blockquote><p>Again, check out the <a href="https://nano-editor.org/">nano homepage</a> for a good summary of reasons. It really is a matter of personal preference as to which editor you should use. If you're the type of person who likes using the original version of a program, then Pico is the editor for you. If you don't mind sacrificing mailer integration with Pine, and are looking for a few more features, as well as a 'better' license in terms of adding your own changes, nano is the way to go.</p><p>Note that the last of these no longer applies to the new version of Pine, <a href="http://www.washington.edu/alpine/">Alpine</a>, which is under the Apache License, version 2.0.</p></blockquote>
|
||||
<h2><a name="6.3"></a>6.3. What is so bad about the older Pine license?</h2>
|
||||
<blockquote><p>The U of W license for older versions of Pine and Pico is not considered truly Free Software according to both the Free Software Foundation and the <a href="http://www.debian.org/social_contract#guidelines">Debian Free Software Guidelines</a>. The main problem regards the limitations on distributing derived works: according to UW, you can distribute their software, and you can modify it, but you can not do both, i.e. distribute modified binaries.</p></blockquote>
|
||||
<h2><a name="6.4"></a>6.4. Okay, well, what mail program should I use then?</h2>
|
||||
<blockquote><p>If you are looking to use a Free Software program similar to Pine, and Emacs is not your thing, you should definitely take a look at <a href="http://www.mutt.org/">mutt</a>. It is a full-screen, console based mail program that actually has a lot more flexibility than Pine, but has a keymap included in the distribution that allows you to use the same keystrokes as Pine would to send and receive mail. It's also under the GNU General Public License, version 2.0.<P>
|
||||
Of course, due to the license change you can now use the <A HREF="http://www.washington.edu/alpine/">Alpine distribution</A> of PINE as it is now considered Free Software, but you would be sacrificing many of nano's features to do so.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="7"></a>7. Miscellaneous</h1>
|
||||
<h2><a name="7.1"></a>7.1. nano-related mailing lists.</h2>
|
||||
<blockquote><p>There are three mailing lists for nano hosted at <a href="http://savannah.gnu.org/">Savannah</a>: info-nano, help-nano and nano-devel. info-nano is a very low traffic list where new versions of nano are announced (surprise!). help-nano is for getting help with the editor without needing to hear all of the development issues surrounding it. nano-devel is a normally low, sometimes high traffic list for discussing the present and future development of nano. Here are links to where you can sign up for a given list:</p>
|
||||
@@ -248,84 +245,87 @@ Of course, due to the license change you can now use the <A HREF="http://www.was
|
||||
help-nano - <a href="http://mail.gnu.org/mailman/listinfo/help-nano/">http://mail.gnu.org/mailman/listinfo/help-nano/</a><br>
|
||||
nano-devel - <a href="http://mail.gnu.org/mailman/listinfo/nano-devel/">http://mail.gnu.org/mailman/listinfo/nano-devel/</a></p></blockquote>
|
||||
<h2><a name="7.2"></a>7.2. I want to send the development team a big load of cash (or just a thank you).</h2>
|
||||
<blockquote><p>That's fine. Send it <a href="mailto:nano-devel@gnu.org">our way</a>! Better yet, fix a <a href="https://savannah.gnu.org/bugs/?group=nano">bug</a> in the program or implement a <a href="http://www.nano-editor.org/dist/v2.3/TODO">cool feature</a> and send us that instead (though cash is fine too).</p></blockquote>
|
||||
<blockquote><p>That's fine. Send it <a href="mailto:nano-devel@gnu.org">our way</a>! Better yet, fix a <a href="https://savannah.gnu.org/bugs/?group=nano">bug</a> in the program or implement a <a href="https://nano-editor.org/dist/latest/TODO">cool feature</a> and send us that instead (though cash is fine too).</p></blockquote>
|
||||
<h2><a name="7.3"></a>7.3. How do I submit a bug report or patch?</h2>
|
||||
<blockquote>
|
||||
<p>The best place to submit bugs is to the <a href="https://savannah.gnu.org/bugs/?group=nano">Savannah bug tracker</a> as you can check whether the bug you are submitting has already been submitted.
|
||||
<p>Please submit patches for nano via the <a href="https://savannah.gnu.org/patch/?group=nano">Savannah project's patch manager</a> for the nano project.</p></blockquote>
|
||||
<p>The best place to submit bugs is to the <a href="https://savannah.gnu.org/bugs/?group=nano">Savannah bug tracker</a> as you can check whether the bug you are submitting has already been submitted.
|
||||
<p>Please submit patches for nano via the <a href="https://savannah.gnu.org/patch/?group=nano">Savannah project's patch manager</a> for the nano project.</p></blockquote>
|
||||
<h2><a name="7.4"></a>7.4. How do I join the development team?</h2>
|
||||
<blockquote><p>The easiest way is to consistently send in good patches that add some needed functionality, fix a bug or two, and/or make the program more optimized/efficient. Then ask nicely and you will probably be added to the Savannah development list and be given SVN write access after a while. There is a lot of responsibility that goes along with being a team member, so don't think it's just something to add to your resume.</p></blockquote>
|
||||
<h2><a name="7.5"></a>7.5. Can I have write access to the subversion tree?</h2>
|
||||
<blockquote><p>Re-read Section <a href="#7.4">7.4</a> and you should know the answer.</p></blockquote>
|
||||
<h2><a name="8"></a>8. ChangeLog</h2>
|
||||
<blockquote><p>The easiest way is to consistently send in good patches that add some needed functionality, fix a bug or two, and/or make the program more optimized/efficient. Then ask nicely and you will probably be added to the Savannah development list and be given write access after a while. There is a lot of responsibility that goes along with being a team member, so don't think it's just something to add to your resume.</p></blockquote>
|
||||
<h2><a name="7.5"></a>7.5. Can I have write access to the git tree?</h2>
|
||||
<blockquote><p>Re-read section <a href="#7.4">7.4</a> and you should know the answer.</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="8"></a>8. ChangeLog</h1>
|
||||
<blockquote><p>
|
||||
2015/07/18 - More small fixes and updates. (Benno)<br>
|
||||
2014/04/24 - A bunch of small fixes and updates. (Benno)<br>
|
||||
2009/11/30 - Update various bits for nano 2.2.x. (DLR)<br>
|
||||
2009/11/18 - Typo fix. (j.mader@gmail.com)<br>
|
||||
2008/03/16 - Update docs to refer to subversion instead of CVS, add more words about Alpine, and refer to Savannah for bugs and patches. (chrisa)<br>
|
||||
2007/12/21 - Update maintainer information. (DLR)<br>
|
||||
2007/12/09 - Add minor punctuation and wording fixes, and update various sections to account for Alpine. (DLR)<br>
|
||||
2007/08/26 - Update links to the Free Translation Project. (DLR)<br>
|
||||
2007/07/29 - Update RPM links for nano 2.0.x. (DLR)<br>
|
||||
2007/04/18 - Add a new section 4.14 to explain how autoindent affects pasted text. (John M. Gabriele, minor tweaks by DLR)<br>
|
||||
2007/04/04 - Update email address. (DLR)<br>
|
||||
2007/01/01 - Update section 4.1 to describe how to open files with names beginning with '+' at specified columns as well as lines. (DLR)<br>
|
||||
2006/11/25 - Add miscellaneous wording and capitalization fixes. (DLR)<br>
|
||||
2006/10/28 - Update various links for the 2.0 branch of nano. (DLR)<br>
|
||||
2006/10/06 - Update the question in section 4.13 to match the version of it in the answer section. (DLR)<br>
|
||||
2006/07/25 - Update section 5.3 again to not state "the latest development version" before 1.3.12, as it's no longer accurate. Also add some minor spacing fixes. (DLR)<br>
|
||||
2006/06/12 - Update section 5.3, due to the display fix for two-column Unicode characters. (DLR)<br>
|
||||
2006/06/05 - Add a new section 4.8, and move all section 4 entries after it down one number, to explain how to deal with glibc 2.2.3's crashes involving extended regular expressions. (DLR)<br>
|
||||
2006/06/04 - Add minor punctuation, wording, and typo fixes. (DLR)<br>
|
||||
2006/05/27 - Update section 3.8 to mention the new "Unicode Input" prompt, and how Unicode input only works when Unicode support is enabled. (DLR)<br>
|
||||
2006/05/12 - Remove section 4.4, and move all section 4 entries after it up one number, since it no longer applies. Meta-] and Meta-[ are no longer used to indent and unindent marked text, since they require that the bracket matching key change to Ctrl-], which is used as the telnet escape key (found by Chris). Also, make the link to the nano CVS page a bit more readable. (DLR)<br>
|
||||
2006/05/08 - Add a new section 4.5, and move all section 4 entries after it down one number, to explain a problem that can occur when holding down keys to generate Meta sequences. Also add a few more capitalization and wording fixes. (Benno Schulenberg, minor tweaks by DLR)<br>
|
||||
2006/05/01 - Add a new section 4.4, and move all section 4 entries after it down one number, to explain how to deal with problems typing Meta-[. Also add a few capitalization and wording fixes. (DLR)<br>
|
||||
2006/04/14 - Clarify section 1.4: help menu -> help text display. (DLR, suggested by Benno Schulenberg)<br>
|
||||
2006/03/16 - Update the Free Translation Project's address, change the character set to UTF-8, and remove broken links to contributed RedHat nano packages. (DLR)<br>
|
||||
2005/11/21 - Clarify section 5.3 to better explain how to enable Unicode support, and remove the mention of quirks, since they turned out to not be a nano problem. (Mike Frysinger and DLR)<br>
|
||||
2005/11/19 - Add a new section 5.3 to explain the status of nano's Unicode support. (Mike Frysinger, minor tweaks by DLR)<br>
|
||||
2005/08/27 - Update email address. (DLR)<br>
|
||||
2005/08/10 - Add a new section 4.3, and move all section 4 entries after it down one number, to explain how to deal with numeric keypad problems. (DLR)<br>
|
||||
2005/08/08 - Update section 3.8 to mention that verbatim input mode now takes a six-digit hexadecimal number. (DLR)<br>
|
||||
2005/07/04 - Update section 4.10 to mention that pasting from the X clipboard via the middle mouse button also works when the Shift key is used. (DLR)<br>
|
||||
2005/06/15 - Update description of --enable-extra, and add missing line breaks. (DLR)<br>
|
||||
2005/06/13 - Minor capitalization and wording fixes. (DLR)<br>
|
||||
2005/06/08 - Updated section 1.1 to mention the current maintainer. (DLR)<br>
|
||||
2005/03/09 - Added question about opening files with names beginning with '+'s, and added a few more miscellaneous cosmetic fixes. (DLR)<br>
|
||||
2005/01/03 - Removed now-inaccurate note about verbatim input's not working at prompts, and update its description to mention that it handles hexadecimal values now. (DLR)<br>
|
||||
2004/11/21 - Listed sh as an example of a Bourne shell. (DLR)<br>
|
||||
2004/11/05 - Fixed inaccuracy: Pico compatibility mode was made the default in nano 1.1.99pre1, not 1.2.2. Also added question about how to type F13-F16 on terminals lacking keys past F12 (suggested by Chris), question about how to select text for the clipboard in X terminals with nano's mouse support turned on (answer found by Joseph Birthisel), and misc. fixes and link updates. (DLR)<br>
|
||||
2004/04/07 - Removed NumLock glitch question, as it's no longer needed. (DLR)<br>
|
||||
2004/01/30 - Fixed inaccuracy: multibuffer mode was first in nano 1.1.0, not 1.1.12. (DLR)<br>
|
||||
2003/12/31 - Added question about the new verbatim input function, and a few minor fixes. Removed reference to "set pico" (DLR).<br>
|
||||
2003/07/02 - Added question about nano's not showing color when it's compiled with color support (DLR; suggested by Jordi).<br>
|
||||
2003/02/23 - Updated RPM links for nano 1.2.x (DLR).<br>
|
||||
2003/01/16 - Split section 4.5 into 4.5a and 4.5b for search string behavior. Added --enable-all docs.<br>
|
||||
2002/12/28 - More misc. fixes (David Benbennick, DLR).<br>
|
||||
2002/10/25 - Misc. fixes and link updates (DLR).<br>
|
||||
2002/09/10 - Another typo fix (DLR).<br>
|
||||
2002/05/15 - Typo fix (DLR).<br>
|
||||
2001/12/26 - Misc. fixes (Aaron S. Hawley, DLR).<br>
|
||||
2001/10/02 - Update for Free Translation Project.<br>
|
||||
2001/10/02 - Assorted fixes, Debian additions.<br>
|
||||
2001/06/30 - Silly typo fix.<br>
|
||||
2001/05/05 - Spelling fixes by David Lawrence Ramsey.<br>
|
||||
2001/05/02 - Misc fixes.<br>
|
||||
2001/03/26 - Typo fix in an URL.<br>
|
||||
2001/02/17 - Advocacy updates.<br>
|
||||
2001/02/15 - Added GNU notes for 0.9.99pre3.<br>
|
||||
2001/02/06 - Typo fixes.<br>
|
||||
2001/01/14 - Added note about NumLock glitch.<br>
|
||||
2001/01/10 - Linux -> GNU/Linux.<br>
|
||||
2001/01/09 - Added "making exe smaller" section.<br>
|
||||
2000/12/19 - Typo and assorted error fixes.<br>
|
||||
2000/11/28 - Added blurb about make install-strip.<br>
|
||||
2000/11/19 - Changed Debian frozen to stable.<br>
|
||||
2000/11/18 - Previous string display (4.5).<br>
|
||||
2000/09/27 - Moved addresses to nano-editor.org.<br>
|
||||
2000/06/31 - Initial framework.</p></blockquote>
|
||||
<p>$Id$</p>
|
||||
2017.01.09 - Delete some obsolete items and update a few others. (Benno)<br>
|
||||
2016.04.17 - Update docs to refer to GIT instead of subversion. (Mike)<br>
|
||||
2015.07.18 - More small fixes and updates. (Benno)<br>
|
||||
2014.04.24 - A bunch of small fixes and updates. (Benno)<br>
|
||||
2009.11.30 - Update various bits for nano 2.2.x. (DLR)<br>
|
||||
2009.11.18 - Typo fix. (j.mader@gmail.com)<br>
|
||||
2008.03.16 - Update docs to refer to subversion instead of CVS, add more words about Alpine, and refer to Savannah for bugs and patches. (Chris)<br>
|
||||
2007.12.21 - Update maintainer information. (DLR)<br>
|
||||
2007.12.09 - Add minor punctuation and wording fixes, and update various sections to account for Alpine. (DLR)<br>
|
||||
2007.08.26 - Update links to the Free Translation Project. (DLR)<br>
|
||||
2007.07.29 - Update RPM links for nano 2.0.x. (DLR)<br>
|
||||
2007.04.18 - Add a new section 4.14 to explain how autoindent affects pasted text. (John M. Gabriele, minor tweaks by DLR)<br>
|
||||
2007.04.04 - Update email address. (DLR)<br>
|
||||
2007.01.01 - Update section 4.1 to describe how to open files with names beginning with '+' at specified columns as well as lines. (DLR)<br>
|
||||
2006.11.25 - Add miscellaneous wording and capitalization fixes. (DLR)<br>
|
||||
2006.10.28 - Update various links for the 2.0 branch of nano. (DLR)<br>
|
||||
2006.10.06 - Update the question in section 4.13 to match the version of it in the answer section. (DLR)<br>
|
||||
2006.07.25 - Update section 5.3 again to not state "the latest development version" before 1.3.12, as it's no longer accurate. Also add some minor spacing fixes. (DLR)<br>
|
||||
2006.06.12 - Update section 5.3, due to the display fix for two-column Unicode characters. (DLR)<br>
|
||||
2006.06.05 - Add a new section 4.8, and move all section 4 entries after it down one number, to explain how to deal with glibc 2.2.3's crashes involving extended regular expressions. (DLR)<br>
|
||||
2006.06.04 - Add minor punctuation, wording, and typo fixes. (DLR)<br>
|
||||
2006.05.27 - Update section 3.8 to mention the new "Unicode Input" prompt, and how Unicode input only works when Unicode support is enabled. (DLR)<br>
|
||||
2006.05.12 - Remove section 4.4, and move all section 4 entries after it up one number, since it no longer applies. Meta-] and Meta-[ are no longer used to indent and unindent marked text, since they require that the bracket matching key change to Ctrl-], which is used as the telnet escape key (found by Chris). Also, make the link to the nano CVS page a bit more readable. (DLR)<br>
|
||||
2006.05.08 - Add a new section 4.5, and move all section 4 entries after it down one number, to explain a problem that can occur when holding down keys to generate Meta sequences. Also add a few more capitalization and wording fixes. (Benno Schulenberg, minor tweaks by DLR)<br>
|
||||
2006.05.01 - Add a new section 4.4, and move all section 4 entries after it down one number, to explain how to deal with problems typing Meta-[. Also add a few capitalization and wording fixes. (DLR)<br>
|
||||
2006.04.14 - Clarify section 1.4: help menu -> help text display. (DLR, suggested by Benno Schulenberg)<br>
|
||||
2006.03.16 - Update the Free Translation Project's address, change the character set to UTF-8, and remove broken links to contributed RedHat nano packages. (DLR)<br>
|
||||
2005.11.21 - Clarify section 5.3 to better explain how to enable Unicode support, and remove the mention of quirks, since they turned out to not be a nano problem. (Mike Frysinger and DLR)<br>
|
||||
2005.11.19 - Add a new section 5.3 to explain the status of nano's Unicode support. (Mike Frysinger, minor tweaks by DLR)<br>
|
||||
2005.08.27 - Update email address. (DLR)<br>
|
||||
2005.08.10 - Add a new section 4.3, and move all section 4 entries after it down one number, to explain how to deal with numeric keypad problems. (DLR)<br>
|
||||
2005.08.08 - Update section 3.8 to mention that verbatim input mode now takes a six-digit hexadecimal number. (DLR)<br>
|
||||
2005.07.04 - Update section 4.10 to mention that pasting from the X clipboard via the middle mouse button also works when the Shift key is used. (DLR)<br>
|
||||
2005.06.15 - Update description of --enable-extra, and add missing line breaks. (DLR)<br>
|
||||
2005.06.13 - Minor capitalization and wording fixes. (DLR)<br>
|
||||
2005.06.08 - Updated section 1.1 to mention the current maintainer. (DLR)<br>
|
||||
2005.03.09 - Added question about opening files with names beginning with '+'s, and added a few more miscellaneous cosmetic fixes. (DLR)<br>
|
||||
2005.01.03 - Removed now-inaccurate note about verbatim input's not working at prompts, and update its description to mention that it handles hexadecimal values now. (DLR)<br>
|
||||
2004.11.21 - Listed sh as an example of a Bourne shell. (DLR)<br>
|
||||
2004.11.05 - Fixed inaccuracy: Pico compatibility mode was made the default in nano 1.1.99pre1, not 1.2.2. Also added question about how to type F13-F16 on terminals lacking keys past F12 (suggested by Chris), question about how to select text for the clipboard in X terminals with nano's mouse support turned on (answer found by Joseph Birthisel), and misc. fixes and link updates. (DLR)<br>
|
||||
2004.04.07 - Removed NumLock glitch question, as it's no longer needed. (DLR)<br>
|
||||
2004.01.30 - Fixed inaccuracy: multibuffer mode was first in nano 1.1.0, not 1.1.12. (DLR)<br>
|
||||
2003.12.31 - Added question about the new verbatim input function, and a few minor fixes. Removed reference to "set pico" (DLR).<br>
|
||||
2003.07.02 - Added question about nano's not showing color when it's compiled with color support (DLR; suggested by Jordi).<br>
|
||||
2003.02.23 - Updated RPM links for nano 1.2.x (DLR).<br>
|
||||
2003.01.16 - Split section 4.5 into 4.5a and 4.5b for search string behavior. Added --enable-all docs.<br>
|
||||
2002.12.28 - More misc. fixes (David Benbennick, DLR).<br>
|
||||
2002.10.25 - Misc. fixes and link updates (DLR).<br>
|
||||
2002.09.10 - Another typo fix (DLR).<br>
|
||||
2002.05.15 - Typo fix (DLR).<br>
|
||||
2001.12.26 - Misc. fixes (Aaron S. Hawley, DLR).<br>
|
||||
2001.10.02 - Update for Free Translation Project.<br>
|
||||
2001.10.02 - Assorted fixes, Debian additions.<br>
|
||||
2001.06.30 - Silly typo fix.<br>
|
||||
2001.05.05 - Spelling fixes by David Lawrence Ramsey.<br>
|
||||
2001.05.02 - Misc fixes.<br>
|
||||
2001.03.26 - Typo fix in an URL.<br>
|
||||
2001.02.17 - Advocacy updates.<br>
|
||||
2001.02.15 - Added GNU notes for 0.9.99pre3.<br>
|
||||
2001.02.06 - Typo fixes.<br>
|
||||
2001.01.14 - Added note about NumLock glitch.<br>
|
||||
2001.01.10 - Linux -> GNU/Linux.<br>
|
||||
2001.01.09 - Added "making exe smaller" section.<br>
|
||||
2000.12.19 - Typo and assorted error fixes.<br>
|
||||
2000.11.28 - Added blurb about make install-strip.<br>
|
||||
2000.11.19 - Changed Debian frozen to stable.<br>
|
||||
2000.11.18 - Previous string display (4.5).<br>
|
||||
2000.09.27 - Moved addresses to nano-editor.org.<br>
|
||||
2000.06.31 - Initial framework.</p></blockquote>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
3
doc/man/.gitignore
vendored
3
doc/man/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
nano.1.html
|
||||
nanorc.5.html
|
||||
rnano.1.html
|
||||
@@ -1,28 +0,0 @@
|
||||
SUBDIRS =
|
||||
BUILT_SOURCES =
|
||||
|
||||
if USE_NLS
|
||||
SUBDIRS += fr
|
||||
endif
|
||||
|
||||
dist_man_MANS = nano.1 rnano.1
|
||||
html_pages = nano.1.html rnano.1.html
|
||||
|
||||
if USE_NANORC
|
||||
dist_man_MANS += nanorc.5
|
||||
html_pages += nanorc.5.html
|
||||
endif
|
||||
|
||||
nano.1.html: nano.1
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
nanorc.5.html: nanorc.5
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
rnano.1.html: rnano.1
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
|
||||
if GROFF_HTML
|
||||
BUILT_SOURCES += $(html_pages)
|
||||
dist_html_DATA = $(html_pages)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = $(BUILT_SOURCES)
|
||||
@@ -1,26 +0,0 @@
|
||||
mandir = @mandir@/fr
|
||||
htmldir = @htmldir@/fr
|
||||
|
||||
BUILT_SOURCES =
|
||||
|
||||
dist_man_MANS = nano.1 rnano.1
|
||||
html_pages = nano.1.html rnano.1.html
|
||||
|
||||
if USE_NANORC
|
||||
dist_man_MANS += nanorc.5
|
||||
html_pages += nanorc.5.html
|
||||
endif
|
||||
|
||||
nano.1.html: nano.1
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
nanorc.5.html: nanorc.5
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
rnano.1.html: rnano.1
|
||||
groff -t -mandoc -Thtml < $? > $@
|
||||
|
||||
if GROFF_HTML
|
||||
BUILT_SOURCES += $(html_pages)
|
||||
dist_html_DATA = $(html_pages)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = $(BUILT_SOURCES)
|
||||
@@ -1,326 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||
.\" Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" Le travail d'adaptation française de cette page de manuel a été
|
||||
.\" réalisé par Jean-Philippe Guérard, en 2003, 2004, 2005, 2006 et 2007.
|
||||
.\" Ce travail d'adaptation est dans le domaine public. Attention, la
|
||||
.\" page traduite reste soumise au droit d'auteur de ses auteurs
|
||||
.\" originaux.
|
||||
.\"
|
||||
.\" The French translation of this document is a public domain work of
|
||||
.\" Jean-Philippe Guérard. This translation work was made in 2003, 2004,
|
||||
.\" 2005, 2006 and 2007. The translated man page in itself is still
|
||||
.\" subject to the copyright of its original authors.
|
||||
.\"
|
||||
.\" This document is dual-licensed. You may distribute and/or modify it
|
||||
.\" under the terms of either of the following licenses:
|
||||
.\"
|
||||
.\" * The GNU General Public License, as published by the Free Software
|
||||
.\" Foundation, version 3 or (at your option) any later version. You
|
||||
.\" should have received a copy of the GNU General Public License
|
||||
.\" along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" * The GNU Free Documentation License, as published by the Free
|
||||
.\" Software Foundation, version 1.2 or (at your option) any later
|
||||
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
|
||||
.\" Back-Cover Texts. You should have received a copy of the GNU Free
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" Ce document est publié sous une double licence. Vous pouvez
|
||||
.\" le distribuer et le modifier selon les termes de l'une des deux
|
||||
.\" licences ci-dessous :
|
||||
.\"
|
||||
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
|
||||
.\" votre choix, supérieure, telle que publiée par la Free
|
||||
.\" Software Foundation. Vous devriez avoir reçu une copie de la
|
||||
.\" Licence publique générale GNU avec ce programme. Si ce n'est pas
|
||||
.\" le cas, consultez <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2 ou,
|
||||
.\" à votre choix, supérieure, telle que publiée par la Free
|
||||
.\" Software Foundation, sans section invariante, ni texte de
|
||||
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
|
||||
.\" une copie de la Licence de documentation libre GNU avec ce
|
||||
.\" programme. Si ce n'est pas le cas, consultez
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANO 1 "version 2.0.0" "29\ novembre\ 2007"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
|
||||
.\"
|
||||
|
||||
.SH NOM
|
||||
nano \- NAno un NOuvel éditeur, un clone libre et amélioré de Pico
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B nano
|
||||
.I [OPTIONS]\ [[+LIGNE,COLONNE]\ FICHIER]...
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
Cette page de manuel décrit brièvement la commande \fBnano\fR.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" respectively.
|
||||
\fBnano\fR est un éditeur petit, sympathique et libre, qui vise à remplacer
|
||||
Pico, l'éditeur par défaut du logiciel non libre Pine. \fBnano\fR ne se
|
||||
contentant pas de copier l'interface et l'ergonomie de Pico, il offre
|
||||
également certaines fonctions manquantes (ou désactivées par défaut)
|
||||
dans Pico. Ces fonctionnalités sont, par exemple, les fonctions de
|
||||
recherche et de remplacement, et la possibilité de sauter directement à
|
||||
une ligne et à une colonne précise.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B +\fILIGNE\fP,\fICOLONNE\fP
|
||||
Démarre avec le curseur positionné à la colonne \fICOLONNE\fP de
|
||||
la ligne \fILIGNE\fR (l'un des deux, au moins, devant être spécifié) au
|
||||
lieu de démarrer à la colonne\ 1, ligne\ 1.
|
||||
.TP
|
||||
.B \-?
|
||||
Identique à \fB\-h (\-\-help)\fP.
|
||||
.TP
|
||||
.B \-A (\-\-smarthome)
|
||||
Rend plus malin le fonctionnement de la touche «\ Début\ ». Lorsque l'on
|
||||
appuie sur cette touche à n'importe quel endroit excepté au tout début
|
||||
du texte d'une ligne (i.\ e. au premier caractère non blanc), le curseur
|
||||
se positionnera au début du texte de la ligne (qu'il soit en avant ou en
|
||||
arrière). Si le curseur est déjà là, il se placera au vrai début de la
|
||||
ligne.
|
||||
.TP
|
||||
.B \-B (\-\-backup)
|
||||
Lors de l'écriture d'un fichier, crée une copie de sécurité de la
|
||||
version précédente, en ajoutant un tilde (~) au nom du fichier.
|
||||
.TP
|
||||
.B \-D (\-\-boldtext)
|
||||
Utilise des caractères gras à la place de la vidéo inverse.
|
||||
.TP
|
||||
.B \-C \fIrépertoire\fP (\-\-backupdir=\fIrépertoire\fP)
|
||||
Définit le répertoire utilisé par \fBnano\fP pour enregistrer les copies
|
||||
de sécurité uniques si celles-ci sont activées.
|
||||
.TP
|
||||
.B \-E (\-\-tabstospaces)
|
||||
Convertit les tabulations clavier en espaces.
|
||||
.TP
|
||||
.B \-F (\-\-multibuffer)
|
||||
Active le mode multi-espace, autorisant l'édition simultanée de
|
||||
plusieurs fichiers, si ce mode est disponible.
|
||||
.TP
|
||||
.B \-H (\-\-historylog)
|
||||
Enregistre les chaînes ayant fait l'objet d'une recherche ou d'un
|
||||
remplacement dans le fichier \fI~/.nano_history\fR afin de permettre leur
|
||||
réutilisation. Ceci n'est possible que si \fBnano\fR est configuré pour
|
||||
utiliser les fichiers nanorc.
|
||||
.TP
|
||||
.B \-I (\-\-ignorercfiles)
|
||||
Ne pas utiliser pas les fichiers \fISYSCONFDIR/nanorc\fR et
|
||||
\fI~/.nanorc\fR (si \fBnano\fR est capable de les utiliser).
|
||||
.TP
|
||||
.B \-K (\-\-rebindkeypad)
|
||||
Interprète les touches du pavé numérique afin qu'elles fonctionnent
|
||||
toutes correctement. Vous ne devriez utiliser cette option que si ce
|
||||
n'est pas le cas, car nano ne sera plus capable d'utiliser la souris
|
||||
correctement lorsque cette option sera activée.
|
||||
.TP
|
||||
.B \-L (\-\-nonewlines)
|
||||
Ne pas ajouter de passage à la ligne à la fin des fichiers.
|
||||
.TP
|
||||
.B \-N (\-\-noconvert)
|
||||
Désactive la conversion automatique des fichiers depuis les formats Mac et
|
||||
DOS.
|
||||
.TP
|
||||
.B \-O (\-\-morespace)
|
||||
Utiliser la ligne blanche située sous la ligne de titre comme
|
||||
espace supplémentaire d'édition.
|
||||
.TP
|
||||
.B \-Q \fIchaîne\fP (\-\-quotestr=\fIchaîne\fP)
|
||||
Définit le préfixe par défaut des citations. Nano utilise ce préfixe
|
||||
pour réaliser une justification correcte des citations. Si nano est
|
||||
capable d'utiliser des expressions rationnelles, le préfixe par défaut
|
||||
sera "\fI^([\ \\t]*[#:>\\|}])+\fP", sinon, ce sera "\fI>\ \fP". Dans
|
||||
l'expression rationnelle précédente, «\ \fI\\t\fP\ » représente une
|
||||
tabulation.
|
||||
.TP
|
||||
.B \-R (\-\-restricted)
|
||||
Mode restreint\ : aucune lecture ou écriture de fichiers non indiqués
|
||||
sur la ligne de commande, pas de lecture des fichiers nanorc,
|
||||
interdiction de suspendre, interdiction d'ajouter au début, à la fin,
|
||||
de sauvegarder un fichier ayant déjà un nom sous un nom différent,
|
||||
d'utiliser une copie de sécurité ou le correcteur orthographique. Cette
|
||||
option peut aussi être activée en appelant \fBnano\fP sous un nom
|
||||
commençant par «\ r\ » (par exemple «\ rnano\ »).
|
||||
.TP
|
||||
.B \-S (\-\-smooth)
|
||||
Active le défilement progressif. Le texte défilera ligne-par-ligne au lieu
|
||||
de défiler morceau-par-morceau.
|
||||
.TP
|
||||
.B \-T \fInombre\fP (\-\-tabsize=\fInombre\fP)
|
||||
Définit la taille (largeur) des tabulations en nombre de colonnes. Le
|
||||
nombre indiqué doit être strictement supérieur à 0. La valeur par défaut
|
||||
est de 8.
|
||||
.TP
|
||||
.B \-U (\-\-quickblank)
|
||||
Effacement rapide de la ligne d'état. Les messages affichés par la ligne
|
||||
d'état disparaîtront après une frappe clavier au lieu de 25. Notez que
|
||||
l'option \fB-c\fP prend le pas sur cette option.
|
||||
.TP
|
||||
.B \-V (\-\-version)
|
||||
Affiche la version, puis s'arrête.
|
||||
.TP
|
||||
.B \-W (\-\-wordbounds)
|
||||
Détection plus précise des limites de mots, obtenue en considérant les
|
||||
caractères de ponctuation comme faisant partie des mots.
|
||||
.TP
|
||||
.B \-Y \fIchaîne\fP (\-\-syntax=\fIchaîne\fP)
|
||||
Indique quel mode de colorisation syntaxique adopter, parmi les modes
|
||||
définis dans le fichier \fI.nanorc\fR, si cette fonctionnalité est
|
||||
disponible.
|
||||
.TP
|
||||
.B \-c (\-\-const)
|
||||
Affiche en permanence la position du curseur. Notez que cette option
|
||||
prend le pas sur l'option \fB-U\fP.
|
||||
.TP
|
||||
.B \-d (\-\-rebinddelete)
|
||||
Interprète différemment la touche «\ Supprimer\ », afin que les touches
|
||||
«\ Effacement arrière\ » et «\ Supprimer\ » fonctionnent correctement.
|
||||
Vous ne devriez avoir besoin de cette option que si, sur votre système,
|
||||
la touche «\ Effacement arrière\ » produit l'effet de la touche
|
||||
«\ Supprimer\ ».
|
||||
.TP
|
||||
.B \-h (\-\-help)
|
||||
Affiche un résumé des options de lancement de nano, puis s'arrête.
|
||||
.TP
|
||||
.B \-i (\-\-autoindent)
|
||||
Indentation automatique. Commence chaque nouvelle ligne au même niveau que
|
||||
la ligne précédente. Utile pour l'édition de code source.
|
||||
.TP
|
||||
.B \-k (\-\-cut)
|
||||
Coupe le texte du curseur à la fin de la ligne, au lieu de couper la
|
||||
ligne entière.
|
||||
.TP
|
||||
.B \-l (\-\-nofollow)
|
||||
Si le fichier édité est un lien symbolique, au lieu de le suivre,
|
||||
remplace le lien par le nouveau fichier. Sans doute utile pour éditer
|
||||
les fichiers de \fI/tmp\fR, non\ ?
|
||||
.TP
|
||||
.B \-m (\-\-mouse)
|
||||
Active l'utilisation de la souris, si elle est disponible pour votre
|
||||
système. Lorsque celle-ci est activée, il est possible d'utiliser la
|
||||
souris pour positionner le curseur, pour marquer le texte (avec un
|
||||
double-clic) et pour lancer les fonctions correspondant aux raccourcis.
|
||||
Il est possible d'utiliser la souris sous X\ Window ou en mode console
|
||||
avec gpm.
|
||||
.TP
|
||||
.B \-o \fIrépertoire\fP (\-\-operatingdir=\fIrépertoire\fP)
|
||||
Définit le répertoire de travail. Demande à \fBnano\fP de mettre en place
|
||||
quelque chose de similaire à un environnement d'exécution restreint
|
||||
(\fIchroot\fR).
|
||||
.TP
|
||||
.B \-p (\-\-preserve)
|
||||
Préserve les séquences XON et XOFF (^Q et ^S), afin qu'elle soient reçues
|
||||
par le terminal.
|
||||
.TP
|
||||
.B \-r \fIcolonne\fP (\-\-fill=\fIcolonne\fP)
|
||||
Passe automatiquement à la ligne une fois arrivé à la colonne
|
||||
\fIcolonne\fR. Si la valeur indiquée est de 0 ou moins, le point de
|
||||
passage à la ligne aura lieu à la taille de l'écran moins \fIcolonne\fR.
|
||||
Cela permet de faire varier le point de passage à la ligne lorsque l'on
|
||||
change la taille de l'écran. La valeur par défaut est de \-8.
|
||||
.TP
|
||||
.B \-s \fIprogramme\fP (\-\-speller=\fIprogramme\fP)
|
||||
Choix d'un correcteur orthographique de remplacement.
|
||||
.TP
|
||||
.B \-t (\-\-tempfile)
|
||||
S'il a été modifié, le fichier sera sauvegardé automatiquement sans
|
||||
demande de confirmation. Identique à l'option \fB-t\fP de Pico.
|
||||
.TP
|
||||
.B \-v (\-\-view)
|
||||
Mode visualisation (lecture seule).
|
||||
.TP
|
||||
.B \-w (\-\-nowrap)
|
||||
Désactive le passage automatique à la ligne.
|
||||
.TP
|
||||
.B \-x (\-\-nohelp)
|
||||
Désactive la barre d'aide affichée en bas de l'écran.
|
||||
.TP
|
||||
.B \-z (\-\-suspend)
|
||||
Autorise à suspendre l'éditeur.
|
||||
.TP
|
||||
.B \-a, \-b, \-e, \-f, \-g, \-j
|
||||
Ignoré, pour être compatible avec Pico.
|
||||
|
||||
.SH "FICHIERS D'INITIALISATION"
|
||||
\fBnano\fR lit les fichiers d'initialisation dans l'ordre suivant\ :
|
||||
\fISYSCONFDIR/nanorc\fR, puis \fI~/.nanorc\fR. Référez-vous à la page de
|
||||
manuel de \fBnanorc(5)\fR et au fichier d'exemple \fInanorc.sample\fR,
|
||||
qui devraient tous les deux être livrés avec \fBnano\fR.
|
||||
|
||||
.SH NOTES
|
||||
Si aucun correcteur orthographique de remplacement n'est indiqué dans la
|
||||
ligne de commande ou dans l'un des fichiers nanorc, \fBnano\fR prendra
|
||||
la commande indiquée par la variable d'environnement \fBSPELL\fR si
|
||||
elle est définie.
|
||||
|
||||
Dans certains cas, \fBnano\fR essaiera de sauvegarder le fichier en cours
|
||||
d'édition dans un fichier de secours. Cela arrivera principalement si
|
||||
\fBnano\fR reçoit un signal SIGHUP ou SIGTERM, ou bien se trouve à court de
|
||||
mémoire. Le nom de ce fichier de secours sera \fInano.save\fR si le fichier en
|
||||
cours n'avait pas encore de nom, ou sera composé du nom du fichier en cours
|
||||
suivi du suffixe «\ .save\ ». Si un fichier de ce nom existe déjà dans
|
||||
le répertoire, un «\ .save\ » et un nombre seront ajoutés à la fin du
|
||||
nom du fichier en cours afin de le rendre unique (par exemple,
|
||||
«\ .save.1\ »). En mode multi-espace, \fBnano\fR réalisera une
|
||||
sauvegarde de tous les fichiers en cours dans leurs fichiers de secours
|
||||
respectifs.
|
||||
|
||||
.SH BOGUES
|
||||
Merci de nous faire parvenir vos commentaires et de nous signaler les
|
||||
bogues, en écrivant, en anglais, à \fBnano@nano-editor.org\fR.
|
||||
|
||||
La liste de discussion anglophone \fBnano\fR est disponible à l'adresse
|
||||
\fBnano-devel@gnu.org\fR.
|
||||
|
||||
Pour vous abonner, envoyez un courrier électronique à
|
||||
\fBnano-devel-request@gnu.org\fR, ayant pour objet «\ subscribe\ ».
|
||||
|
||||
N'hésitez pas également à envoyez vos commentaires, suggestions et
|
||||
corrections relatives à l'adaptation française de cette page de manuel
|
||||
ou du logiciel à \fBjean-philippe.guerard@tigreraye.org\fR.
|
||||
|
||||
.SH "SITE INTERNET"
|
||||
http://www.nano-editor.org/
|
||||
|
||||
.SH "VOIR AUSSI"
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnanorc\fR(5)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/\fR (ou son équivalent sur votre système)
|
||||
|
||||
.SH AUTEUR
|
||||
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
|
||||
\fIAUTHORS\fR et \fITHANKS\fR pour plus d'information). Cette page de
|
||||
manuel a été initialement rédigée par Jordi Mallach <jordi@gnu.org> pour
|
||||
le système Debian (mais elle peut être utilisée par d'autres).
|
||||
|
||||
.SH TRADUCTION
|
||||
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
|
||||
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir
|
||||
de la version 1.54 du 11\ octobre\ 2007 de la page de manuel de nano
|
||||
2.0.0. Cette page a été relue par Gérard Delafond.
|
||||
|
||||
Un maximum de soin a été apporté lors de l'élaboration de cette
|
||||
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
|
||||
vous en rencontrez, que ce soit dans la version française ou dans la
|
||||
version originale, n'hésitez pas à les signaler à l'auteur ou au
|
||||
traducteur.
|
||||
|
||||
La version originale la plus à jour de ce document est toujours
|
||||
consultable via la commande\ :
|
||||
|
||||
LANGUAGE=en man nano
|
||||
@@ -1,376 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" Copyright (C) 2003, 2004, 2005, 2006, 2007
|
||||
.\" Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" Le travail d'adaptation française de cette page de manuel a été
|
||||
.\" réalisé par Jean-Philippe Guérard, en 2003, 2004, 2005, 2006 et 2007.
|
||||
.\" Ce travail d'adaptation est dans le domaine public. Attention, la
|
||||
.\" page traduite reste soumise au droit d'auteur de ses auteurs
|
||||
.\" originaux.
|
||||
.\"
|
||||
.\" The French translation of this document is a public domain work of
|
||||
.\" Jean-Philippe Guérard. This translation work was made in 2003, 2004,
|
||||
.\" 2005, 2006 and 2007. The translated man page in itself is still
|
||||
.\" subject to the copyright of its original authors.
|
||||
.\"
|
||||
.\" This document is dual-licensed. You may distribute and/or modify it
|
||||
.\" under the terms of either of the following licenses:
|
||||
.\"
|
||||
.\" * The GNU General Public License, as published by the Free Software
|
||||
.\" Foundation, version 3 or (at your option) any later version. You
|
||||
.\" should have received a copy of the GNU General Public License
|
||||
.\" along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" * The GNU Free Documentation License, as published by the Free
|
||||
.\" Software Foundation, version 1.2 or (at your option) any later
|
||||
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
|
||||
.\" Back-Cover Texts. You should have received a copy of the GNU Free
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" Ce document est publié sous une double licence. Vous pouvez
|
||||
.\" le distribuer et le modifier selon les termes de l'une des deux
|
||||
.\" licences ci-dessous :
|
||||
.\"
|
||||
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
|
||||
.\" votre choix, supérieure, telle que publiée par la Free
|
||||
.\" Software Foundation. Vous devriez avoir reçu une copie de la
|
||||
.\" Licence publique générale GNU avec ce programme. Si ce n'est
|
||||
.\" pas le cas, consultez <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2
|
||||
.\" ou, à votre choix, supérieure, telle que publiée par la Free
|
||||
.\" Software Foundation, sans section invariante, ni texte de
|
||||
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
|
||||
.\" une copie de la Licence de documentation libre GNU avec ce
|
||||
.\" programme. Si ce n'est pas le cas, consultez
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANORC 5 "version 2.0.0" "29\ novembre\ 2007"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
|
||||
|
||||
.SH NOM
|
||||
nanorc \- fichier de configuration de l'éditeur nano du projet GNU
|
||||
|
||||
.SH DESCRIPTION
|
||||
Cette page de manuel décrit brièvement le fichier de configuration de
|
||||
l'éditeur \fBnano\fP GNU.
|
||||
.PP
|
||||
\fBnano\fP est un petit éditeur sympathique et libre, qui vise à
|
||||
remplacer Pico, l'éditeur par défaut du logiciel non libre Pine.
|
||||
\fBnano\fP ne se contentant pas de copier l'interface et l'ergonomie de
|
||||
Pico, il offre également certaines fonctionnalités manquantes (ou
|
||||
désactivées par défaut) de Pico. Ces fonctionnalités sont, par exemple,
|
||||
les fonctions de recherche et de remplacement et la possibilité de
|
||||
sauter directement à une ligne et à une colonne précise.
|
||||
.PP
|
||||
Le fichier \fInanorc\fP contient les paramètres par défaut de
|
||||
\fBnano\fP. Il ne doit pas être au format DOS ou Mac. Lors de son
|
||||
démarrage, nano commencera par lire le fichier de configuration général
|
||||
\fISYSCONFDIR/nanorc\fP, puis lira le fichier de configuration personnel
|
||||
de l'utilisateur \fI~/.nanorc\fP.
|
||||
|
||||
.SH OPTIONS
|
||||
Le fichier de configuration accepte une série de commandes \fBset\fP
|
||||
(activer) et \fBunset\fP (désactiver), qui permettent de définir le
|
||||
paramétrage de nano au démarrage sans avoir à utiliser d'options de
|
||||
ligne de commande. De plus, les mots clefs \fBsyntax\fP (syntaxe),
|
||||
\fBcolor\fP (couleur) et \fBicolor\fP (couleur insensible à la casse)
|
||||
sont utilisés pour définir les règles de colorisation pour différents
|
||||
motifs de texte. \fBnano\fP lit une commande par ligne.
|
||||
|
||||
Les options du fichier de configuration ont priorité sur les valeurs par
|
||||
défaut utilisées par nano. Les options de la ligne de commande sont
|
||||
prioritaires par rapport aux options du fichier de configuration. Les
|
||||
options sont désactivées (unset) par défaut, sauf les options prenant un
|
||||
argument.
|
||||
|
||||
Les apostrophes («\ \fI'\fP\ ») et les guillemets droits («\ \fI"\fP\ »)
|
||||
présents dans des chaînes de caractères utilisées comme paramètres n'ont
|
||||
pas besoin d'être précédées d'une barre oblique inversée
|
||||
(«\ \fI\\\fP\ »). La chaîne sera terminée par le dernier guillemet
|
||||
droit. Par exemple, pour l'option \fBbrackets\fP, "\fI"')>]}\fP"
|
||||
correspondra à \fI"\fP, \fI'\fP, \fI)\fP, \fI>\fP, \fI]\fP et \fI}\fP.
|
||||
|
||||
Les commandes et arguments reconnus sont\ :
|
||||
|
||||
.TP 3
|
||||
.B set/unset autoindent
|
||||
Active l'indentation automatique.
|
||||
.TP
|
||||
.B set/unset backup
|
||||
Crée des copies de sécurité nommées
|
||||
.IR nom_du_fichier~ .
|
||||
.TP
|
||||
.B set backupdir "\fIrépertoire\fP"
|
||||
Définit le répertoire utilisé par \fBnano\fP pour enregistrer les copies
|
||||
de sécurité uniques, si l'enregistrement de copies de sécurité est
|
||||
activé.
|
||||
.TP
|
||||
.B set/unset backwards
|
||||
Par défaut, les recherches se font vers l'arrière.
|
||||
.TP
|
||||
.B set/unset boldtext
|
||||
Utilise des caractères gras à la place de la vidéo inverse.
|
||||
.TP
|
||||
.B set brackets "\fIchaîne\fP"
|
||||
Définit les caractères considérés comme des crochets fermants lors de la
|
||||
justification des paragraphes. Ces caractères ne doivent pas contenir
|
||||
d'espaces. Seules les ponctuations terminales, éventuellement suivies
|
||||
de crochets fermants, peuvent terminer une phrase.
|
||||
|
||||
La valeur par défaut de cette option est\ : "\fI"')>]}\fP".
|
||||
|
||||
N.D.T.\ : reportez-vous au paragraphe sur l'option \fBpunct\fR pour
|
||||
plus d'informations.
|
||||
|
||||
.TP
|
||||
.B set/unset casesensitive
|
||||
Par défaut, les recherches ne tiennent pas compte de la casse.
|
||||
.TP
|
||||
.B set/unset const
|
||||
Affiche en permanence la position du curseur dans la ligne d'état.
|
||||
.TP
|
||||
.B set/unset cut
|
||||
Par défaut, coupe le texte du curseur à la fin de la ligne, au lieu de
|
||||
couper la ligne entière.
|
||||
.TP
|
||||
.B set fill \fIn\fP
|
||||
Passe automatiquement à la ligne une fois arrivé à la colonne
|
||||
\fIn\fR. Si la valeur indiquée est de 0 ou moins, le point de passage à
|
||||
la ligne aura lieu à la taille de l'écran moins \fIn\fR. Cela permet de
|
||||
faire varier le point de passage à la ligne lorsque l'on change la
|
||||
taille de l'écran. La valeur par défaut est de \-8.
|
||||
.TP
|
||||
.B set/unset historylog
|
||||
Active l'utilisation de
|
||||
.I ~/.nano_history
|
||||
pour enregistrer et relire les chaînes ayant fait l'objet d'une
|
||||
recherche ou d'un remplacement.
|
||||
.TP
|
||||
.B set matchbrackets "\fIchaîne\fP"
|
||||
Définit les crochets ouvrants et fermant pour la recherche de crochets
|
||||
correspondants. Cette liste ne doit pas contenir de blancs. L'ensemble
|
||||
des crochets ouvrants doit être indiqué en premier, suivi de l'ensemble
|
||||
des crochets fermant, qui doit être dans le même ordre. La valeur par
|
||||
défaut de cette option est "\fI(<[{)>]}\fP".
|
||||
.TP
|
||||
.B set/unset morespace
|
||||
Utiliser la ligne blanche située sous la ligne de titre comme espace
|
||||
supplémentaire d'édition.
|
||||
.TP
|
||||
.B set/unset mouse
|
||||
Active l'utilisation de la souris, si elle est disponible pour votre
|
||||
système. Lorsque celle-ci est activée, il est possible d'utiliser la
|
||||
souris pour positionner le curseur, pour marquer le texte (avec un
|
||||
double-clic) et pour lancer les fonctions correspondant aux raccourcis.
|
||||
Il est possible d'utiliser la souris sous X\ Window ou en mode console
|
||||
avec gpm.
|
||||
.TP
|
||||
.B set/unset multibuffer
|
||||
Mode multi-espace\ : permet de charger les fichiers dans leur propre
|
||||
espace.
|
||||
.TP
|
||||
.B set/unset noconvert
|
||||
Pas de conversion depuis les formats DOS et Mac.
|
||||
.TP
|
||||
.B set/unset nofollow
|
||||
Ne suit pas les liens symboliques lors de l'écriture des fichiers.
|
||||
.TP
|
||||
.B set/unset nohelp
|
||||
Désactive les lignes d'aide affichée en bas de l'écran.
|
||||
.TP
|
||||
.B set/unset nonewlines
|
||||
Ne pas ajouter de passage à la ligne à la fin des fichiers.
|
||||
.TP
|
||||
.B set/unset nowrap
|
||||
Désactive le passage automatique à la ligne.
|
||||
.TP
|
||||
.B set operatingdir "\fIrépertoire\fP"
|
||||
\fBnano\fP ne lira et n'écrira des fichiers qu'à l'intérieur du
|
||||
\fIrépertoire\fP et de ses sous-répertoires. De plus, celui-ci devient
|
||||
le répertoire courant, afin que les fichiers soient lus depuis ce
|
||||
répertoire. Par défaut, cette fonction est désactivée.
|
||||
.TP
|
||||
.B set/unset preserve
|
||||
Préserve les séquences XON et XOFF (^Q et ^S).
|
||||
.TP
|
||||
.B set punct "\fIchaîne\fP"
|
||||
Définit les caractères interprétés comme des ponctuations terminales
|
||||
lors de la justification des paragraphes. Ces caractères ne peuvent
|
||||
inclure de blancs. Seules les ponctuations terminales, éventuellement
|
||||
suivies de crochets fermants, peuvent terminer une phrase. La valeur par
|
||||
défaut de cette option est "\fI!.?\fP".
|
||||
|
||||
N.D.T.\ : ce réglage permet, lors de la justification, de conserver
|
||||
2\ espaces au lieu d'une derrière les ponctuations terminales, ce qui
|
||||
correspond aux normes typographiques anglo-saxonnes, mais n'a pas lieu
|
||||
d'être en français. Pour le français, le plus simple est d'indiquer,
|
||||
dans le fichier nanorc, une chaîne vide pour ce paramètre.
|
||||
.TP
|
||||
.B set/unset quickblank
|
||||
Effacement rapide de la ligne d'état. Les messages affichés par la ligne
|
||||
d'état disparaîtront après une frappe clavier au lieu de 25.
|
||||
.TP
|
||||
.B set quotestr "\fIchaîne\fP"
|
||||
Définit le préfixe par défaut utilisé pour les citations dans les
|
||||
courriers électroniques. Ce préfixe est utilisé pour réaliser une
|
||||
justification correcte de ces citations. Il s'agira, si votre système le
|
||||
permet, d'une expression rationnelle étendue. Dans le cas
|
||||
contraire, il s'agira d'une chaîne de texte brut. Si vous disposez des
|
||||
expressions rationnelles, la valeur par défaut de cette option sera
|
||||
"\fI^([\ \\t]*[#:>\\|}])+\fP", sinon, ce sera ">\ ". Notez que le
|
||||
«\ \\t\ » ci-dessus correspond à un caractère de tabulation.
|
||||
.TP
|
||||
.B set/unset rebinddelete
|
||||
Interprète différemment la touche «\ Supprimer\ », afin que les touches
|
||||
«\ Effacement arrière\ » et «\ Supprimer\ » fonctionnent correctement.
|
||||
Vous ne devriez avoir besoin de cette option que si, sur votre système,
|
||||
la touche «\ Effacement arrière\ » produit l'effet de la touche «\
|
||||
Supprimer\ ».
|
||||
.TP
|
||||
.B set/unset rebindkeypad
|
||||
Interprète les touches du pavé numérique afin qu'elles fonctionnent
|
||||
toutes correctement. Vous ne devriez utiliser cette option que si ce
|
||||
n'est pas le cas, car nano ne sera plus capable d'utiliser la souris
|
||||
correctement lorsque cette option sera activée.
|
||||
.TP
|
||||
.B set/unset regexp
|
||||
Utilise par défaut des expressions rationnelles étendues pour les
|
||||
recherches.
|
||||
.TP
|
||||
.B set/unset smarthome
|
||||
Rend plus malin le fonctionnement de la touche «\ Début\ ». Lorsque
|
||||
cette touche est pressée à n'importe quel endroit excepté au tout début
|
||||
du texte d'une ligne (i.\ e. au premier caractère non blanc), le curseur
|
||||
se positionnera au début du texte de la ligne (qu'il soit en avant ou en
|
||||
arrière). Si le curseur est déjà là, il se placera au vrai début de la
|
||||
ligne.
|
||||
.TP
|
||||
.B set/unset smooth
|
||||
Active le défilement ligne-par-ligne du texte.
|
||||
.TP
|
||||
.B set speller "\fIprogramme\fP"
|
||||
Utilise le correcteur orthographique \fIprogramme\fP au lieu du
|
||||
correcteur intégré, qui s'appuie sur \fIspell\fP.
|
||||
.TP
|
||||
.B set/unset suspend
|
||||
Autorise à suspendre \fBnano\fP.
|
||||
.TP
|
||||
.B set tabsize \fIn\fP
|
||||
Utilise une taille de tabulation de \fIn\fP colonnes. Cette valeur doit
|
||||
être strictement supérieure à 0. La valeur par défaut est de\ 8.
|
||||
.TP
|
||||
.B set/unset tabstospaces
|
||||
Convertit les tabulations clavier en espaces.
|
||||
.TP
|
||||
.B set/unset tempfile
|
||||
S'il a été modifié, le fichier sera sauvegardé automatiquement en
|
||||
quittant, sans demande de confirmation.
|
||||
.TP
|
||||
.B set/unset view
|
||||
Interdit de modifier les fichiers.
|
||||
.TP
|
||||
.B set whitespace "\fIchaîne\fP"
|
||||
Définit les deux caractères utilisés pour afficher les premiers
|
||||
caractères des tabulations et des espaces. Ces deux caractères doivent
|
||||
être mono-colonne.
|
||||
.TP
|
||||
.B set/unset wordbounds
|
||||
Détection plus précise des limites de mots, obtenue en considérant les
|
||||
caractères de ponctuation comme faisant partie des mots.
|
||||
.TP
|
||||
.B syntax "\fIchaîne\fP" ["\fImotif_de_fichier\fP" ... ]
|
||||
Définit une syntaxe nommée \fIchaîne\fP qui pourra être activé via
|
||||
l'option \fB-Y\fP (ou \fB--syntax\fP) ou qui sera automatiquement
|
||||
activée si le nom du fichier en cours correspond à l'expression
|
||||
rationnelle étendue \fImotif_de_fichier\fP. Toutes les instructions
|
||||
suivantes de colorisation \fBcolor\fP ou \fBicolor\fP s'appliqueront à
|
||||
cette syntaxe, jusqu'à la définition d'une nouvelle syntaxe.
|
||||
|
||||
La syntaxe nommée \fInone\fP (aucune) est réservée\ ; si elle est
|
||||
indiquée dans la ligne de commande, cela revient à ne définir aucune
|
||||
syntaxe. La syntaxe nommée \fIdefault\fP (par défaut) est spéciale, elle
|
||||
ne nécessite aucun motif de \fImotif_de_fichier\fP, et s'applique aux
|
||||
fichiers ne correspondant à aucun des \fImotif_de_fichier\fP des autres
|
||||
syntaxes.
|
||||
.TP
|
||||
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] "\fImotif\fP" ...
|
||||
Pour la syntaxe en cours, affiche toutes les expressions correspondant à
|
||||
l'expression rationnelle étendue \fImotif\fP en utilisant la couleur de
|
||||
texte \fIcouleur_texte\fP et la couleur de fond \fIcouleur_fond\fP,
|
||||
l'une de ces deux couleurs au moins devant être définie. Les couleurs
|
||||
acceptées par \fBnano\fP pour le texte et le fond sont\ : \fIwhite\fP
|
||||
(blanc), \fIblack\fP (noir), \fIred\fP (rouge), \fIblue\fP (bleu),
|
||||
\fIgreen\fP (vert), \fIyellow\fP (jaune), \fImagenta\fP, et \fIcyan\fP.
|
||||
Pour la couleur du texte, vous pouvez ajouter à ces couleurs le préfixe
|
||||
\fIbright\fP (lumineux) pour obtenir une couleur plus lumineuse. Si
|
||||
votre terminal est capable de gérer la transparence, ne pas spécifier de
|
||||
\fIcouleur_fond\fP indique à \fBnano\fP d'essayer d'utiliser un fond
|
||||
transparent.
|
||||
.TP
|
||||
.B icolor \fIcouleur_texte\fP[,\fIcouleur_fond\fP] "\fImotif\fP" ...
|
||||
Comme ci-dessus, mais la recherche des motifs est effectuée sans tenir
|
||||
compte de la casse.
|
||||
.TP
|
||||
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
|
||||
Affiche les expressions commençant par l'expression rationnelle étendue
|
||||
\fImotif_début\fP et se terminant par l'expression rationnelle étendue
|
||||
\fImotif_fin\fP en utilisant la couleur de texte \fIcouleur_texte\fP
|
||||
et la couleur de fond \fIcouleur_fond\fP, l'une de ces deux couleurs au
|
||||
moins devant être définie. Cela permet à la colorisation syntaxique de
|
||||
s'étendre sur plusieurs lignes. Notez que toutes les occurrences
|
||||
successives de \fImotif_début\fP après le \fImotif_début\fP initial
|
||||
seront surlignées jusqu'à la prochaine instance de \fImotif_fin\fP.
|
||||
.TP
|
||||
.B icolor \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
|
||||
Comme ci-dessus, mais la recherche des motifs est effectuée sans tenir
|
||||
compte de la casse.
|
||||
.TP
|
||||
.B include "\fIfichier_de_syntaxes\fP"
|
||||
Lit le fichier \fIfichier_de_syntaxes\fP contenant une liste
|
||||
autosuffisante de définitions de syntaxes. Ce fichier ne doit contenir
|
||||
que des commandes \fBsyntax\fP, \fBcolor\fP et \fBicolor\fP.
|
||||
|
||||
.SH FICHIERS
|
||||
.TP
|
||||
.I $SYSCONFDIR/nanorc
|
||||
Fichier de configuration général
|
||||
.TP
|
||||
.I ~/.nanorc
|
||||
Fichier de configuration personnel
|
||||
|
||||
.SH VOIR AUSSI
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnano\fP(1)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (ou son équivalent sur
|
||||
votre système)
|
||||
|
||||
.SH AUTEUR
|
||||
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
|
||||
\fIAUTHORS\fP et \fITHANKS\fP pour plus d'information). Cette page de
|
||||
manuel a été initialement rédigée par Jordi Mallach <jordi@gnu.org> pour
|
||||
le système Debian (mais elle peut être utilisée par d'autres).
|
||||
|
||||
.SH TRADUCTION
|
||||
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
|
||||
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir de
|
||||
la version 1.56 du 11\ octobre\ 2007 de la page de manuel de nanorc
|
||||
(pour la version 2.0.0 de nano). Cette page a été relue par Gérard
|
||||
Delafond.
|
||||
|
||||
Un maximum de soin a été apporté lors de l'élaboration de cette
|
||||
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
|
||||
vous en rencontrez, que ce soit dans la version française ou dans la
|
||||
version originale, n'hésitez pas à les signaler à l'auteur ou au
|
||||
traducteur.
|
||||
|
||||
La version originale la plus à jour de ce document est toujours
|
||||
consultable via la commande\ :
|
||||
|
||||
LANGUAGE=en man nano
|
||||
@@ -1,154 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
.\" Skeleton based on nano-tiny.1:
|
||||
.\" Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" Le travail d'adaptation française de cette page de manuel a été
|
||||
.\" réalisé par Jean-Philippe Guérard, en 2006 et 2007. Ce travail
|
||||
.\" d'adaptation est dans le domaine public. Attention, la page traduite
|
||||
.\" reste soumise au droit d'auteur de ses auteurs originaux.
|
||||
.\"
|
||||
.\" The French translation of this document is a public domain work of
|
||||
.\" Jean-Philippe Guérard. This translation work was made in 2006 and
|
||||
.\" 2007. The translated man page in itself is still subject to the
|
||||
.\" copyright of its original authors.
|
||||
.\"
|
||||
.\" This document is dual-licensed. You may distribute and/or modify it
|
||||
.\" under the terms of either of the following licenses:
|
||||
.\"
|
||||
.\" * The GNU General Public License, as published by the Free Software
|
||||
.\" Foundation, version 3 or (at your option) any later version. You
|
||||
.\" should have received a copy of the GNU General Public License
|
||||
.\" along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" * The GNU Free Documentation License, as published by the Free
|
||||
.\" Software Foundation, version 1.2 or (at your option) any later
|
||||
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
|
||||
.\" Back-Cover Texts. You should have received a copy of the GNU Free
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" Ce document est publié sous une double licence. Vous pouvez
|
||||
.\" le distribuer et le modifier selon les termes de l'une des deux
|
||||
.\" licences ci-dessous :
|
||||
.\"
|
||||
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
|
||||
.\" votre choix, supérieure, telle que publiée par la Free
|
||||
.\" Software Foundation. Vous devriez avoir reçu une copie de la
|
||||
.\" Licence publique générale GNU avec ce programme. Si ce n'est pas
|
||||
.\" le cas, consultez <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2 ou,
|
||||
.\" à votre choix, supérieure, telle que publiée par la Free
|
||||
.\" Software Foundation, sans section invariante, ni texte de
|
||||
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
|
||||
.\" une copie de la Licence de documentation libre GNU avec ce
|
||||
.\" programme. Si ce n'est pas le cas, consultez
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH RNANO 1 "version 2.0.0" "29\ novembre\ 20O7"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
|
||||
.\"
|
||||
.SH NOM
|
||||
rnano \- Le mode restreint de NAno un NOuvel éditeur, un clone libre et
|
||||
amélioré de Pico
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B rnano
|
||||
.I [OPTIONS]\ [[+LIGNE,COLONNE]\ FICHIER]...
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
Cette page de manuel décrit brièvement la commande \fBrnano\fR.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" respectively.
|
||||
\fBnano\fR est un éditeur petit, sympathique et libre, qui vise à
|
||||
remplacer Pico, l'éditeur par défaut du logiciel non libre Pine.
|
||||
\fBnano\fR ne se contentant pas de copier l'interface et l'ergonomie de
|
||||
Pico, il offre également certaines fonctions manquantes (ou désactivées
|
||||
par défaut) dans Pico. Ces fonctionnalités sont, par exemple, les
|
||||
fonctions de recherche et de remplacement, et la possibilité de sauter
|
||||
directement à une ligne et à une colonne précise..
|
||||
.PP
|
||||
\fBrnano\fP est une version de \fBnano\fP fonctionnant en mode
|
||||
restreint, qui ne permet d'éditer que les fichiers indiqués et qui
|
||||
n'autorise pas l'utilisateur à accéder au système de fichier ou à un
|
||||
interpréteur de commandes.
|
||||
.PP
|
||||
En mode restreint, \fBnano\fP refusera\ :
|
||||
.IP \[bu] 2
|
||||
de lire ou d'écrire dans un fichier n'ayant pas été indiqué dans la
|
||||
ligne de commande\ ;
|
||||
.IP \[bu]
|
||||
de lire un fichier nanorc\ ;
|
||||
.IP \[bu]
|
||||
de permettre de suspendre l'édition\ ;
|
||||
.IP \[bu]
|
||||
de permettre d'ajouter en début ou en fin d'un fichier, ou de
|
||||
l'enregistrer sous un nom différent\ ;
|
||||
.IP \[bu]
|
||||
l'utilisation de copies de sécurité ou de la correction orthographique.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B +\fILIGNE\fP,\fICOLONNE\fP
|
||||
Démarre avec le curseur positionné à la colonne \fICOLONNE\fP de
|
||||
la ligne \fILIGNE\fR (l'un des deux, au moins, devant être spécifié) au
|
||||
lieu de démarrer à la colonne\ 1, ligne\ 1.
|
||||
.TP
|
||||
.B \-?
|
||||
Identique à \fB\-h (\-\-help)\fP.
|
||||
.TP
|
||||
.B \-h (\-\-help)
|
||||
Affiche un résumé des options de lancement de nano, puis s'arrête.
|
||||
.TP
|
||||
.B \-V (\-\-version)
|
||||
Affiche la version, puis s'arrête.
|
||||
.PP
|
||||
Reportez-vous à la page de manuel \fBnano\fP(1) si vous souhaitez
|
||||
consulter la documentation complète de \fBnano\fP.
|
||||
|
||||
.SH BOGUES
|
||||
Merci de nous faire parvenir vos commentaires et de nous signaler les
|
||||
bogues, en écrivant, en anglais, à \fBnano@nano-editor.org\fR.
|
||||
|
||||
La liste de discussion anglophone \fBnano\fR est disponible à l'adresse
|
||||
\fBnano-devel@gnu.org\fR.
|
||||
|
||||
Pour vous abonner, envoyez un courrier électronique à
|
||||
\fBnano-devel-request@gnu.org\fR, ayant pour objet «\ subscribe\ ».
|
||||
|
||||
N'hésitez pas également à envoyez vos commentaires, suggestions et
|
||||
corrections relatives à l'adaptation française de cette page de manuel
|
||||
ou du logiciel à \fBjean-philippe.guerard@tigreraye.org\fR.
|
||||
|
||||
.SH "SITE INTERNET"
|
||||
http://www.nano-editor.org/
|
||||
|
||||
.SH AUTEUR
|
||||
Chris Allegretta <chrisa@asty.org> et d'autres (voir le fichier
|
||||
\fIAUTHORS\fR). Cette page de manuel a été initialement rédigée par
|
||||
Thijs Kinkhorst <thijs@kinkhorst.com>, pour le système GNU Debian (mais
|
||||
elle peut être utilisée par d'autres).
|
||||
|
||||
.SH TRADUCTION
|
||||
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
|
||||
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir
|
||||
de la version 1.19 du 6\ novembre\ 2007 de la page de manuel de rnano
|
||||
(pour la version 2.0.0 de nano).
|
||||
|
||||
Un maximum de soin a été apporté lors de l'élaboration de cette
|
||||
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si
|
||||
vous en rencontrez, que ce soit dans la version française ou dans la
|
||||
version originale, n'hésitez pas à les signaler à l'auteur ou au
|
||||
traducteur.
|
||||
|
||||
La version originale la plus à jour de ce document est toujours
|
||||
consultable via la commande\ :
|
||||
|
||||
LANGUAGE=en man nano
|
||||
@@ -1,82 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright (C) 2002, 2005, 2006, 2007, 2014 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" This document is dual-licensed. You may distribute and/or modify it
|
||||
.\" under the terms of either of the following licenses:
|
||||
.\"
|
||||
.\" * The GNU General Public License, as published by the Free Software
|
||||
.\" Foundation, version 3 or (at your option) any later version. You
|
||||
.\" should have received a copy of the GNU General Public License
|
||||
.\" along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" * The GNU Free Documentation License, as published by the Free
|
||||
.\" Software Foundation, version 1.2 or (at your option) any later
|
||||
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
|
||||
.\" Back-Cover Texts. You should have received a copy of the GNU Free
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH RNANO 1 "version 2.5.2" "February 2016"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.SH NAME
|
||||
rnano \- Restricted mode for Nano's ANOther editor, an enhanced free
|
||||
Pico clone
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B rnano
|
||||
.RI [ options "] [[+" line , column "]\ " file "]..."
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. On
|
||||
top of copying Pico's look and feel, \fBnano\fP also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line and column number".
|
||||
.PP
|
||||
\fBrnano\fP is a restricted version of \fBnano\fP, which only edits
|
||||
specific files and doesn't allow the user access to the filesystem or a
|
||||
command shell.
|
||||
.PP
|
||||
In restricted mode, \fBnano\fP will \fInot\/\fP:
|
||||
.IP \[bu] 2
|
||||
read or write to any file not specified on the command line;
|
||||
.IP \[bu]
|
||||
read any nanorc files;
|
||||
.IP \[bu]
|
||||
allow suspending;
|
||||
.IP \[bu]
|
||||
allow a file to be appended to, prepended to, or saved under a different
|
||||
name;
|
||||
.IP \[bu]
|
||||
use backup files or spell checking.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-h ", " \-\-help
|
||||
Show a summary of command-line options and exit.
|
||||
.TP
|
||||
.BR \-V ", " \-\-version
|
||||
Show the current version number and exit.
|
||||
.PP
|
||||
See the \fBnano\fP(1) manpage for all of the possible options.
|
||||
|
||||
.SH BUGS
|
||||
Please send any comments or bug reports to \fBnano@nano-editor.org\fP.
|
||||
|
||||
The \fBnano\fP mailing list is available from \fBnano-devel@gnu.org\fP.
|
||||
|
||||
To subscribe, email to \fBnano-devel-request@gnu.org\fP with a subject
|
||||
of "subscribe".
|
||||
|
||||
.SH HOMEPAGE
|
||||
http://www.nano-editor.org/
|
||||
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see the file AUTHORS for details).
|
||||
This manual page was originally written by Thijs Kinkhorst
|
||||
<thijs@kinkhorst.com>, for the Debian system (but may be used by
|
||||
others).
|
||||
@@ -1,6 +1,3 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
|
||||
.\" 2009, 2010, 2013, 2014 Free Software Foundation, Inc.
|
||||
.\"
|
||||
@@ -20,16 +17,15 @@
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH NANO 1 "version 2.5.2" "February 2016"
|
||||
.TH NANO 1 "version 2.7.5" "February 2017"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
|
||||
.SH NAME
|
||||
nano \- Nano's ANOther editor, an enhanced free Pico clone
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B nano
|
||||
.RI [ options "] [[+" line , column "]\ " file "]..."
|
||||
.RI [ options "] [[+" line [, column "]]\ " file "]..."
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
@@ -38,10 +34,17 @@ top of copying Pico's look and feel, \fBnano\fP also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line and column number".
|
||||
|
||||
When opening a file, the cursor can be put on a specific line by adding
|
||||
the line number with a plus sign (\fB+\fR) before the filename, and even
|
||||
in a specific column by adding it with a comma.
|
||||
|
||||
If the first file specified is a dash (\fB\-\fR), \fBnano\fR will read
|
||||
data from standard input.
|
||||
|
||||
.SH EDITING
|
||||
Entering text and moving around in a file is straightforward: typing the
|
||||
letters and using the normal cursor movement keys. Commands are entered
|
||||
by using the Control (^) and the Alt or Meta (M-) keys.
|
||||
by using the Control (^) and the Alt or Meta (M\-) keys.
|
||||
Typing \fB^K\fR deletes the current line and puts it in the cutbuffer.
|
||||
Consecutive \fB^K\fRs will put all deleted lines together in the cutbuffer.
|
||||
Any cursor movement or executing any other command will cause the next
|
||||
@@ -50,10 +53,14 @@ contents of the cutbuffer at the current cursor position.
|
||||
.PP
|
||||
When a more precise piece of text needs to be cut or copied, one can mark
|
||||
its start with \fB^6\fR, move the cursor to its end (the marked text will be
|
||||
highlighted), and then use \fB^K\fR to cut it, or \fBM-6\fR to copy it to the
|
||||
cutbuffer. One can also save the marked text to a file with \fB^O\fR, or
|
||||
highlighted), and then use \fB^K\fR to cut it, or \fBM\-6\fR to copy it to the
|
||||
cutbuffer. One can also save the marked text to a file with \fB^O\fR, or
|
||||
spell check it with \fB^T\fR.
|
||||
.PP
|
||||
Since nano-2.7.0, text can also be selected by holding Shift and moving the
|
||||
cursor with the arrow keys. Holding down the Alt key too will increase the
|
||||
stride.
|
||||
.PP
|
||||
The two lines at the bottom of the screen show the most important commands;
|
||||
the built-in help (\fB^G\fR) lists all the available ones.
|
||||
The default key bindings can be changed via the .nanorc file -- see
|
||||
@@ -61,11 +68,6 @@ The default key bindings can be changed via the .nanorc file -- see
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B +\fIline\fP,\fIcolumn\fP
|
||||
Places the cursor on line number \fIline\fP and at column number \fIcolumn\fP
|
||||
(at least one of which must be specified) on startup, instead of the
|
||||
default line 1, column 1.
|
||||
.TP
|
||||
.BR \-A ", " \-\-smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
@@ -151,9 +153,14 @@ keystroke instead of 25. Note that \fB\-c\fP overrides this.
|
||||
Show the current version number and exit.
|
||||
.TP
|
||||
.BR \-W ", " \-\-wordbounds
|
||||
Detect word boundaries more accurately by treating punctuation
|
||||
Detect word boundaries differently by treating punctuation
|
||||
characters as part of a word.
|
||||
.TP
|
||||
.BR "\-X ""\fIcharacters\fB""" ", " "\-\-wordchars=""" \fIcharacters """
|
||||
Specify which other characters (besides the normal alphanumeric ones)
|
||||
should be considered as part of a word. This overrides option
|
||||
\fB\-W\fR (\fB\-\-wordbounds\fR).
|
||||
.TP
|
||||
.BR \-Y\ \fIname\fR ", " \-\-syntax= \fIname
|
||||
Specify the name of the syntax highlighting to use from among the ones
|
||||
defined in the \fInanorc\fP files.
|
||||
@@ -166,6 +173,10 @@ Interpret the Delete key differently so that both Backspace and Delete
|
||||
work properly. You should only need to use this option if Backspace
|
||||
acts like Delete on your system.
|
||||
.TP
|
||||
.BR \-g ", " \-\-showcursor
|
||||
Make the cursor visible in the file browser, putting it on the
|
||||
highlighted item. Useful for braille users.
|
||||
.TP
|
||||
.BR \-h ", " \-\-help
|
||||
Show a summary of the available command-line options and exit.
|
||||
.TP
|
||||
@@ -174,9 +185,12 @@ Indent new lines to the previous line's indentation. Useful when
|
||||
editing source code.
|
||||
.TP
|
||||
.BR \-k ", " \-\-cut
|
||||
Make the 'Cut Text' command (normally ^K) cut from the current cursor
|
||||
Make the 'Cut Text' command (normally \fB^K\fR) cut from the current cursor
|
||||
position to the end of the line, instead of cutting the entire line.
|
||||
.TP
|
||||
.BR \-l ", " \-\-linenumbers
|
||||
Display line numbers to the left of the text area.
|
||||
.TP
|
||||
.BR \-m ", " \-\-mouse
|
||||
Enable mouse support, if available for your system. When enabled, mouse
|
||||
clicks can be used to place the cursor, set the mark (with a double
|
||||
@@ -208,15 +222,13 @@ Hard-wrap lines at column \fInumber\fP. If this value is 0 or less, wrapping
|
||||
will occur at the width of the screen less \fInumber\fP columns, allowing
|
||||
the wrap point to vary along with the width of the screen if the screen
|
||||
is resized. The default value is \-8. This option conflicts with
|
||||
.B \-w
|
||||
-- the last one given takes effect.
|
||||
\fB\-w\fR -- the last one given takes effect.
|
||||
.TP
|
||||
.BR \-s\ \fIprogram\fR ", " \-\-speller= \fIprogram
|
||||
Use this alternative spell checker command.
|
||||
.TP
|
||||
.BR \-t ", " \-\-tempfile
|
||||
Always save a changed buffer without prompting. Same as Pico's \fB\-t\fP
|
||||
option.
|
||||
Save a changed buffer without prompting (when exiting with \fB^X\fR).
|
||||
.TP
|
||||
.BR \-u ", " \-\-unix
|
||||
Save a file by default in Unix format. This overrides nano's
|
||||
@@ -224,12 +236,11 @@ default behavior of saving a file in the format that it had.
|
||||
(This option has no effect when you also use \fB\-\-noconvert\fR.)
|
||||
.TP
|
||||
.BR \-v ", " \-\-view
|
||||
View-file (read-only) mode.
|
||||
Just view the file and disallow editing: read-only mode.
|
||||
.TP
|
||||
.BR \-w ", " \-\-nowrap
|
||||
Disable the hard-wrapping of long lines. This option conflicts with
|
||||
.B \-r
|
||||
-- the last one given takes effect.
|
||||
\fB\-r\fR -- the last one given takes effect.
|
||||
.TP
|
||||
.BR \-x ", " \-\-nohelp
|
||||
Don't show the two help lines at the bottom of the screen.
|
||||
@@ -245,9 +256,17 @@ continuing it over multiple screen lines. Since
|
||||
this option last when using other options (e.g.\& 'nano \-wS$') or pass it
|
||||
separately (e.g.\& 'nano \-wS \-$').
|
||||
.TP
|
||||
.BR \-a ", " \-b ", " \-e ", " \-f ", " \-g ", " \-j
|
||||
.BR \-a ", " \-b ", " \-e ", " \-f ", " \-j
|
||||
Ignored, for compatibility with Pico.
|
||||
|
||||
.SH TOGGLES
|
||||
Several of the above options can be switched on and off also while
|
||||
\fBnano\fR is running. For example, \fBM\-L\fR toggles the
|
||||
hard-wrapping of long lines, \fBM\-$\fR toggles soft-wrapping,
|
||||
\fBM\-#\fR toggles line numbers, \fBM\-M\fR toggles the mouse,
|
||||
\fBM\-I\fR auto-indentation, and \fBM\-X\fR the help lines.
|
||||
See at the end of the \fB^G\fR help text for a complete list.
|
||||
|
||||
.SH INITIALIZATION FILE
|
||||
\fBnano\fP will read initialization files in the following order:
|
||||
the system's \fBnanorc\fP (if it exists), and then the user's
|
||||
@@ -259,7 +278,7 @@ for more information on the possible contents of those files.
|
||||
If no alternative spell checker command is specified on the command
|
||||
line nor in one of the \fInanorc\fP files, \fBnano\fP will check the
|
||||
\fBSPELL\fP environment variable for one.
|
||||
|
||||
.sp
|
||||
In some cases \fBnano\fP will try to dump the buffer into an emergency
|
||||
file. This will happen mainly if \fBnano\fP receives a SIGHUP or
|
||||
SIGTERM or runs out of memory. It will write the buffer into a file
|
||||
@@ -271,27 +290,25 @@ it unique. In multibuffer mode, \fBnano\fP will write all the open
|
||||
buffers to their respective emergency files.
|
||||
|
||||
.SH BUGS
|
||||
Justifications (\fB^J\fR) and reindentations (\fBM-{\fR and \fBM-}\fR)
|
||||
Justifications (\fB^J\fR) and reindentations (\fBM\-{\fR and \fBM\-}\fR)
|
||||
are not yet covered by the general undo system. So after a justification
|
||||
that is not immediately undone, or after any reindentation, earlier edits
|
||||
cannot be undone any more. The workaround is, of course, to exit without
|
||||
saving.
|
||||
.sp
|
||||
Please report any other bugs that you encounter via
|
||||
https://savannah.gnu.org/bugs/?group=nano.
|
||||
Please report any other bugs that you encounter via:
|
||||
.br
|
||||
\fIhttps://savannah.gnu.org/bugs/?group=nano\fR.
|
||||
|
||||
.SH HOMEPAGE
|
||||
http://www.nano-editor.org/
|
||||
https://nano-editor.org/
|
||||
|
||||
.SH SEE ALSO
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnanorc\fP(5)
|
||||
.BR nanorc (5)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/\fP (or equivalent on your system)
|
||||
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see the files \fIAUTHORS\fP and
|
||||
Chris Allegretta and others (see the files \fIAUTHORS\fR and
|
||||
\fITHANKS\fP for details). This manual page was originally written by
|
||||
Jordi Mallach <jordi@gnu.org>, for the Debian system (but may be used by
|
||||
others).
|
||||
Jordi Mallach for the Debian system (but may be used by others).
|
||||
@@ -5,9 +5,9 @@
|
||||
@c %**end of header
|
||||
|
||||
@smallbook
|
||||
@set EDITION 0.3
|
||||
@set VERSION 2.5.2
|
||||
@set UPDATED February 2016
|
||||
@set EDITION 0.4
|
||||
@set VERSION 2.7.5
|
||||
@set UPDATED February 2017
|
||||
|
||||
@dircategory Editors
|
||||
@direntry
|
||||
@@ -21,13 +21,12 @@
|
||||
@titlepage
|
||||
@title GNU @code{nano}
|
||||
@subtitle a small and friendly text editor.
|
||||
@subtitle version 2.5.2
|
||||
@subtitle version 2.7.5
|
||||
|
||||
@author Chris Allegretta
|
||||
@page
|
||||
|
||||
This manual documents GNU @code{nano}, a small and friendly text
|
||||
editor.
|
||||
This manual documents GNU @code{nano}, a small and friendly text editor.
|
||||
|
||||
This manual is part of the GNU @code{nano} distribution.@*
|
||||
@sp 4
|
||||
@@ -56,8 +55,7 @@ e-mail: @email{chrisa@@asty.org}@*
|
||||
@node Top
|
||||
@top
|
||||
|
||||
This manual documents GNU @code{nano}, a small and friendly text
|
||||
editor.
|
||||
This manual documents GNU @code{nano}, a small and friendly text editor.
|
||||
|
||||
@menu
|
||||
* Introduction::
|
||||
@@ -99,21 +97,24 @@ The usual way to invoke @code{nano} is:
|
||||
@code{nano [FILE]}
|
||||
@end quotation
|
||||
|
||||
But it is also possible to specify one or more options, and to edit
|
||||
several files in a row. Additionally, the cursor can be put on a
|
||||
specific line of a file by adding the line number
|
||||
But it is also possible to specify one or more options (see the next
|
||||
section), and to edit several files in a row. Additionally, the cursor
|
||||
can be put on a specific line of a file by adding the line number
|
||||
with a plus sign before the filename, and even in a specific column by
|
||||
adding it with a comma. So the complete command synopsis is:
|
||||
adding it with a comma. So a more complete command synopsis is:
|
||||
|
||||
@quotation
|
||||
@code{nano [OPTION]@dots{} [[+LINE[,COLUMN]|+,COLUMN] FILE]@dots{}}
|
||||
@end quotation
|
||||
|
||||
But normallly you would set your preferred options in your
|
||||
@file{.nanorc} file. And when the @code{positionlog} option is set
|
||||
Normally, however, you set your preferred options in a @file{.nanorc}
|
||||
file (see @xref{Nanorc Files}). And when using @code{set positionlog}
|
||||
(making @code{nano} remember the cursor position when you close a file),
|
||||
you will rarely need to specify a line number.
|
||||
|
||||
As a special case: when the first file specified is a dash, @code{nano}
|
||||
will read data from standard input. Which means you can pipe the output
|
||||
of a command straight into a buffer.
|
||||
|
||||
@node Command-line Options
|
||||
@chapter Command-line Options
|
||||
@@ -122,10 +123,6 @@ you will rarely need to specify a line number.
|
||||
|
||||
@table @option
|
||||
|
||||
@item +@var{line},@var{column}
|
||||
Start at line number @var{line} and column number @var{column} (at least one of
|
||||
which must be specified) instead of the default of line 1, column 1.
|
||||
|
||||
@item -A
|
||||
@itemx --smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
@@ -233,9 +230,15 @@ Show the current version number and exit.
|
||||
|
||||
@item -W
|
||||
@itemx --wordbounds
|
||||
Detect word boundaries more accurately by treating punctuation
|
||||
Detect word boundaries differently by treating punctuation
|
||||
characters as parts of words.
|
||||
|
||||
@item -X "@var{characters}"
|
||||
@itemx --wordchars="@var{characters}"
|
||||
Specify which other characters (besides the normal alphanumeric ones)
|
||||
should be considered as parts of words. This overrides option
|
||||
@option{-W} (@option{--wordbounds}).
|
||||
|
||||
@item -Y @var{name}
|
||||
@itemx --syntax=@var{name}
|
||||
Specify a specific syntax from the nanorc files to use for highlighting.
|
||||
@@ -252,6 +255,11 @@ Interpret the Delete key differently so that both Backspace and Delete
|
||||
work properly. You should only need to use this option if Backspace
|
||||
acts like Delete on your system.
|
||||
|
||||
@item -g
|
||||
@itemx --showcursor
|
||||
Make the cursor visible in the file browser, putting it on the
|
||||
highlighted item. Useful for braille users.
|
||||
|
||||
@item -h
|
||||
@itemx --help
|
||||
Show a summary of command-line options and exit.
|
||||
@@ -266,6 +274,10 @@ the previous line.
|
||||
Make the 'Cut Text' command (normally ^K) cut from the current cursor
|
||||
position to the end of the line, instead of cutting the entire line.
|
||||
|
||||
@item -l
|
||||
@itemx --linenumbers
|
||||
Display line numbers to the left of the text area.
|
||||
|
||||
@item -m
|
||||
@itemx --mouse
|
||||
Enable mouse support, if available for your system. When enabled, mouse
|
||||
@@ -315,8 +327,8 @@ the @command{spell} program to be installed on your system.
|
||||
|
||||
@item -t
|
||||
@itemx --tempfile
|
||||
Don't ask whether or not to save the current contents of the file when
|
||||
exiting, assume yes. This is most useful when using @command{nano} as the
|
||||
Don't ask whether to save a modified buffer when exiting with ^X, but
|
||||
assume yes. This option is useful when @command{nano} is used as the
|
||||
composer of a mailer program.
|
||||
|
||||
@item -u
|
||||
@@ -364,7 +376,6 @@ separately (e.g.@: @code{nano -wS -$}).
|
||||
@itemx -b
|
||||
@itemx -e
|
||||
@itemx -f
|
||||
@itemx -g
|
||||
@itemx -j
|
||||
Ignored, for compatibility with Pico.
|
||||
|
||||
@@ -398,14 +409,19 @@ Characters not present on the keyboard can be entered in two ways:
|
||||
@item
|
||||
For characters with a single-byte code,
|
||||
pressing the Esc key twice and then typing a three-digit decimal number
|
||||
(from 000 to 255) will enter the character with the corresponding value.
|
||||
(from 000 to 255) will make @code{nano} behave as if you typed the key
|
||||
with that value.
|
||||
|
||||
@item
|
||||
For any possible character, pressing M-V (Alt+V) and then typing a
|
||||
six-digit hexadecimal number (starting with 0 or 1) will enter the
|
||||
character with the corresponding Unicode value.
|
||||
corresponding Unicode character into the buffer.
|
||||
@end itemize
|
||||
|
||||
For example, typing "Esc Esc 2 3 4" will enter the character "ê" ---
|
||||
useful when going to a French party. Typing "M-V 0 0 2 5 c 6" will
|
||||
enter the symbol "◆", a little black diamond.
|
||||
|
||||
@node Commands
|
||||
@section Commands
|
||||
|
||||
@@ -588,6 +604,9 @@ toggles the @code{-z} (@code{--suspend}) command-line option.
|
||||
@item Soft Wrapping Toggle (Meta-$)
|
||||
toggles the @code{-$} (@code{--softwrap}) command-line option.
|
||||
|
||||
@item Line Numbers Toggle (Meta-#)
|
||||
toggles the @code{-l} (@code{--linenumbers}) command-line option.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@@ -688,11 +707,17 @@ See @code{set titlecolor} for more details.
|
||||
Enable the use of @file{~/.nano/search_history} for saving and reading
|
||||
search/replace strings.
|
||||
|
||||
@item set justifytrim
|
||||
When justifying text, trailing whitespace will automatically be removed.
|
||||
|
||||
@item set keycolor @var{fgcolor},@var{bgcolor}
|
||||
Specify the color combination to use for the shortcut key combos
|
||||
in the two help lines at the bottom of the screen.
|
||||
See @code{set titlecolor} for more details.
|
||||
|
||||
@item set linenumbers
|
||||
Display line numbers to the left of the text area.
|
||||
|
||||
@item set locking
|
||||
Enable vim-style lock-files for when editing files.
|
||||
|
||||
@@ -724,6 +749,10 @@ Don't add newlines to the ends of files.
|
||||
@item set nowrap
|
||||
Don't hard-wrap text at all.
|
||||
|
||||
@item set numbercolor @var{fgcolor},@var{bgcolor}
|
||||
Specify the color combination to use for line numbers.
|
||||
See @code{set titlecolor} for more details.
|
||||
|
||||
@item set operatingdir "directory"
|
||||
@code{nano} will only read and write files inside "directory" and its
|
||||
subdirectories. Also, the current directory is changed to here, so
|
||||
@@ -775,6 +804,10 @@ won't work properly with this option enabled.
|
||||
@item set regexp
|
||||
Do extended regular expression searches by default.
|
||||
|
||||
@item set showcursor
|
||||
Put the cursor on the highlighted item in the file browser, to aid
|
||||
braille users.
|
||||
|
||||
@item set smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
@@ -812,7 +845,8 @@ Save automatically on exit, don't prompt.
|
||||
@item set titlecolor @var{fgcolor},@var{bgcolor}
|
||||
Specify the color combination to use for the titlebar.
|
||||
Valid color names for foreground and background are:
|
||||
white, black, red, blue, green, yellow, magenta, and cyan.
|
||||
white, black, blue, green, red, cyan, yellow, and magenta.
|
||||
The name of the foreground color may be prefixed with 'bright'.
|
||||
And either @var{fgcolor} or @var{,bgcolor} may be left out.
|
||||
|
||||
@item set unix
|
||||
@@ -830,9 +864,14 @@ spaces. They must be single-column characters. The default pair
|
||||
for a UTF-8 locale is @t{"»·"}, and for other locales @t{">."}.
|
||||
|
||||
@item set wordbounds
|
||||
Detect word boundaries more accurately by treating punctuation
|
||||
Detect word boundaries differently by treating punctuation
|
||||
characters as part of a word.
|
||||
|
||||
@item set wordchars "@var{string}"
|
||||
Specify which other characters (besides the normal alphanumeric ones)
|
||||
should be considered as parts of words. This overrides the option
|
||||
@code{wordbounds}.
|
||||
|
||||
@end table
|
||||
|
||||
@node Syntax Highlighting
|
||||
@@ -883,6 +922,16 @@ to be edited, to determine whether this syntax should be used for that
|
||||
file. This functionality only works when libmagic is installed on the
|
||||
system and will be silently ignored otherwise.
|
||||
|
||||
@item comment "string"
|
||||
Use the given string for commenting and uncommenting lines. A vertical bar or
|
||||
pipe character (|) designates bracket-style comments; for example, "/*|*/" for
|
||||
CSS files. The characters before the pipe are prepended to the line and the
|
||||
characters after the pipe are appended at the end of the line. If no pipe
|
||||
character is present, the entire string is prepended; for example, "#" for
|
||||
Python files. If empty double quotes are specified, the comment/uncomment
|
||||
functions are disabled; for example, "" for JSON. Double quotes or backslashes
|
||||
may be escaped with a backslash; for example, ".\\"" for man page source.
|
||||
|
||||
@item color fgcolor,bgcolor "regex" @dots{}
|
||||
Display all pieces of text that match the
|
||||
extended regular expression "regex" with foreground color "fgcolor" and
|
||||
@@ -915,7 +964,7 @@ to @code{icolor}.
|
||||
@item extendsyntax str directive [arg @dots{}]
|
||||
Extend the syntax previously defined as str to include new information.
|
||||
This allows you to add a new @code{color}, @code{icolor}, @code{header},
|
||||
@code{magic}, @code{linter}, or @code{formatter} directive to an already
|
||||
@code{magic}, @code{comment}, @code{linter}, or @code{formatter} directive to an already
|
||||
defined syntax --- useful when you want to slightly improve a syntax defined
|
||||
in one of the system-installed files (which are normally not writable).
|
||||
|
||||
@@ -986,6 +1035,7 @@ a string in the current list in the file browser
|
||||
|
||||
@item searchagain
|
||||
Repeats the last search command without prompting.
|
||||
(The form 'research' is deprecated.)
|
||||
|
||||
@item findprevious
|
||||
As @code{searchagain}, but always in the backward direction.
|
||||
@@ -1020,6 +1070,7 @@ Cuts all text from the cursor position till the end of the buffer.
|
||||
|
||||
@item curpos
|
||||
Shows the current cursor position: the line, column, and character positions.
|
||||
(The form 'cursorpos' is deprecated.)
|
||||
|
||||
@item wordcount
|
||||
Counts the number of words, lines and characters in the current buffer.
|
||||
@@ -1040,6 +1091,14 @@ Indents (shifts to the right) the currently marked text.
|
||||
@item unindent
|
||||
Unindents (shifts to the left) the currently marked text.
|
||||
|
||||
@item comment
|
||||
Comments or uncomments the current line or marked lines, using the comment
|
||||
style specified in the active syntax.
|
||||
|
||||
@item complete
|
||||
Completes the fragment before the cursor to a full word found elsewhere
|
||||
in the current buffer.
|
||||
|
||||
@item left
|
||||
Goes left one position (in the editor or browser).
|
||||
|
||||
@@ -1076,6 +1135,13 @@ Moves the cursor to the beginning of the current paragraph.
|
||||
@item endpara
|
||||
Moves the cursor to the end of the current paragraph.
|
||||
|
||||
@item prevblock
|
||||
Moves the cursor to the beginning of the current or preceding block of text.
|
||||
(Blocks are separated by one or more blank lines.)
|
||||
|
||||
@item nextblock
|
||||
Moves the cursor to the beginning of the next block of text.
|
||||
|
||||
@item prevpage
|
||||
Goes up one screenful.
|
||||
|
||||
@@ -1089,7 +1155,8 @@ Goes to the first line of the file.
|
||||
Goes to the last line of the file.
|
||||
|
||||
@item gotoline
|
||||
Goes to a specific line (and column if specified).
|
||||
Goes to a specific line (and column if specified). Negative numbers count
|
||||
from the end of the file (and end of the line).
|
||||
|
||||
@item gototext
|
||||
Switches from targeting a line number to searching for text.
|
||||
@@ -1105,7 +1172,7 @@ Switches to editing/viewing the previous buffer when multiple buffers are open.
|
||||
Switches to editing/viewing the next buffer when multiple buffers are open.
|
||||
|
||||
@item verbatim
|
||||
Inserts the next character verbatim into the file.
|
||||
Inserts the next keystroke verbatim into the file.
|
||||
|
||||
@item tab
|
||||
Inserts a tab at the current cursor location.
|
||||
@@ -1137,6 +1204,7 @@ Toggles case sensitivity in searching (search/replace menus only).
|
||||
|
||||
@item regexp
|
||||
Toggles whether searching/replacing is based on literal strings or regular expressions.
|
||||
(The form 'regex' is deprecated.)
|
||||
|
||||
@item backwards
|
||||
Toggles whether searching/replacing goes forward or backward.
|
||||
@@ -1149,6 +1217,7 @@ Shows the next history entry in the prompt menus (e.g.@: search).
|
||||
|
||||
@item flipreplace
|
||||
Toggles between searching for something and replacing something.
|
||||
(The form 'dontreplace' is deprecated.)
|
||||
|
||||
@item flipexecute
|
||||
Toggles between inserting a file and executing a command.
|
||||
@@ -1156,6 +1225,7 @@ Toggles between inserting a file and executing a command.
|
||||
@item flipnewbuffer
|
||||
Toggles between inserting into the current buffer and into a new
|
||||
empty buffer.
|
||||
(The form 'newbuffer' is deprecated.)
|
||||
|
||||
@item dosformat
|
||||
When writing a file, switches to writing a DOS format (CR/LF).
|
||||
@@ -1260,6 +1330,7 @@ The 'search to replace' menu.
|
||||
|
||||
@item replacewith
|
||||
The 'replace with' menu, which comes up after 'search to replace'.
|
||||
(The form 'replace2' is deprecated.)
|
||||
|
||||
@item gotoline
|
||||
The 'goto line (and column)' menu.
|
||||
@@ -1438,18 +1509,21 @@ Disable use of the spell checker. This also eliminates the @code{-s}
|
||||
command-line option, which allows specifying an alternate spell checker.
|
||||
|
||||
@item --disable-tabcomp
|
||||
Disable the tab completion code when reading or writing files.
|
||||
Disable tab completion (when nano asks for a filename or a search string).
|
||||
|
||||
@item --disable-wordcomp
|
||||
Disable word completion.
|
||||
|
||||
@item --disable-wrapping
|
||||
Disable hard-wrapping of overlong lines. This also eliminates the @code{-w}
|
||||
command-line option, which enables long-line wrapping.
|
||||
Disable all hard-wrapping of overlong lines. This also eliminates the
|
||||
@code{-w} command-line option, which switches long-line wrapping off.
|
||||
|
||||
@item --enable-tiny
|
||||
This option disables all the above. It also disables some of the larger
|
||||
internals of the editor, like the marking code and the cut-to-end-of-line
|
||||
code. It also disables the function toggles. By using the enabling
|
||||
This option implies all of the above. It also disables some other
|
||||
internals of the editor, like the marking code, the cut-to-end-of-line
|
||||
code, and the function toggles. By using the enabling
|
||||
counterpart of the above options together with @code{--enable-tiny},
|
||||
specific features can be switched back on.
|
||||
specific features can be switched back on --- but a few cannot.
|
||||
|
||||
@item --enable-debug
|
||||
Enable support for runtime debug output. This can get pretty messy, so
|
||||
@@ -1,6 +1,3 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
||||
.\" 2013, 2014, 2015 Free Software Foundation, Inc.
|
||||
.\"
|
||||
@@ -20,11 +17,12 @@
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH NANORC 5 "version 2.5.2" "February 2016"
|
||||
.TH NANORC 5 "version 2.7.5" "February 2017"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
|
||||
.SH NAME
|
||||
nanorc \- GNU nano's rcfile
|
||||
nanorc \- GNU nano's configuration file
|
||||
|
||||
.SH DESCRIPTION
|
||||
The \fInanorc\fP file contains the default settings for \fBnano\fP, a
|
||||
small and friendly editor. The file should be in Unix format, not in
|
||||
@@ -111,11 +109,17 @@ See \fBset titlecolor\fR for more details.
|
||||
Enable the use of \fB~/.nano/search_history\fP for saving and reading
|
||||
search/replace strings.
|
||||
.TP
|
||||
.B set justifytrim
|
||||
When justifying text, trailing whitespace will automatically be removed.
|
||||
.TP
|
||||
.B set keycolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
Specify the color combination to use for the shortcut key combos
|
||||
in the two help lines at the bottom of the screen.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
.TP
|
||||
.B set linenumbers
|
||||
Display line numbers to the left of the text area.
|
||||
.TP
|
||||
.B set locking
|
||||
Enable vim-style lock-files for when editing files.
|
||||
.TP
|
||||
@@ -150,6 +154,10 @@ Don't automatically add a newline to the ends of files.
|
||||
.B set nowrap
|
||||
Don't hard-wrap text at all.
|
||||
.TP
|
||||
.B set numbercolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
Specify the color combination to use for line numbers.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
.TP
|
||||
.B set operatingdir "\fIdirectory\fP"
|
||||
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
|
||||
subdirectories. Also, the current directory is changed to here, so
|
||||
@@ -200,6 +208,10 @@ won't work properly with this option enabled.
|
||||
.B set regexp
|
||||
Do extended regular expression searches by default.
|
||||
.TP
|
||||
.B set showcursor
|
||||
Put the cursor on the highlighted item in the file browser, to aid
|
||||
braille users.
|
||||
.TP
|
||||
.B set smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
@@ -236,8 +248,9 @@ Save automatically on exit, don't prompt.
|
||||
.TP
|
||||
.B set titlecolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
Specify the color combination to use for the titlebar.
|
||||
Valid color names for foreground and background are:
|
||||
.BR white , \ black , \ red , \ blue , \ green , \ yellow , \ magenta ", and " cyan .
|
||||
Valid names for the foreground and background colors are:
|
||||
.BR white ", " black ", " blue ", " green ", " red ", " cyan ", " yellow ", and " magenta .
|
||||
The name of the foreground color may be prefixed with \fBbright\fR.
|
||||
And either "\fIfgcolor\fR" or ",\fIbgcolor\fR" may be left out.
|
||||
.TP
|
||||
.B set unix
|
||||
@@ -253,8 +266,13 @@ Set the two characters used to indicate the presence of tabs and
|
||||
spaces. They must be single-column characters.
|
||||
.TP
|
||||
.B set wordbounds
|
||||
Detect word boundaries more accurately by treating punctuation
|
||||
Detect word boundaries differently by treating punctuation
|
||||
characters as parts of words.
|
||||
.TP
|
||||
.B set wordchars \fIstring\fP
|
||||
Specify which other characters (besides the normal alphanumeric ones)
|
||||
should be considered as parts of words. This overrides the option
|
||||
\fBwordbounds\fR.
|
||||
|
||||
.SH SYNTAX HIGHLIGHTING
|
||||
Coloring the different syntactic elements of a file
|
||||
@@ -302,6 +320,16 @@ syntax should be used for that file. This
|
||||
functionality only works when \fBlibmagic\fP is installed on the
|
||||
system and will be silently ignored otherwise.
|
||||
.TP
|
||||
.BI comment " string"
|
||||
Use the given string for commenting and uncommenting lines. A vertical bar or
|
||||
pipe character (|) designates bracket-style comments; for example, "/*|*/" for
|
||||
CSS files. The characters before the pipe are prepended to the line and the
|
||||
characters after the pipe are appended at the end of the line. If no pipe
|
||||
character is present, the entire string is prepended; for example, "#" for
|
||||
Python files. If empty double quotes are specified, the comment/uncomment
|
||||
function is disabled; for example, "" for JSON. Double quotes or backslashes
|
||||
may be escaped with a backslash; for example, ".\\"" for man page source.
|
||||
.TP
|
||||
.B color \fIfgcolor\fR,\fIbgcolor\fR """\fIregex\fR""" ...
|
||||
Display all pieces of text that match
|
||||
the extended regular expression \fIregex\fP with foreground color
|
||||
@@ -336,7 +364,7 @@ to \fBicolor\fP.
|
||||
.BI extendsyntax " str directive " \fR[ "arg " \fR...]
|
||||
Extend the syntax previously defined as \fIstr\fP to include
|
||||
new information. This allows you to add a new \fBcolor\fP, \fBicolor\fP,
|
||||
\fBheader\fP, \fBmagic\fP, \fBlinter\fP, or \fBformatter\fP directive
|
||||
\fBheader\fP, \fBmagic\fP, \fBcomment\fP, \fBlinter\fP, or \fBformatter\fP directive
|
||||
to an already defined syntax -- useful when you want to
|
||||
slightly improve a syntax defined in one of the system-installed
|
||||
files (which are normally not writable)
|
||||
@@ -398,6 +426,7 @@ a string in the current list in the file browser.
|
||||
.TP
|
||||
.B searchagain
|
||||
Repeats the last search command without prompting.
|
||||
(The form 'research' is deprecated.)
|
||||
.TP
|
||||
.B findprevious
|
||||
As \fBsearchagain\fR, but always in the backward direction.
|
||||
@@ -432,6 +461,7 @@ Cuts all text from the cursor position till the end of the buffer.
|
||||
.TP
|
||||
.B curpos
|
||||
Shows the current cursor position: the line, column, and character positions.
|
||||
(The form 'cursorpos' is deprecated.)
|
||||
.TP
|
||||
.B wordcount
|
||||
Counts the number of words, lines and characters in the current buffer.
|
||||
@@ -455,6 +485,14 @@ Indents (shifts to the right) the currently marked text.
|
||||
.B unindent
|
||||
Unindents (shifts to the left) the currently marked text.
|
||||
.TP
|
||||
.B comment
|
||||
Comments or uncomments the current line or marked lines, using the comment
|
||||
style specified in the active syntax.
|
||||
.TP
|
||||
.B complete
|
||||
Completes the fragment before the cursor to a full word found elsewhere
|
||||
in the current buffer.
|
||||
.TP
|
||||
.B left
|
||||
Goes left one position (in the editor or browser).
|
||||
.TP
|
||||
@@ -491,6 +529,13 @@ Moves the cursor to the beginning of the current paragraph.
|
||||
.B endpara
|
||||
Moves the cursor to the end of the current paragraph.
|
||||
.TP
|
||||
.B prevblock
|
||||
Moves the cursor to the beginning of the current or preceding block of text.
|
||||
(Blocks are separated by one or more blank lines.)
|
||||
.TP
|
||||
.B nextblock
|
||||
Moves the cursor to the beginning of the next block of text.
|
||||
.TP
|
||||
.B prevpage
|
||||
Goes up one screenful.
|
||||
.TP
|
||||
@@ -504,7 +549,8 @@ Goes to the first line of the file.
|
||||
Goes to the last line of the file.
|
||||
.TP
|
||||
.B gotoline
|
||||
Goes to a specific line (and column if specified).
|
||||
Goes to a specific line (and column if specified). Negative numbers count
|
||||
from the end of the file (and end of the line).
|
||||
.TP
|
||||
.B gototext
|
||||
Switches from targeting a line number to searching for text.
|
||||
@@ -520,7 +566,7 @@ Switches to editing/viewing the previous buffer when multiple buffers are open.
|
||||
Switches to editing/viewing the next buffer when multiple buffers are open.
|
||||
.TP
|
||||
.B verbatim
|
||||
Inserts the next character verbatim into the file.
|
||||
Inserts the next keystroke verbatim into the file.
|
||||
.TP
|
||||
.B tab
|
||||
Inserts a tab at the current cursor location.
|
||||
@@ -552,6 +598,7 @@ Toggles case sensitivity in searching (search/replace menus only).
|
||||
.TP
|
||||
.B regexp
|
||||
Toggles whether searching/replacing is based on literal strings or regular expressions.
|
||||
(The form 'regex' is deprecated.)
|
||||
.TP
|
||||
.B backwards
|
||||
Toggles whether searching/replacing goes forward or backward.
|
||||
@@ -564,6 +611,7 @@ Shows the next history entry in the prompt menus (e.g. search).
|
||||
.TP
|
||||
.B flipreplace
|
||||
Toggles between searching for something and replacing something.
|
||||
(The form 'dontreplace' is deprecated.)
|
||||
.TP
|
||||
.B flipexecute
|
||||
Toggles between inserting a file and executing a command.
|
||||
@@ -571,6 +619,7 @@ Toggles between inserting a file and executing a command.
|
||||
.B flipnewbuffer
|
||||
Toggles between inserting into the current buffer and into a new
|
||||
empty buffer.
|
||||
(The form 'newbuffer' is deprecated.)
|
||||
.TP
|
||||
.B dosformat
|
||||
When writing a file, switches to writing a DOS format (CR/LF).
|
||||
@@ -674,6 +723,7 @@ The 'search to replace' menu.
|
||||
.TP
|
||||
.B replacewith
|
||||
The 'replace with' menu, which comes up after 'search to replace'.
|
||||
(The form 'replace2' is deprecated.)
|
||||
.TP
|
||||
.B gotoline
|
||||
The 'goto line (and column)' menu.
|
||||
@@ -718,14 +768,11 @@ System-wide configuration file.
|
||||
.TP
|
||||
.B ~/.nanorc
|
||||
Per-user configuration file.
|
||||
|
||||
.SH SEE ALSO
|
||||
.TP
|
||||
\fBnano\fP(1)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
|
||||
system)
|
||||
.BR nano (1)
|
||||
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see \fIAUTHORS\fP and
|
||||
Chris Allegretta and others (see the files \fIAUTHORS\fP and
|
||||
\fITHANKS\fP for details). This manual page was originally written by
|
||||
Jordi Mallach <jordi@gnu.org>, for the Debian system (but may be used by
|
||||
others).
|
||||
Jordi Mallach for the Debian system (but may be used by others).
|
||||
67
doc/rnano.1
Normal file
67
doc/rnano.1
Normal file
@@ -0,0 +1,67 @@
|
||||
.\" Copyright (C) 2002, 2005, 2006, 2007, 2014 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" This document is dual-licensed. You may distribute and/or modify it
|
||||
.\" under the terms of either of the following licenses:
|
||||
.\"
|
||||
.\" * The GNU General Public License, as published by the Free Software
|
||||
.\" Foundation, version 3 or (at your option) any later version. You
|
||||
.\" should have received a copy of the GNU General Public License
|
||||
.\" along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.\" * The GNU Free Documentation License, as published by the Free
|
||||
.\" Software Foundation, version 1.2 or (at your option) any later
|
||||
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
|
||||
.\" Back-Cover Texts. You should have received a copy of the GNU Free
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <http://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH RNANO 1 "version 2.7.5" "February 2017"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
|
||||
.SH NAME
|
||||
rnano \- a restricted nano
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B rnano
|
||||
.RI [ options "] [[+" line [, column "]]\ " file "]..."
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBrnano\fR runs the \fBnano\fR editor in restricted mode. This allows
|
||||
editing only the specified file or files, and doesn't allow the user
|
||||
access to the filesystem nor to a command shell.
|
||||
.PP
|
||||
In restricted mode, \fBnano\fR will:
|
||||
.IP \[bu] 2
|
||||
not read any nanorc files;
|
||||
.IP \[bu]
|
||||
not allow suspending;
|
||||
.IP \[bu]
|
||||
not read nor write any file not specified on the command line;
|
||||
.IP \[bu]
|
||||
not allow saving a file under a different name;
|
||||
.IP \[bu]
|
||||
not allow appending or prepending to any file;
|
||||
.IP \[bu]
|
||||
not make backup files nor do spell checking.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-h ", " \-\-help
|
||||
Show a summary of command-line options and exit.
|
||||
.PP
|
||||
See the \fBnano\fP(1) manpage for all available options.
|
||||
|
||||
.SH BUGS
|
||||
Please report bugs via \fIhttps://savannah.gnu.org/bugs/?group=nano\fR.
|
||||
|
||||
.SH HOMEPAGE
|
||||
https://nano-editor.org/
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR nano (1)
|
||||
|
||||
.SH AUTHOR
|
||||
Chris Allegretta and others (see the files \fIAUTHORS\fR and \fITHANKS\fR
|
||||
for details). This manual page was originally written by Thijs Kinkhorst
|
||||
for the Debian system (but may be used by others).
|
||||
@@ -60,6 +60,12 @@
|
||||
## Remember the used search/replace strings for the next session.
|
||||
# set historylog
|
||||
|
||||
## Make the justify command kill whitespace at the end of lines.
|
||||
# set justifytrim
|
||||
|
||||
## Display line numbers to the left of the text.
|
||||
# set linenumbers
|
||||
|
||||
## Enable vim-style lock-files. This is just to let a vim user know you
|
||||
## are editing a file [s]he is trying to edit and vice versa. There are
|
||||
## no plans to implement vim-style undo state in these files.
|
||||
@@ -135,6 +141,10 @@
|
||||
## Do extended regular expression searches by default.
|
||||
# set regexp
|
||||
|
||||
## Put the cursor on the highlighted item in the file browser;
|
||||
## useful for people who use a braille display.
|
||||
# set showcursor
|
||||
|
||||
## Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
## very beginning of non-whitespace characters on a line, the cursor
|
||||
## will jump to that beginning (either forwards or backwards). If the
|
||||
@@ -175,14 +185,20 @@
|
||||
## The default otherwise:
|
||||
# set whitespace ">."
|
||||
|
||||
## Detect word boundaries more accurately by treating punctuation
|
||||
## Detect word boundaries differently by treating punctuation
|
||||
## characters as parts of words.
|
||||
# set wordbounds
|
||||
|
||||
## The characters (besides alphanumeric ones) that should be considered
|
||||
## as parts of words. This option does not have a default value. When
|
||||
## set, it overrides option 'set wordbounds'.
|
||||
# set wordchars "<_>."
|
||||
|
||||
|
||||
## Paint the interface elements of nano.
|
||||
## This is an example; by default there are no colors.
|
||||
## These are examples; by default there are no colors.
|
||||
# set titlecolor brightwhite,blue
|
||||
# set numbercolor cyan
|
||||
# set statuscolor brightwhite,green
|
||||
# set keycolor green
|
||||
# set functioncolor yellow
|
||||
@@ -1,8 +0,0 @@
|
||||
## Here is a short example for HTML.
|
||||
|
||||
syntax "html" "\.html?$"
|
||||
magic "HTML document text"
|
||||
|
||||
color cyan start="<" end=">"
|
||||
color red "&[^;[:space:]]*;"
|
||||
color green ""(\\.|[^"])*""
|
||||
@@ -1,28 +0,0 @@
|
||||
## Here is an example for nanorc files.
|
||||
|
||||
syntax "nanorc" "\.?nanorc$"
|
||||
|
||||
# Possible errors and parameters
|
||||
icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|i?color|extendsyntax).*$"
|
||||
|
||||
# Keywords
|
||||
icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|const(antshow)?|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nohelp|nonewlines|nowrap|pos(ition)?log|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|unix|view|wordbounds)\>"
|
||||
icolor yellow "^[[:space:]]*set[[:space:]]+(functioncolor|keycolor|statuscolor|titlecolor)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
|
||||
icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|functioncolor|keycolor|matchbrackets|operatingdir|punct|quotestr|speller|statuscolor|titlecolor|whitespace)[[:space:]]+"
|
||||
icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9^_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+(all|main|search|replace(2|with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)"
|
||||
icolor brightgreen "^[[:space:]]*unbind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9^_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+(all|main|search|replace(2|with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)"
|
||||
icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|linter|formatter)[[:space:]]+.*$"
|
||||
icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|formatter|extendsyntax)\>"
|
||||
|
||||
# Colors
|
||||
icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
|
||||
icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
|
||||
|
||||
# Strings
|
||||
icolor brightmagenta ""(\\.|[^"])*""
|
||||
# Comments
|
||||
icolor brightblue "(^|[[:space:]]+)#.*$"
|
||||
icolor cyan "^[[:space:]]*##.*$"
|
||||
|
||||
# Trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
||||
3
doc/texinfo/.gitignore
vendored
3
doc/texinfo/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
texinfo.tex
|
||||
nano.html
|
||||
nano.info
|
||||
@@ -1,10 +0,0 @@
|
||||
info_TEXINFOS = nano.texi
|
||||
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
BUILT_SOURCES = nano.html
|
||||
|
||||
nano.html: nano.texi
|
||||
makeinfo --no-split --html < $< > $@
|
||||
|
||||
EXTRA_DIST = $(info_TEXINFOS) $(BUILT_SOURCES)
|
||||
@@ -9,8 +9,8 @@ Summary : a user-friendly editor, a Pico clone with enhancements
|
||||
|
||||
License : GPLv3+
|
||||
Group : Applications/Editors
|
||||
URL : http://www.nano-editor.org/
|
||||
Source : http://www.nano-editor.org/dist/v2.4/%{name}-%{version}.tar.gz
|
||||
URL : https://nano-editor.org/
|
||||
Source : https://nano-editor.org/dist/v2.6/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRoot : %{_tmppath}/%{name}-%{version}-root
|
||||
BuildRequires : autoconf, automake, gettext-devel, ncurses-devel, texinfo
|
||||
@@ -43,7 +43,7 @@ fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS TODO doc/faq.html doc/nanorc.sample
|
||||
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS TODO doc/faq.html doc/sample.nanorc
|
||||
%{_bindir}/*
|
||||
%{_docdir}/nano/*
|
||||
%{_mandir}/man*/*
|
||||
|
||||
@@ -996,6 +996,3 @@
|
||||
|
||||
* ca.po: Updated.
|
||||
* es.po: Updated.
|
||||
|
||||
|
||||
$Id$
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# List of available languages.
|
||||
bg ca cs da de eo es eu fi fr ga gl hr hu id it ja ms nb nl nn pl pt_BR ro ru sl sr sv tr uk vi zh_CN zh_TW
|
||||
bg ca cs da de eo es eu fi fr ga gl hr hu id it ja ms nb nl nn pl pt_BR ro ru sl sr sv tr uk vi zh_CN zh_TW
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# $Id$
|
||||
# List of source files containing translatable strings.
|
||||
|
||||
src/browser.c
|
||||
src/color.c
|
||||
src/files.c
|
||||
src/global.c
|
||||
src/help.c
|
||||
|
||||
1342
po/nano.pot
1342
po/nano.pot
File diff suppressed because it is too large
Load Diff
1578
po/pt_BR.po
1578
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,26 @@
|
||||
#!/bin/sh
|
||||
echo "Updating translations via TP" && \
|
||||
|
||||
# Let this be executed in the po/ subdir.
|
||||
cd "$(dirname "$0")" || exit
|
||||
|
||||
echo "Updating translations via TP"
|
||||
rsync -Lrtvz translationproject.org::tp/latest/nano/ .
|
||||
#
|
||||
NEWSTUFF=`svn status | grep "^\? .*.po$" | awk '{ print $NF }'`
|
||||
if [ "x$NEWSTUFF" != "x" ]; then
|
||||
echo "Adding new languaes to SVN"
|
||||
svn add $NEWSTUFF
|
||||
fi
|
||||
#
|
||||
echo "Updating LINGUAS for all translations"
|
||||
FILE=LINGUAS
|
||||
echo "# List of available languages." >$FILE
|
||||
/bin/ls *.po | tr '\n' ' ' | sed 's/\.po//g' >>$FILE
|
||||
echo >> $FILE
|
||||
#
|
||||
if [ "x$NEWSTUFF" != "x" ]; then
|
||||
echo -n "New langs found, re-running configure and make at top level (silently)..."
|
||||
(cd .. && ./configure && make) >/dev/null
|
||||
echo "done"
|
||||
|
||||
# Are there now PO files that are not in git yet?
|
||||
NEWSTUFF=$(git status --porcelain *.po | grep "^??")
|
||||
|
||||
if [ -n "${NEWSTUFF}" ]; then
|
||||
echo "New languages found; updating LINGUAS"
|
||||
echo "# List of available languages." >LINGUAS
|
||||
echo $(printf '%s\n' *.po | LC_ALL=C sort | sed 's/\.po//g') >>LINGUAS
|
||||
fi
|
||||
|
||||
echo "Regenerating POT file and remerging and recompiling PO files..."
|
||||
make update-po
|
||||
|
||||
# Ensure that the PO files are newer than the POT.
|
||||
touch *.po
|
||||
|
||||
# If needed, fix a problem in the Makefile template.
|
||||
grep -q '^datarootdir' Makefile.in.in || \
|
||||
sed -i 's/^\(datadir.*\)/datarootdir = @datarootdir@\n\1/' Makefile.in.in
|
||||
|
||||
@@ -1,368 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
#
|
||||
# GNOME PO Update Utility
|
||||
#
|
||||
# Copyright (C) 2000, 2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# This script is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# This script is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
|
||||
# USA.
|
||||
#
|
||||
# Authors: Kenneth Christiansen <kenneth@gnu.org>
|
||||
#
|
||||
|
||||
# NOTICE: Please remember to change the variable $PACKAGE to reflect
|
||||
# the package this script is used within.
|
||||
|
||||
$PACKAGE="nano";
|
||||
|
||||
use File::Basename;
|
||||
|
||||
# Declare global variables
|
||||
#-------------------------
|
||||
my $VERSION = "1.5beta5";
|
||||
my $LANG = $ARGV[0];
|
||||
|
||||
# Always print as the first thing
|
||||
#--------------------------------
|
||||
$| = 1;
|
||||
|
||||
# Figure out what package that is in use
|
||||
#---------------------------------------
|
||||
#open FILE, "../configure.in";
|
||||
# while (<FILE>) {
|
||||
# next if /^dnl/; #ignore comments
|
||||
# if ($_=~/AM_INIT_AUTOMAKE\((.*),(.*)\)/o){
|
||||
# $PACKAGE=$1;
|
||||
# last; #stop when found
|
||||
# }
|
||||
# if ($_=~/PACKAGE\((.*)\)/o){
|
||||
# $PACKAGE=$1;
|
||||
# last; #stop when found
|
||||
# }
|
||||
# }
|
||||
#close FILE;
|
||||
|
||||
|
||||
# Give error if script is run without an argument
|
||||
#------------------------------------------------
|
||||
if (! $LANG){
|
||||
print "update.pl: missing file arguments\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
# Use the supplied arguments
|
||||
#---------------------------
|
||||
if ($LANG=~/^-(.)*/){
|
||||
|
||||
if ("$LANG" eq "--version" || "$LANG" eq "-V"){
|
||||
&Version;
|
||||
}
|
||||
elsif ($LANG eq "--help" || "$LANG" eq "-H"){
|
||||
&Help;
|
||||
}
|
||||
elsif ($LANG eq "--dist" || "$LANG" eq "-D"){
|
||||
&Merging;
|
||||
}
|
||||
elsif ($LANG eq "--pot" || "$LANG" eq "-P"){
|
||||
|
||||
# Check for .headerlock file, so the Makefile
|
||||
# will not generate the header files twise
|
||||
#--------------------------------------------
|
||||
if (-e ".headerlock"){
|
||||
&GeneratePot;
|
||||
}else{
|
||||
&GenHeaders;
|
||||
&GeneratePot;}
|
||||
exit;
|
||||
}
|
||||
elsif ($LANG eq "--headers" || "$LANG" eq "-S"){
|
||||
&GenHeaders;
|
||||
exit;
|
||||
}
|
||||
elsif ($LANG eq "--maintain" || "$LANG" eq "-M"){
|
||||
&Maintain;
|
||||
}
|
||||
else {
|
||||
&InvalidOption;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
# Run standard procedure
|
||||
#-----------------------
|
||||
if(-s "$LANG.po"){
|
||||
&GenHeaders;
|
||||
&GeneratePot;
|
||||
&Merging;
|
||||
&Status;
|
||||
}
|
||||
|
||||
# Report error if the language file supplied
|
||||
# to the command line is non-existent
|
||||
#-------------------------------------------
|
||||
else {
|
||||
&NotExisting;
|
||||
}
|
||||
}
|
||||
|
||||
sub Version{
|
||||
|
||||
# Print version information
|
||||
#--------------------------
|
||||
print "GNOME PO Updater $VERSION\n";
|
||||
print "Written by Kenneth Christiansen <kenneth\@gnome.org>, 2000.\n\n";
|
||||
print "Copyright (C) 2000 Free Software Foundation, Inc.\n";
|
||||
print "This is free software; see the source for copying conditions. There is NO\n";
|
||||
print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
sub Help{
|
||||
|
||||
# Print usage information
|
||||
#------------------------
|
||||
print "Usage: ./update.pl [OPTIONS] ...LANGCODE\n";
|
||||
print "Updates pot files and merge them with the translations.\n\n";
|
||||
print " -H, --help shows this help page\n";
|
||||
print " -P, --pot generate the pot file only\n";
|
||||
print " -S, --headers generate the XML headerfiles in POTFILES.in\n";
|
||||
print " -M, --maintain search for missing files in POTFILES.in\n";
|
||||
print " -V, --version shows the version\n";
|
||||
print "\nExamples of use:\n";
|
||||
print "update.sh --pot just creates a new pot file from the source\n";
|
||||
print "update.sh da created new pot file and updated the da.po file\n\n";
|
||||
print "Report bugs to <kenneth\@gnome.org>.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
sub Maintain{
|
||||
|
||||
# Search and fine, all translatable files
|
||||
# ---------------------------------------
|
||||
$i18nfiles="find ../ -print | egrep '.*\\.(c|y|cc|c++|h|gob)' ";
|
||||
|
||||
open(BUF2, "POTFILES.in") || die "update.pl: there's no POTFILES.in!!!\n";
|
||||
|
||||
print "Searching for missing _(\" \") entries...\n";
|
||||
|
||||
open(BUF1, "$i18nfiles|");
|
||||
|
||||
@buf1_1 = <BUF1>;
|
||||
@buf1_2 = <BUF2>;
|
||||
|
||||
# Check if we should ignore some found files, when
|
||||
# comparing with POTFILES.in
|
||||
#-------------------------------------------------
|
||||
if (-s ".potignore"){
|
||||
open FILE, ".potignore";
|
||||
while (<FILE>) {
|
||||
if ($_=~/^[^#]/o){
|
||||
push @bup, $_;
|
||||
}
|
||||
}
|
||||
print "Found .potignore: Ignoring files...\n";
|
||||
@buf1_2 = (@bup, @buf1_2);
|
||||
}
|
||||
|
||||
foreach my $file (@buf1_1){
|
||||
open FILE, "<$file";
|
||||
while (<FILE>) {
|
||||
if ($_=~/_\(\"/o){
|
||||
$file = unpack("x3 A*",$file) . "\n";
|
||||
push @buf2_1, $file;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@buf3_1 = sort (@buf2_1);
|
||||
@buf3_2 = sort (@buf1_2);
|
||||
|
||||
my %in2;
|
||||
foreach (@buf3_2) {
|
||||
$in2{$_} = 1;
|
||||
}
|
||||
|
||||
foreach (@buf3_1){
|
||||
if (!exists($in2{$_})){
|
||||
push @result, $_
|
||||
}
|
||||
}
|
||||
|
||||
# Save file with information about the files missing
|
||||
# if any, and give information about this proceedier
|
||||
#---------------------------------------------------
|
||||
if(@result){
|
||||
open OUT, ">missing";
|
||||
print OUT @result;
|
||||
print "\nHere is the result:\n\n", @result, "\n";
|
||||
print "The file \"missing\" has been placed in the current directory.\n";
|
||||
print "Files supposed to be ignored should be placed in \".potignore\"\n";
|
||||
}
|
||||
|
||||
# If there is nothing to complain about, notice the user
|
||||
#-------------------------------------------------------
|
||||
else{
|
||||
print "\nWell, it's all perfect! Congratulation!\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub InvalidOption{
|
||||
|
||||
# Handle invalid arguments
|
||||
#-------------------------
|
||||
print "update.pl: invalid option -- $LANG\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
}
|
||||
|
||||
sub GenHeaders{
|
||||
|
||||
# Generate the .h header files, so we can allow glade and
|
||||
# xml translation support
|
||||
#--------------------------------------------------------
|
||||
if(-s "ui-extract.pl"){
|
||||
|
||||
print "Found ui-extract.pl script\nRunning ui-extract...\n";
|
||||
|
||||
open FILE, "<POTFILES.in";
|
||||
while (<FILE>) {
|
||||
|
||||
# Find .xml files in POTFILES.in and generate the
|
||||
# files with help from the ui-extract.pl script
|
||||
#--------------------------------------------------
|
||||
if ($_=~ /(.*)(\.xml)/o){
|
||||
$filename = "../$1.xml";
|
||||
$xmlfiles="perl \.\/ui-extract.pl --local $filename";
|
||||
system($xmlfiles);
|
||||
}
|
||||
|
||||
# Find .glade files in POTFILES.in and generate
|
||||
# the files with help from the ui-extract.pl script
|
||||
#--------------------------------------------------
|
||||
elsif ($_=~ /(.*)(\.glade)/o){
|
||||
$filename = "../$1.glade";
|
||||
$xmlfiles="perl \.\/ui-extract.pl --local $filename";
|
||||
system($xmlfiles);
|
||||
}
|
||||
}
|
||||
close FILE;
|
||||
|
||||
# Create .headerlock file, so the script will know
|
||||
# that we already passed this section. This is required
|
||||
# since the individual sections can be reaced at different
|
||||
# times by the Makefile
|
||||
#---------------------------------------------------------
|
||||
system("touch .headerlock");
|
||||
}
|
||||
}
|
||||
|
||||
sub GeneratePot{
|
||||
|
||||
# Generate the potfiles from the POTFILES.in file
|
||||
#------------------------------------------------
|
||||
|
||||
print "Building the $PACKAGE.pot...\n";
|
||||
|
||||
system ("mv POTFILES.in POTFILES.in.old");
|
||||
|
||||
open INFILE, "<POTFILES.in.old";
|
||||
open OUTFILE, ">POTFILES.in";
|
||||
while (<INFILE>) {
|
||||
if ($_ =~ /\.(glade|xml)$/) {
|
||||
s/\.glade$/\.glade\.h/;
|
||||
s/\.xml$/\.xml\.h/;
|
||||
$_ = basename($_);
|
||||
$_ = "po/tmp/$_\n";
|
||||
}
|
||||
print OUTFILE $_;
|
||||
}
|
||||
close OUTFILE;
|
||||
close INFILE;
|
||||
|
||||
$GETTEXT ="xgettext --default-domain\=$PACKAGE --directory\=\.\."
|
||||
." --add-comments --keyword\=\_ --keyword\=N\_ --keyword\=P_\:1,2"
|
||||
." --files-from\=\.\/POTFILES\.in ";
|
||||
$GTEST ="test \! -f $PACKAGE\.po \|\| \( rm -f \.\/$PACKAGE\.pot "
|
||||
."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
|
||||
|
||||
system($GETTEXT);
|
||||
system($GTEST);
|
||||
print "Wrote $PACKAGE.pot\n";
|
||||
system("mv POTFILES.in.old POTFILES.in");
|
||||
|
||||
# If .headerlock file is found, it means that the potfiles
|
||||
# already has been generated. If so delete the generated
|
||||
# .h header files. The reason for this approach with a
|
||||
# file as a marker is due to that the Makefile runs the
|
||||
# scripts in turns
|
||||
#---------------------------------------------------------
|
||||
|
||||
if(-e ".headerlock"){
|
||||
unlink(".headerlock");
|
||||
|
||||
print "Removing generated header (.h) files...";
|
||||
system("rm ./tmp/ -rf");
|
||||
}
|
||||
print "done\n";
|
||||
}
|
||||
|
||||
sub Merging{
|
||||
|
||||
if ($ARGV[1]){
|
||||
$LANG = $ARGV[1];
|
||||
} else {
|
||||
$LANG = $ARGV[0];
|
||||
}
|
||||
|
||||
if ($ARGV[0] ne "--dist" && $ARGV[0] ne "-D") {
|
||||
print "Merging $LANG.po with $PACKAGE.pot...";
|
||||
}
|
||||
|
||||
$MERGE="cp $LANG.po $LANG.po.old && msgmerge $LANG.po.old $PACKAGE.pot -o $LANG.po";
|
||||
|
||||
system($MERGE);
|
||||
|
||||
if ($ARGV[0] ne "--dist" && $ARGV[0] ne "-D") {
|
||||
print "\n\n";
|
||||
}
|
||||
|
||||
# Remove the "messages" trash file generated
|
||||
# by gettext, aswell as the backup file
|
||||
#-------------------------------------------
|
||||
unlink "messages";
|
||||
unlink "$LANG.po.old";
|
||||
}
|
||||
|
||||
sub NotExisting{
|
||||
|
||||
# Report error if supplied language
|
||||
# file is non-existant
|
||||
#----------------------------------
|
||||
print "update.pl: sorry, $LANG.po does not exist!\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
sub Status{
|
||||
|
||||
# Print status information about the po file
|
||||
#-------------------------------------------
|
||||
$STATUS="msgfmt --statistics $LANG.po";
|
||||
|
||||
system($STATUS);
|
||||
print "\n";
|
||||
}
|
||||
1449
po/zh_CN.po
1449
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
1457
po/zh_TW.po
1457
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,23 @@
|
||||
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -DSYSCONFDIR=\"$(sysconfdir)\"
|
||||
|
||||
CLEANFILES = revision.h
|
||||
|
||||
if BUILDING_FROM_GIT
|
||||
SOMETHING = "REVISION \"$(shell git describe --tags 2>/dev/null)\""
|
||||
else
|
||||
SOMETHING = "NOTHING \"from tarball\""
|
||||
endif
|
||||
|
||||
nano.o: revision.h
|
||||
winio.o: revision.h
|
||||
|
||||
revision.h: update_revision
|
||||
@[ -f $@ ] || touch $@
|
||||
@echo "#define $(SOMETHING)" | cmp -s $@ - || \
|
||||
echo "#define $(SOMETHING)" > $@
|
||||
|
||||
.PHONY: update_revision
|
||||
|
||||
bin_PROGRAMS = nano
|
||||
nano_SOURCES = browser.c \
|
||||
chars.c \
|
||||
|
||||
712
src/browser.c
712
src/browser.c
File diff suppressed because it is too large
Load Diff
575
src/chars.c
575
src/chars.c
@@ -1,23 +1,22 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* chars.c *
|
||||
* chars.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, *
|
||||
* 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* Copyright (C) 2016 Benno Schulenberg *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -36,12 +35,6 @@
|
||||
|
||||
static bool use_utf8 = FALSE;
|
||||
/* Whether we've enabled UTF-8 support. */
|
||||
static const wchar_t bad_wchar = 0xFFFD;
|
||||
/* If we get an invalid multibyte sequence, we treat it as
|
||||
* Unicode FFFD (Replacement Character), unless we're searching
|
||||
* for a match to it. */
|
||||
static const char *const bad_mbchar = "\xEF\xBF\xBD";
|
||||
static const int bad_mbchar_len = 3;
|
||||
|
||||
/* Enable UTF-8 support. */
|
||||
void utf8_init(void)
|
||||
@@ -56,18 +49,18 @@ bool using_utf8(void)
|
||||
}
|
||||
#endif /* ENABLE_UTF8 */
|
||||
|
||||
/* Concatenate two allocated strings. */
|
||||
char* addstrings(char* str1, size_t len1, char* str2, size_t len2)
|
||||
/* Concatenate two allocated strings, and free the second. */
|
||||
char *addstrings(char* str1, size_t len1, char* str2, size_t len2)
|
||||
{
|
||||
str1 = charealloc(str1, len1 + len2 + 1);
|
||||
str1[len1] = '\0';
|
||||
|
||||
strncat(&str1[len1], str2, len2);
|
||||
free(str2);
|
||||
|
||||
return str1;
|
||||
}
|
||||
|
||||
|
||||
#ifndef HAVE_ISBLANK
|
||||
/* This function is equivalent to isblank(). */
|
||||
bool nisblank(int c)
|
||||
@@ -84,8 +77,7 @@ bool niswblank(wchar_t wc)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Return TRUE if the value of c is in byte range, and FALSE
|
||||
* otherwise. */
|
||||
/* Return TRUE if the value of c is in byte range, and FALSE otherwise. */
|
||||
bool is_byte(int c)
|
||||
{
|
||||
return ((unsigned int)c == (unsigned char)c);
|
||||
@@ -96,9 +88,24 @@ void mbtowc_reset(void)
|
||||
IGNORE_CALL_RESULT(mbtowc(NULL, NULL, 0));
|
||||
}
|
||||
|
||||
void wctomb_reset(void)
|
||||
/* This function is equivalent to isalpha() for multibyte characters. */
|
||||
bool is_alpha_mbchar(const char *c)
|
||||
{
|
||||
IGNORE_CALL_RESULT(wctomb(NULL, 0));
|
||||
assert(c != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
wchar_t wc;
|
||||
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
|
||||
mbtowc_reset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return iswalpha(wc);
|
||||
} else
|
||||
#endif
|
||||
return isalpha((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* This function is equivalent to isalnum() for multibyte characters. */
|
||||
@@ -112,7 +119,7 @@ bool is_alnum_mbchar(const char *c)
|
||||
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
|
||||
mbtowc_reset();
|
||||
wc = bad_wchar;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return iswalnum(wc);
|
||||
@@ -132,7 +139,7 @@ bool is_blank_mbchar(const char *c)
|
||||
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
|
||||
mbtowc_reset();
|
||||
wc = bad_wchar;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return iswblank(wc);
|
||||
@@ -152,37 +159,18 @@ bool is_ascii_cntrl_char(int c)
|
||||
* handles high-bit control characters. */
|
||||
bool is_cntrl_char(int c)
|
||||
{
|
||||
return (-128 <= c && c < -96) || (0 <= c && c < 32) ||
|
||||
(127 <= c && c < 160);
|
||||
return ((c & 0x60) == 0 || c == 127);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
/* This function is equivalent to iscntrl() for wide characters, except
|
||||
* in that it also handles wide control characters with their high bits
|
||||
* set. */
|
||||
bool is_cntrl_wchar(wchar_t wc)
|
||||
{
|
||||
return (0 <= wc && wc < 32) || (127 <= wc && wc < 160);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function is equivalent to iscntrl() for multibyte characters,
|
||||
* except in that it also handles multibyte control characters with
|
||||
* their high bits set. */
|
||||
bool is_cntrl_mbchar(const char *c)
|
||||
{
|
||||
assert(c != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
wchar_t wc;
|
||||
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
|
||||
mbtowc_reset();
|
||||
wc = bad_wchar;
|
||||
}
|
||||
|
||||
return is_cntrl_wchar(wc);
|
||||
return ((c[0] & 0xE0) == 0 || c[0] == 127 ||
|
||||
((signed char)c[0] == -62 && (signed char)c[1] < -96));
|
||||
} else
|
||||
#endif
|
||||
return is_cntrl_char((unsigned char)*c);
|
||||
@@ -199,7 +187,7 @@ bool is_punct_mbchar(const char *c)
|
||||
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
|
||||
mbtowc_reset();
|
||||
wc = bad_wchar;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return iswpunct(wc);
|
||||
@@ -208,117 +196,91 @@ bool is_punct_mbchar(const char *c)
|
||||
return ispunct((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* Return TRUE for a multibyte character found in a word (currently only
|
||||
* an alphanumeric or punctuation character, and only the latter if
|
||||
* allow_punct is TRUE) and FALSE otherwise. */
|
||||
/* Return TRUE when the given multibyte character c is a word-forming
|
||||
* character (that is: alphanumeric, or specified in wordchars, or
|
||||
* punctuation when allow_punct is TRUE), and FALSE otherwise. */
|
||||
bool is_word_mbchar(const char *c, bool allow_punct)
|
||||
{
|
||||
assert(c != NULL);
|
||||
if (*c == '\0')
|
||||
return FALSE;
|
||||
|
||||
return is_alnum_mbchar(c) || (allow_punct ? is_punct_mbchar(c) :
|
||||
FALSE);
|
||||
if (is_alnum_mbchar(c))
|
||||
return TRUE;
|
||||
|
||||
if (word_chars != NULL && *word_chars != '\0') {
|
||||
char symbol[mb_cur_max() + 1];
|
||||
int symlen = parse_mbchar(c, symbol, NULL);
|
||||
|
||||
symbol[symlen] = '\0';
|
||||
return (strstr(word_chars, symbol) != NULL);
|
||||
}
|
||||
|
||||
return (allow_punct && is_punct_mbchar(c));
|
||||
}
|
||||
|
||||
/* c is a control character. It displays as ^@, ^?, or ^[ch], where ch
|
||||
* is (c + 64). We return that character. */
|
||||
char control_rep(char c)
|
||||
/* Return the visible representation of control character c. */
|
||||
char control_rep(const signed char c)
|
||||
{
|
||||
assert(is_cntrl_char(c));
|
||||
|
||||
/* Treat newlines embedded in a line as encoded nulls. */
|
||||
if (c == '\n')
|
||||
return '@';
|
||||
else if (c == NANO_CONTROL_8)
|
||||
if (c == DEL_CODE)
|
||||
return '?';
|
||||
else if (c == -97)
|
||||
return '=';
|
||||
else if (c < 0)
|
||||
return c + 224;
|
||||
else
|
||||
return c + 64;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
/* c is a wide control character. It displays as ^@, ^?, or ^[ch],
|
||||
* where ch is (c + 64). We return that wide character. */
|
||||
wchar_t control_wrep(wchar_t wc)
|
||||
/* Return the visible representation of multibyte control character c. */
|
||||
char control_mbrep(const char *c, bool isdata)
|
||||
{
|
||||
assert(is_cntrl_wchar(wc));
|
||||
|
||||
/* Treat newlines embedded in a line as encoded nulls. */
|
||||
if (wc == '\n')
|
||||
/* An embedded newline is an encoded NUL if it is data. */
|
||||
if (*c == '\n' && (isdata || as_an_at))
|
||||
return '@';
|
||||
else if (wc == NANO_CONTROL_8)
|
||||
return '?';
|
||||
else
|
||||
return wc + 64;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* c is a multibyte control character. It displays as ^@, ^?, or ^[ch],
|
||||
* where ch is (c + 64). We return that multibyte character. If crep
|
||||
* is an invalid multibyte sequence, it will be replaced with Unicode
|
||||
* 0xFFFD (Replacement Character). */
|
||||
char *control_mbrep(const char *c, char *crep, int *crep_len)
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
if ((unsigned char)c[0] < 128)
|
||||
return control_rep(c[0]);
|
||||
else
|
||||
return control_rep(c[1]);
|
||||
} else
|
||||
#endif
|
||||
return control_rep(*c);
|
||||
}
|
||||
|
||||
/* Assess how many bytes the given (multibyte) character occupies. Return -1
|
||||
* if the byte sequence is invalid, and return the number of bytes minus 8
|
||||
* when it encodes an invalid codepoint. Also, in the second parameter,
|
||||
* return the number of columns that the character occupies. */
|
||||
int length_of_char(const char *c, int *width)
|
||||
{
|
||||
assert(c != NULL && crep != NULL && crep_len != NULL);
|
||||
assert(c != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
wchar_t wc;
|
||||
int charlen = mbtowc(&wc, c, MB_CUR_MAX);
|
||||
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
|
||||
/* If the sequence is invalid... */
|
||||
if (charlen < 0) {
|
||||
mbtowc_reset();
|
||||
*crep_len = bad_mbchar_len;
|
||||
strncpy(crep, bad_mbchar, *crep_len);
|
||||
} else {
|
||||
*crep_len = wctomb(crep, control_wrep(wc));
|
||||
|
||||
if (*crep_len < 0) {
|
||||
wctomb_reset();
|
||||
*crep_len = 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
*crep_len = 1;
|
||||
*crep = control_rep(*c);
|
||||
#ifdef ENABLE_UTF8
|
||||
}
|
||||
#endif
|
||||
|
||||
return crep;
|
||||
}
|
||||
|
||||
/* c is a multibyte non-control character. We return that multibyte
|
||||
* character. If crep is an invalid multibyte sequence, it will be
|
||||
* replaced with Unicode 0xFFFD (Replacement Character). */
|
||||
char *mbrep(const char *c, char *crep, int *crep_len)
|
||||
{
|
||||
assert(c != NULL && crep != NULL && crep_len != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
wchar_t wc;
|
||||
|
||||
/* Reject invalid Unicode characters. */
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) < 0 || !is_valid_unicode(wc)) {
|
||||
mbtowc_reset();
|
||||
*crep_len = bad_mbchar_len;
|
||||
strncpy(crep, bad_mbchar, *crep_len);
|
||||
} else {
|
||||
*crep_len = wctomb(crep, wc);
|
||||
|
||||
if (*crep_len < 0) {
|
||||
wctomb_reset();
|
||||
*crep_len = 0;
|
||||
}
|
||||
/* If the codepoint is invalid... */
|
||||
if (!is_valid_unicode(wc))
|
||||
return charlen - 8;
|
||||
else {
|
||||
*width = wcwidth(wc);
|
||||
/* If the codepoint is unassigned, assume a width of one. */
|
||||
if (*width < 0)
|
||||
*width = 1;
|
||||
return charlen;
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
*crep_len = 1;
|
||||
*crep = *c;
|
||||
#ifdef ENABLE_UTF8
|
||||
}
|
||||
#endif
|
||||
|
||||
return crep;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This function is equivalent to wcwidth() for multibyte characters. */
|
||||
@@ -333,15 +295,13 @@ int mbwidth(const char *c)
|
||||
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
|
||||
mbtowc_reset();
|
||||
wc = bad_wchar;
|
||||
return 1;
|
||||
}
|
||||
|
||||
width = wcwidth(wc);
|
||||
|
||||
if (width == -1) {
|
||||
wc = bad_wchar;
|
||||
width = wcwidth(wc);
|
||||
}
|
||||
if (width == -1)
|
||||
return 1;
|
||||
|
||||
return width;
|
||||
} else
|
||||
@@ -349,27 +309,25 @@ int mbwidth(const char *c)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return the maximum width in bytes of a multibyte character. */
|
||||
/* Return the maximum length (in bytes) of a character. */
|
||||
int mb_cur_max(void)
|
||||
{
|
||||
return
|
||||
#ifdef ENABLE_UTF8
|
||||
use_utf8 ? MB_CUR_MAX :
|
||||
if (use_utf8)
|
||||
return MB_CUR_MAX;
|
||||
else
|
||||
#endif
|
||||
1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Convert the Unicode value in chr to a multibyte character with the
|
||||
* same wide character value as chr, if possible. If the conversion
|
||||
* succeeds, return the (dynamically allocated) multibyte character and
|
||||
* its length. Otherwise, return an undefined (dynamically allocated)
|
||||
* multibyte character and a length of zero. */
|
||||
/* Convert the Unicode value in chr to a multibyte character, if possible.
|
||||
* If the conversion succeeds, return the (dynamically allocated) multibyte
|
||||
* character and its length. Otherwise, return an undefined (dynamically
|
||||
* allocated) multibyte character and a length of zero. */
|
||||
char *make_mbchar(long chr, int *chr_mb_len)
|
||||
{
|
||||
char *chr_mb;
|
||||
|
||||
assert(chr_mb_len != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
chr_mb = charalloc(MB_CUR_MAX);
|
||||
@@ -377,107 +335,88 @@ char *make_mbchar(long chr, int *chr_mb_len)
|
||||
|
||||
/* Reject invalid Unicode characters. */
|
||||
if (*chr_mb_len < 0 || !is_valid_unicode((wchar_t)chr)) {
|
||||
wctomb_reset();
|
||||
IGNORE_CALL_RESULT(wctomb(NULL, 0));
|
||||
*chr_mb_len = 0;
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
*chr_mb_len = 1;
|
||||
chr_mb = mallocstrncpy(NULL, (char *)&chr, 1);
|
||||
#ifdef ENABLE_UTF8
|
||||
}
|
||||
#endif
|
||||
|
||||
return chr_mb;
|
||||
}
|
||||
|
||||
/* Parse a multibyte character from buf. Return the number of bytes
|
||||
* used. If chr isn't NULL, store the multibyte character in it. If
|
||||
* col isn't NULL, store the new display width in it. If *buf is '\t',
|
||||
* we expect col to have the current display width. */
|
||||
* col isn't NULL, add the character's width (in columns) to it. */
|
||||
int parse_mbchar(const char *buf, char *chr, size_t *col)
|
||||
{
|
||||
int buf_mb_len;
|
||||
int length;
|
||||
|
||||
assert(buf != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
/* Get the number of bytes in the multibyte character. */
|
||||
buf_mb_len = mblen(buf, MB_CUR_MAX);
|
||||
length = mblen(buf, MB_CUR_MAX);
|
||||
|
||||
/* If buf contains an invalid multibyte character, only
|
||||
* interpret buf's first byte. */
|
||||
if (buf_mb_len < 0) {
|
||||
/* When the multibyte sequence is invalid, only take the first byte. */
|
||||
if (length <= 0) {
|
||||
IGNORE_CALL_RESULT(mblen(NULL, 0));
|
||||
buf_mb_len = 1;
|
||||
} else if (buf_mb_len == 0)
|
||||
buf_mb_len++;
|
||||
length = 1;
|
||||
}
|
||||
|
||||
/* Save the multibyte character in chr. */
|
||||
/* When requested, store the multibyte character in chr. */
|
||||
if (chr != NULL) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < buf_mb_len; i++)
|
||||
for (i = 0; i < length; i++)
|
||||
chr[i] = buf[i];
|
||||
}
|
||||
|
||||
/* Save the column width of the wide character in col. */
|
||||
/* When requested, add the width of the character to col. */
|
||||
if (col != NULL) {
|
||||
/* If we have a tab, get its width in columns using the
|
||||
/* If we have a tab, compute its width in columns based on the
|
||||
* current value of col. */
|
||||
if (*buf == '\t')
|
||||
*col += tabsize - *col % tabsize;
|
||||
/* If we have a control character, get its width using one
|
||||
* column for the "^" that will be displayed in front of it,
|
||||
* and the width in columns of its visible equivalent as
|
||||
* returned by control_mbrep(). */
|
||||
/* If we have a control character, it's two columns wide: one
|
||||
* column for the "^", and one for the visible character. */
|
||||
else if (is_cntrl_mbchar(buf)) {
|
||||
char *ctrl_buf_mb = charalloc(MB_CUR_MAX);
|
||||
int ctrl_buf_mb_len;
|
||||
|
||||
(*col)++;
|
||||
|
||||
ctrl_buf_mb = control_mbrep(buf, ctrl_buf_mb,
|
||||
&ctrl_buf_mb_len);
|
||||
|
||||
*col += mbwidth(ctrl_buf_mb);
|
||||
|
||||
free(ctrl_buf_mb);
|
||||
/* If we have a normal character, get its width in columns
|
||||
* normally. */
|
||||
*col += 2;
|
||||
/* If we have a normal character, get its width normally. */
|
||||
} else
|
||||
*col += mbwidth(buf);
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
/* Get the number of bytes in the byte character. */
|
||||
buf_mb_len = 1;
|
||||
{
|
||||
/* A byte character is one byte long. */
|
||||
length = 1;
|
||||
|
||||
/* Save the byte character in chr. */
|
||||
/* When requested, store the byte character in chr. */
|
||||
if (chr != NULL)
|
||||
*chr = *buf;
|
||||
|
||||
/* When requested, add the width of the character to col. */
|
||||
if (col != NULL) {
|
||||
/* If we have a tab, get its width in columns using the
|
||||
/* If we have a tab, compute its width in columns using the
|
||||
* current value of col. */
|
||||
if (*buf == '\t')
|
||||
*col += tabsize - *col % tabsize;
|
||||
/* If we have a control character, it's two columns wide:
|
||||
* one column for the "^" that will be displayed in front of
|
||||
* it, and one column for its visible equivalent as returned
|
||||
* by control_mbrep(). */
|
||||
/* If we have a control character, it's two columns wide: one
|
||||
* column for the "^", and one for the visible character. */
|
||||
else if (is_cntrl_char((unsigned char)*buf))
|
||||
*col += 2;
|
||||
/* If we have a normal character, it's one column wide. */
|
||||
else
|
||||
(*col)++;
|
||||
}
|
||||
#ifdef ENABLE_UTF8
|
||||
}
|
||||
#endif
|
||||
|
||||
return buf_mb_len;
|
||||
return length;
|
||||
}
|
||||
|
||||
/* Return the index in buf of the beginning of the multibyte character
|
||||
@@ -515,14 +454,14 @@ size_t move_mbright(const char *buf, size_t pos)
|
||||
/* This function is equivalent to strcasecmp(). */
|
||||
int nstrcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
return strncasecmp(s1, s2, (size_t)-1);
|
||||
return strncasecmp(s1, s2, HIGHEST_POSITIVE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function is equivalent to strcasecmp() for multibyte strings. */
|
||||
int mbstrcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
return mbstrncasecmp(s1, s2, (size_t)-1);
|
||||
return mbstrncasecmp(s1, s2, HIGHEST_POSITIVE);
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
@@ -532,8 +471,6 @@ int nstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
if (s1 == s2)
|
||||
return 0;
|
||||
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
|
||||
for (; *s1 != '\0' && *s2 != '\0' && n > 0; s1++, s2++, n--) {
|
||||
if (tolower(*s1) != tolower(*s2))
|
||||
break;
|
||||
@@ -543,53 +480,45 @@ int nstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function is equivalent to strncasecmp() for multibyte
|
||||
* strings. */
|
||||
/* This function is equivalent to strncasecmp() for multibyte strings. */
|
||||
int mbstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
char *s1_mb, *s2_mb;
|
||||
wchar_t ws1, ws2;
|
||||
wchar_t wc1, wc2;
|
||||
|
||||
if (s1 == s2)
|
||||
return 0;
|
||||
while (*s1 != '\0' && *s2 != '\0' && n > 0) {
|
||||
bool bad1 = FALSE, bad2 = FALSE;
|
||||
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
|
||||
s1_mb = charalloc(MB_CUR_MAX);
|
||||
s2_mb = charalloc(MB_CUR_MAX);
|
||||
|
||||
for (; *s1 != '\0' && *s2 != '\0' && n > 0; s1 +=
|
||||
move_mbright(s1, 0), s2 += move_mbright(s2, 0), n--) {
|
||||
bool bad_s1_mb = FALSE, bad_s2_mb = FALSE;
|
||||
int s1_mb_len, s2_mb_len;
|
||||
|
||||
s1_mb_len = parse_mbchar(s1, s1_mb, NULL);
|
||||
|
||||
if (mbtowc(&ws1, s1_mb, s1_mb_len) < 0) {
|
||||
if (mbtowc(&wc1, s1, MB_CUR_MAX) < 0) {
|
||||
mbtowc_reset();
|
||||
ws1 = (unsigned char)*s1_mb;
|
||||
bad_s1_mb = TRUE;
|
||||
bad1 = TRUE;
|
||||
}
|
||||
|
||||
s2_mb_len = parse_mbchar(s2, s2_mb, NULL);
|
||||
|
||||
if (mbtowc(&ws2, s2_mb, s2_mb_len) < 0) {
|
||||
if (mbtowc(&wc2, s2, MB_CUR_MAX) < 0) {
|
||||
mbtowc_reset();
|
||||
ws2 = (unsigned char)*s2_mb;
|
||||
bad_s2_mb = TRUE;
|
||||
bad2 = TRUE;
|
||||
}
|
||||
|
||||
if (bad_s1_mb != bad_s2_mb || towlower(ws1) !=
|
||||
towlower(ws2))
|
||||
break;
|
||||
if (bad1 || bad2) {
|
||||
if (*s1 != *s2)
|
||||
return (unsigned char)*s1 - (unsigned char)*s2;
|
||||
|
||||
if (bad1 != bad2)
|
||||
return (bad1 ? 1 : -1);
|
||||
} else {
|
||||
int difference = towlower(wc1) - towlower(wc2);
|
||||
|
||||
if (difference != 0)
|
||||
return difference;
|
||||
}
|
||||
|
||||
s1 += move_mbright(s1, 0);
|
||||
s2 += move_mbright(s2, 0);
|
||||
n--;
|
||||
}
|
||||
|
||||
free(s1_mb);
|
||||
free(s2_mb);
|
||||
|
||||
return (n > 0) ? towlower(ws1) - towlower(ws2) : 0;
|
||||
return (n > 0) ? ((unsigned char)*s1 - (unsigned char)*s2) : 0;
|
||||
} else
|
||||
#endif
|
||||
return strncasecmp(s1, s2, n);
|
||||
@@ -599,20 +528,18 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
/* This function is equivalent to strcasestr(). */
|
||||
char *nstrcasestr(const char *haystack, const char *needle)
|
||||
{
|
||||
size_t haystack_len, needle_len;
|
||||
|
||||
assert(haystack != NULL && needle != NULL);
|
||||
size_t needle_len;
|
||||
|
||||
if (*needle == '\0')
|
||||
return (char *)haystack;
|
||||
|
||||
haystack_len = strlen(haystack);
|
||||
needle_len = strlen(needle);
|
||||
|
||||
for (; *haystack != '\0' && haystack_len >= needle_len; haystack++,
|
||||
haystack_len--) {
|
||||
while (*haystack != '\0') {
|
||||
if (strncasecmp(haystack, needle, needle_len) == 0)
|
||||
return (char *)haystack;
|
||||
|
||||
haystack++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -624,21 +551,18 @@ char *mbstrcasestr(const char *haystack, const char *needle)
|
||||
{
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
size_t haystack_len, needle_len;
|
||||
|
||||
assert(haystack != NULL && needle != NULL);
|
||||
size_t needle_len;
|
||||
|
||||
if (*needle == '\0')
|
||||
return (char *)haystack;
|
||||
|
||||
haystack_len = mbstrlen(haystack);
|
||||
needle_len = mbstrlen(needle);
|
||||
|
||||
for (; *haystack != '\0' && haystack_len >= needle_len;
|
||||
haystack += move_mbright(haystack, 0), haystack_len--) {
|
||||
if (mbstrncasecmp(haystack, needle, needle_len) == 0 &&
|
||||
mblen(haystack, MB_CUR_MAX) > 0)
|
||||
while (*haystack != '\0') {
|
||||
if (mbstrncasecmp(haystack, needle, needle_len) == 0)
|
||||
return (char *)haystack;
|
||||
|
||||
haystack += move_mbright(haystack, 0);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -647,37 +571,32 @@ char *mbstrcasestr(const char *haystack, const char *needle)
|
||||
return (char *) strcasestr(haystack, needle);
|
||||
}
|
||||
|
||||
#if !defined(NANO_TINY) || !defined(DISABLE_TABCOMP)
|
||||
/* This function is equivalent to strstr(), except in that it scans the
|
||||
* string in reverse, starting at rev_start. */
|
||||
char *revstrstr(const char *haystack, const char *needle, const char
|
||||
*rev_start)
|
||||
char *revstrstr(const char *haystack, const char *needle,
|
||||
const char *pointer)
|
||||
{
|
||||
size_t rev_start_len, needle_len;
|
||||
size_t needle_len = strlen(needle);
|
||||
size_t tail_len = strlen(pointer);
|
||||
|
||||
assert(haystack != NULL && needle != NULL && rev_start != NULL);
|
||||
|
||||
if (*needle == '\0')
|
||||
return (char *)rev_start;
|
||||
|
||||
needle_len = strlen(needle);
|
||||
if (needle_len == 0)
|
||||
return (char *)pointer;
|
||||
|
||||
if (strlen(haystack) < needle_len)
|
||||
return NULL;
|
||||
|
||||
rev_start_len = strlen(rev_start);
|
||||
if (tail_len < needle_len)
|
||||
pointer += tail_len - needle_len;
|
||||
|
||||
for (; rev_start >= haystack; rev_start--, rev_start_len++) {
|
||||
if (rev_start_len >= needle_len && strncmp(rev_start, needle,
|
||||
needle_len) == 0)
|
||||
return (char *)rev_start;
|
||||
while (pointer >= haystack) {
|
||||
if (strncmp(pointer, needle, needle_len) == 0)
|
||||
return (char *)pointer;
|
||||
pointer--;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif /* !NANO_TINY || !DISABLE_TABCOMP */
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* This function is equivalent to strcasestr(), except in that it scans
|
||||
* the string in reverse, starting at rev_start. */
|
||||
char *revstrcasestr(const char *haystack, const char *needle, const char
|
||||
@@ -685,8 +604,6 @@ char *revstrcasestr(const char *haystack, const char *needle, const char
|
||||
{
|
||||
size_t rev_start_len, needle_len;
|
||||
|
||||
assert(haystack != NULL && needle != NULL && rev_start != NULL);
|
||||
|
||||
if (*needle == '\0')
|
||||
return (char *)rev_start;
|
||||
|
||||
@@ -707,18 +624,14 @@ char *revstrcasestr(const char *haystack, const char *needle, const char
|
||||
}
|
||||
|
||||
/* This function is equivalent to strcasestr() for multibyte strings,
|
||||
* except in that it scans the string in reverse, starting at
|
||||
* rev_start. */
|
||||
* except in that it scans the string in reverse, starting at rev_start. */
|
||||
char *mbrevstrcasestr(const char *haystack, const char *needle, const
|
||||
char *rev_start)
|
||||
{
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
bool begin_line = FALSE;
|
||||
size_t rev_start_len, needle_len;
|
||||
|
||||
assert(haystack != NULL && needle != NULL && rev_start != NULL);
|
||||
|
||||
if (*needle == '\0')
|
||||
return (char *)rev_start;
|
||||
|
||||
@@ -729,27 +642,22 @@ char *mbrevstrcasestr(const char *haystack, const char *needle, const
|
||||
|
||||
rev_start_len = mbstrlen(rev_start);
|
||||
|
||||
while (!begin_line) {
|
||||
while (TRUE) {
|
||||
if (rev_start_len >= needle_len &&
|
||||
mbstrncasecmp(rev_start, needle, needle_len) == 0 &&
|
||||
mblen(rev_start, MB_CUR_MAX) > 0)
|
||||
mbstrncasecmp(rev_start, needle, needle_len) == 0)
|
||||
return (char *)rev_start;
|
||||
|
||||
/* If we've reached the head of the haystack, we found nothing. */
|
||||
if (rev_start == haystack)
|
||||
begin_line = TRUE;
|
||||
else {
|
||||
rev_start = haystack + move_mbleft(haystack, rev_start -
|
||||
haystack);
|
||||
rev_start_len++;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
rev_start = haystack + move_mbleft(haystack, rev_start - haystack);
|
||||
rev_start_len++;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
return revstrcasestr(haystack, needle, rev_start);
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* This function is equivalent to strlen() for multibyte strings. */
|
||||
size_t mbstrlen(const char *s)
|
||||
@@ -763,8 +671,6 @@ size_t nstrnlen(const char *s, size_t maxlen)
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
assert(s != NULL);
|
||||
|
||||
for (; *s != '\0' && maxlen > 0; s++, maxlen--, n++)
|
||||
;
|
||||
|
||||
@@ -775,8 +681,6 @@ size_t nstrnlen(const char *s, size_t maxlen)
|
||||
/* This function is equivalent to strnlen() for multibyte strings. */
|
||||
size_t mbstrnlen(const char *s, size_t maxlen)
|
||||
{
|
||||
assert(s != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
size_t n = 0;
|
||||
@@ -800,7 +704,7 @@ char *mbstrchr(const char *s, const char *c)
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
bool bad_s_mb = FALSE, bad_c_mb = FALSE;
|
||||
char *s_mb = charalloc(MB_CUR_MAX);
|
||||
char symbol[MB_CUR_MAX];
|
||||
const char *q = s;
|
||||
wchar_t ws, wc;
|
||||
|
||||
@@ -811,9 +715,9 @@ char *mbstrchr(const char *s, const char *c)
|
||||
}
|
||||
|
||||
while (*s != '\0') {
|
||||
int s_mb_len = parse_mbchar(s, s_mb, NULL);
|
||||
int sym_len = parse_mbchar(s, symbol, NULL);
|
||||
|
||||
if (mbtowc(&ws, s_mb, s_mb_len) < 0) {
|
||||
if (mbtowc(&ws, symbol, sym_len) < 0) {
|
||||
mbtowc_reset();
|
||||
ws = (unsigned char)*s;
|
||||
bad_s_mb = TRUE;
|
||||
@@ -822,12 +726,10 @@ char *mbstrchr(const char *s, const char *c)
|
||||
if (bad_s_mb == bad_c_mb && ws == wc)
|
||||
break;
|
||||
|
||||
s += s_mb_len;
|
||||
q += s_mb_len;
|
||||
s += sym_len;
|
||||
q += sym_len;
|
||||
}
|
||||
|
||||
free(s_mb);
|
||||
|
||||
if (*s == '\0')
|
||||
q = NULL;
|
||||
|
||||
@@ -842,8 +744,6 @@ char *mbstrchr(const char *s, const char *c)
|
||||
/* This function is equivalent to strpbrk() for multibyte strings. */
|
||||
char *mbstrpbrk(const char *s, const char *accept)
|
||||
{
|
||||
assert(s != NULL && accept != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
for (; *s != '\0'; s += move_mbright(s, 0)) {
|
||||
@@ -864,11 +764,14 @@ char *revstrpbrk(const char *s, const char *accept, const char
|
||||
{
|
||||
assert(s != NULL && accept != NULL && rev_start != NULL);
|
||||
|
||||
for (; rev_start >= s; rev_start--) {
|
||||
const char *q = (*rev_start == '\0') ? NULL : strchr(accept,
|
||||
*rev_start);
|
||||
if (*rev_start == '\0') {
|
||||
if (rev_start == s)
|
||||
return NULL;
|
||||
rev_start--;
|
||||
}
|
||||
|
||||
if (q != NULL)
|
||||
for (; rev_start >= s; rev_start--) {
|
||||
if (strchr(accept, *rev_start) != NULL)
|
||||
return (char *)rev_start;
|
||||
}
|
||||
|
||||
@@ -876,8 +779,7 @@ char *revstrpbrk(const char *s, const char *accept, const char
|
||||
}
|
||||
|
||||
/* This function is equivalent to strpbrk() for multibyte strings,
|
||||
* except in that it scans the string in reverse, starting at
|
||||
* rev_start. */
|
||||
* except in that it scans the string in reverse, starting at rev_start. */
|
||||
char *mbrevstrpbrk(const char *s, const char *accept, const char
|
||||
*rev_start)
|
||||
{
|
||||
@@ -885,22 +787,22 @@ char *mbrevstrpbrk(const char *s, const char *accept, const char
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
bool begin_line = FALSE;
|
||||
|
||||
while (!begin_line) {
|
||||
const char *q = (*rev_start == '\0') ? NULL :
|
||||
mbstrchr(accept, rev_start);
|
||||
|
||||
if (q != NULL)
|
||||
return (char *)rev_start;
|
||||
|
||||
if (*rev_start == '\0') {
|
||||
if (rev_start == s)
|
||||
begin_line = TRUE;
|
||||
else
|
||||
rev_start = s + move_mbleft(s, rev_start - s);
|
||||
return NULL;
|
||||
rev_start = s + move_mbleft(s, rev_start - s);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
while (TRUE) {
|
||||
if (mbstrchr(accept, rev_start) != NULL)
|
||||
return (char *)rev_start;
|
||||
|
||||
/* If we've reached the head of the string, we found nothing. */
|
||||
if (rev_start == s)
|
||||
return NULL;
|
||||
|
||||
rev_start = s + move_mbleft(s, rev_start - s);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
return revstrpbrk(s, accept, rev_start);
|
||||
@@ -912,8 +814,6 @@ char *mbrevstrpbrk(const char *s, const char *accept, const char
|
||||
* and FALSE otherwise. */
|
||||
bool has_blank_chars(const char *s)
|
||||
{
|
||||
assert(s != NULL);
|
||||
|
||||
for (; *s != '\0'; s++) {
|
||||
if (isblank(*s))
|
||||
return TRUE;
|
||||
@@ -926,25 +826,18 @@ bool has_blank_chars(const char *s)
|
||||
* multibyte characters, and FALSE otherwise. */
|
||||
bool has_blank_mbchars(const char *s)
|
||||
{
|
||||
assert(s != NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
bool retval = FALSE;
|
||||
char *chr_mb = charalloc(MB_CUR_MAX);
|
||||
char symbol[MB_CUR_MAX];
|
||||
|
||||
for (; *s != '\0'; s += move_mbright(s, 0)) {
|
||||
parse_mbchar(s, chr_mb, NULL);
|
||||
parse_mbchar(s, symbol, NULL);
|
||||
|
||||
if (is_blank_mbchar(chr_mb)) {
|
||||
retval = TRUE;
|
||||
break;
|
||||
}
|
||||
if (is_blank_mbchar(symbol))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
free(chr_mb);
|
||||
|
||||
return retval;
|
||||
return FALSE;
|
||||
} else
|
||||
#endif
|
||||
return has_blank_chars(s);
|
||||
@@ -955,9 +848,10 @@ bool has_blank_mbchars(const char *s)
|
||||
/* Return TRUE if wc is valid Unicode, and FALSE otherwise. */
|
||||
bool is_valid_unicode(wchar_t wc)
|
||||
{
|
||||
return ((0 <= wc && wc <= 0x10FFFF) && (wc <= 0xD7FF || 0xE000 <=
|
||||
wc) && (wc <= 0xFDCF || 0xFDF0 <= wc) && ((wc & 0xFFFF) <=
|
||||
0xFFFD));
|
||||
return ((0 <= wc && wc <= 0xD7FF) ||
|
||||
(0xE000 <= wc && wc <= 0xFDCF) ||
|
||||
(0xFDF0 <= wc && wc <= 0xFFFD) ||
|
||||
(0xFFFF < wc && wc <= 0x10FFFF && (wc & 0xFFFF) <= 0xFFFD));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -966,12 +860,11 @@ bool is_valid_unicode(wchar_t wc)
|
||||
* is, and FALSE otherwise. */
|
||||
bool is_valid_mbstring(const char *s)
|
||||
{
|
||||
assert(s != NULL);
|
||||
|
||||
return
|
||||
#ifdef ENABLE_UTF8
|
||||
use_utf8 ? (mbstowcs(NULL, s, 0) != (size_t)-1) :
|
||||
if (use_utf8)
|
||||
return (mbstowcs(NULL, s, 0) != (size_t)-1);
|
||||
else
|
||||
#endif
|
||||
TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* !DISABLE_NANORC */
|
||||
|
||||
572
src/color.c
572
src/color.c
@@ -1,23 +1,22 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* color.c *
|
||||
* color.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, *
|
||||
* 2010, 2011, 2013, 2014, 2015 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* Copyright (C) 2014, 2015, 2016, 2017 Benno Schulenberg *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -39,7 +38,7 @@
|
||||
* for the colors in each syntax. */
|
||||
void set_colorpairs(void)
|
||||
{
|
||||
const syntaxtype *this_syntax = syntaxes;
|
||||
const syntaxtype *sint;
|
||||
bool using_defaults = FALSE;
|
||||
short foreground, background;
|
||||
size_t i;
|
||||
@@ -63,15 +62,14 @@ void set_colorpairs(void)
|
||||
if (background == -1 && !using_defaults)
|
||||
background = COLOR_BLACK;
|
||||
init_pair(i + 1, foreground, background);
|
||||
interface_color_pair[i].bright = bright;
|
||||
interface_color_pair[i].pairnum = COLOR_PAIR(i + 1);
|
||||
interface_color_pair[i] =
|
||||
COLOR_PAIR(i + 1) | (bright ? A_BOLD : A_NORMAL);
|
||||
}
|
||||
else {
|
||||
interface_color_pair[i].bright = FALSE;
|
||||
if (i != FUNCTION_TAG)
|
||||
interface_color_pair[i].pairnum = hilite_attribute;
|
||||
interface_color_pair[i] = hilite_attribute;
|
||||
else
|
||||
interface_color_pair[i].pairnum = A_NORMAL;
|
||||
interface_color_pair[i] = A_NORMAL;
|
||||
}
|
||||
|
||||
free(specified_color_combo[i]);
|
||||
@@ -80,25 +78,25 @@ void set_colorpairs(void)
|
||||
|
||||
/* For each syntax, go through its list of colors and assign each
|
||||
* its pair number, giving identical color pairs the same number. */
|
||||
for (; this_syntax != NULL; this_syntax = this_syntax->next) {
|
||||
colortype *this_color = this_syntax->color;
|
||||
int clr_pair = NUMBER_OF_ELEMENTS + 1;
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
colortype *ink;
|
||||
int new_number = NUMBER_OF_ELEMENTS + 1;
|
||||
|
||||
for (; this_color != NULL; this_color = this_color->next) {
|
||||
const colortype *beforenow = this_syntax->color;
|
||||
for (ink = sint->color; ink != NULL; ink = ink->next) {
|
||||
const colortype *beforenow = sint->color;
|
||||
|
||||
while (beforenow != this_color &&
|
||||
(beforenow->fg != this_color->fg ||
|
||||
beforenow->bg != this_color->bg ||
|
||||
beforenow->bright != this_color->bright))
|
||||
while (beforenow != ink && (beforenow->fg != ink->fg ||
|
||||
beforenow->bg != ink->bg ||
|
||||
beforenow->bright != ink->bright))
|
||||
beforenow = beforenow->next;
|
||||
|
||||
if (beforenow != this_color)
|
||||
this_color->pairnum = beforenow->pairnum;
|
||||
else {
|
||||
this_color->pairnum = clr_pair;
|
||||
clr_pair++;
|
||||
}
|
||||
if (beforenow != ink)
|
||||
ink->pairnum = beforenow->pairnum;
|
||||
else
|
||||
ink->pairnum = new_number++;
|
||||
|
||||
ink->attributes = COLOR_PAIR(ink->pairnum) |
|
||||
(ink->bright ? A_BOLD : A_NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,12 +104,10 @@ void set_colorpairs(void)
|
||||
/* Initialize the color information. */
|
||||
void color_init(void)
|
||||
{
|
||||
colortype *tmpcolor = openfile->colorstrings;
|
||||
const colortype *ink;
|
||||
bool using_defaults = FALSE;
|
||||
short foreground, background;
|
||||
|
||||
assert(openfile != NULL);
|
||||
|
||||
/* If the terminal is not capable of colors, forget it. */
|
||||
if (!has_colors())
|
||||
return;
|
||||
@@ -122,9 +118,9 @@ void color_init(void)
|
||||
#endif
|
||||
|
||||
/* For each coloring expression, initialize the color pair. */
|
||||
for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) {
|
||||
foreground = tmpcolor->fg;
|
||||
background = tmpcolor->bg;
|
||||
for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) {
|
||||
foreground = ink->fg;
|
||||
background = ink->bg;
|
||||
|
||||
if (foreground == -1 && !using_defaults)
|
||||
foreground = COLOR_WHITE;
|
||||
@@ -132,323 +128,209 @@ void color_init(void)
|
||||
if (background == -1 && !using_defaults)
|
||||
background = COLOR_BLACK;
|
||||
|
||||
init_pair(tmpcolor->pairnum, foreground, background);
|
||||
init_pair(ink->pairnum, foreground, background);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "init_pair(): fg = %hd, bg = %hd\n", foreground, background);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* Clean up a regex we previously compiled. */
|
||||
void nfreeregex(regex_t **r)
|
||||
/* Try to match the given shibboleth string with one of the regexes in
|
||||
* the list starting at head. Return TRUE upon success. */
|
||||
bool found_in_list(regexlisttype *head, const char *shibboleth)
|
||||
{
|
||||
assert(r != NULL);
|
||||
regexlisttype *item;
|
||||
regex_t rgx;
|
||||
|
||||
regfree(*r);
|
||||
free(*r);
|
||||
*r = NULL;
|
||||
for (item = head; item != NULL; item = item->next) {
|
||||
regcomp(&rgx, fixbounds(item->full_regex), NANO_REG_EXTENDED);
|
||||
|
||||
if (regexec(&rgx, shibboleth, 0, NULL, 0) == 0) {
|
||||
regfree(&rgx);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
regfree(&rgx);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Update the color information based on the current filename. */
|
||||
/* Update the color information based on the current filename and content. */
|
||||
void color_update(void)
|
||||
{
|
||||
syntaxtype *tmpsyntax;
|
||||
syntaxtype *defsyntax = NULL;
|
||||
colortype *tmpcolor, *defcolor = NULL;
|
||||
regexlisttype *e;
|
||||
|
||||
assert(openfile != NULL);
|
||||
|
||||
openfile->syntax = NULL;
|
||||
openfile->colorstrings = NULL;
|
||||
syntaxtype *sint = NULL;
|
||||
colortype *ink;
|
||||
|
||||
/* If the rcfiles were not read, or contained no syntaxes, get out. */
|
||||
if (syntaxes == NULL)
|
||||
return;
|
||||
|
||||
/* If we specified a syntax override string, use it. */
|
||||
/* If we specified a syntax-override string, use it. */
|
||||
if (syntaxstr != NULL) {
|
||||
/* If the syntax override is "none", it's the same as not having
|
||||
* a syntax at all, so get out. */
|
||||
/* An override of "none" is like having no syntax at all. */
|
||||
if (strcmp(syntaxstr, "none") == 0)
|
||||
return;
|
||||
|
||||
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
|
||||
tmpsyntax = tmpsyntax->next) {
|
||||
if (strcmp(tmpsyntax->desc, syntaxstr) == 0) {
|
||||
openfile->syntax = tmpsyntax;
|
||||
openfile->colorstrings = tmpsyntax->color;
|
||||
}
|
||||
|
||||
if (openfile->colorstrings != NULL)
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (strcmp(sint->name, syntaxstr) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (openfile->colorstrings == NULL)
|
||||
statusbar(_("Unknown syntax name: %s"), syntaxstr);
|
||||
if (sint == NULL)
|
||||
statusline(ALERT, _("Unknown syntax name: %s"), syntaxstr);
|
||||
}
|
||||
|
||||
/* If we didn't specify a syntax override string, or if we did and
|
||||
* there was no syntax by that name, get the syntax based on the
|
||||
* file extension, then try the headerline, and then try magic. */
|
||||
if (openfile->colorstrings == NULL) {
|
||||
char *currentdir = getcwd(NULL, PATH_MAX + 1);
|
||||
/* If no syntax-override string was specified, or it didn't match,
|
||||
* try finding a syntax based on the filename (extension). */
|
||||
if (sint == NULL) {
|
||||
char *reserved = charalloc(PATH_MAX + 1);
|
||||
char *currentdir = getcwd(reserved, PATH_MAX + 1);
|
||||
char *joinednames = charalloc(PATH_MAX + 1);
|
||||
char *fullname = NULL;
|
||||
|
||||
if (currentdir != NULL) {
|
||||
if (currentdir == NULL)
|
||||
free(reserved);
|
||||
else {
|
||||
/* Concatenate the current working directory with the
|
||||
* specified filename, and canonicalize the result. */
|
||||
sprintf(joinednames, "%s/%s", currentdir, openfile->filename);
|
||||
fullname = realpath(joinednames, NULL);
|
||||
fullname = get_full_path(joinednames);
|
||||
free(currentdir);
|
||||
}
|
||||
|
||||
if (fullname == NULL)
|
||||
fullname = mallocstrcpy(fullname, openfile->filename);
|
||||
|
||||
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
|
||||
tmpsyntax = tmpsyntax->next) {
|
||||
|
||||
/* If this is the default syntax, it has no associated
|
||||
* extensions, which we've checked for elsewhere. Skip over
|
||||
* it here, but keep track of its color regexes. */
|
||||
if (strcmp(tmpsyntax->desc, "default") == 0) {
|
||||
defsyntax = tmpsyntax;
|
||||
defcolor = tmpsyntax->color;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (e = tmpsyntax->extensions; e != NULL; e = e->next) {
|
||||
bool not_compiled = (e->ext == NULL);
|
||||
|
||||
/* e->ext_regex has already been checked for validity
|
||||
* elsewhere. Compile its specified regex if we haven't
|
||||
* already. */
|
||||
if (not_compiled) {
|
||||
e->ext = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
regcomp(e->ext, fixbounds(e->ext_regex), REG_EXTENDED);
|
||||
}
|
||||
|
||||
/* Set colorstrings if we match the extension regex. */
|
||||
if (regexec(e->ext, fullname, 0, NULL, 0) == 0) {
|
||||
openfile->syntax = tmpsyntax;
|
||||
openfile->colorstrings = tmpsyntax->color;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Decompile e->ext_regex's specified regex if we aren't
|
||||
* going to use it. */
|
||||
if (not_compiled)
|
||||
nfreeregex(&e->ext);
|
||||
}
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (found_in_list(sint->extensions, fullname))
|
||||
break;
|
||||
}
|
||||
|
||||
free(joinednames);
|
||||
free(fullname);
|
||||
}
|
||||
|
||||
/* Check the headerline if the extension didn't match anything. */
|
||||
if (openfile->colorstrings == NULL) {
|
||||
/* If the filename didn't match anything, try the first line. */
|
||||
if (sint == NULL) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "No result from file extension, trying headerline...\n");
|
||||
fprintf(stderr, "No result from file extension, trying headerline...\n");
|
||||
#endif
|
||||
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
|
||||
tmpsyntax = tmpsyntax->next) {
|
||||
|
||||
for (e = tmpsyntax->headers; e != NULL; e = e->next) {
|
||||
bool not_compiled = (e->ext == NULL);
|
||||
|
||||
if (not_compiled) {
|
||||
e->ext = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
regcomp(e->ext, fixbounds(e->ext_regex), REG_EXTENDED);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Comparing header regex \"%s\" to fileage \"%s\"...\n",
|
||||
e->ext_regex, openfile->fileage->data);
|
||||
#endif
|
||||
/* Set colorstrings if we match the header-line regex. */
|
||||
if (regexec(e->ext, openfile->fileage->data, 0, NULL, 0) == 0) {
|
||||
openfile->syntax = tmpsyntax;
|
||||
openfile->colorstrings = tmpsyntax->color;
|
||||
break;
|
||||
}
|
||||
|
||||
if (not_compiled)
|
||||
nfreeregex(&e->ext);
|
||||
}
|
||||
}
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (found_in_list(sint->headers, openfile->fileage->data))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBMAGIC
|
||||
/* Check magic if we don't have an answer yet. */
|
||||
if (openfile->colorstrings == NULL) {
|
||||
struct stat fileinfo;
|
||||
magic_t cookie = NULL;
|
||||
const char *magicstring = NULL;
|
||||
/* If we still don't have an answer, try using magic. */
|
||||
if (sint == NULL) {
|
||||
struct stat fileinfo;
|
||||
magic_t cookie = NULL;
|
||||
const char *magicstring = NULL;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "No result from headerline either, trying libmagic...\n");
|
||||
fprintf(stderr, "No result from headerline either, trying libmagic...\n");
|
||||
#endif
|
||||
if (stat(openfile->filename, &fileinfo) == 0) {
|
||||
/* Open the magic database and get a diagnosis of the file. */
|
||||
cookie = magic_open(MAGIC_SYMLINK |
|
||||
if (stat(openfile->filename, &fileinfo) == 0) {
|
||||
/* Open the magic database and get a diagnosis of the file. */
|
||||
cookie = magic_open(MAGIC_SYMLINK |
|
||||
#ifdef DEBUG
|
||||
MAGIC_DEBUG | MAGIC_CHECK |
|
||||
#endif
|
||||
MAGIC_ERROR);
|
||||
if (cookie == NULL || magic_load(cookie, NULL) < 0)
|
||||
statusbar(_("magic_load() failed: %s"), strerror(errno));
|
||||
else {
|
||||
magicstring = magic_file(cookie, openfile->filename);
|
||||
if (magicstring == NULL) {
|
||||
statusbar(_("magic_file(%s) failed: %s"),
|
||||
openfile->filename, magic_error(cookie));
|
||||
}
|
||||
if (cookie == NULL || magic_load(cookie, NULL) < 0)
|
||||
statusline(ALERT, _("magic_load() failed: %s"), strerror(errno));
|
||||
else {
|
||||
magicstring = magic_file(cookie, openfile->filename);
|
||||
if (magicstring == NULL)
|
||||
statusline(ALERT, _("magic_file(%s) failed: %s"),
|
||||
openfile->filename, magic_error(cookie));
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Returned magic string is: %s\n", magicstring);
|
||||
fprintf(stderr, "Returned magic string is: %s\n", magicstring);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Now try and find a syntax that matches the magicstring. */
|
||||
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
|
||||
tmpsyntax = tmpsyntax->next) {
|
||||
|
||||
for (e = tmpsyntax->magics; e != NULL; e = e->next) {
|
||||
bool not_compiled = (e->ext == NULL);
|
||||
|
||||
if (not_compiled) {
|
||||
e->ext = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
regcomp(e->ext, fixbounds(e->ext_regex), REG_EXTENDED);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Matching regex \"%s\" against \"%s\"\n", e->ext_regex, magicstring);
|
||||
#endif
|
||||
/* Set colorstrings if we match the magic-string regex. */
|
||||
if (magicstring && regexec(e->ext, magicstring, 0, NULL, 0) == 0) {
|
||||
openfile->syntax = tmpsyntax;
|
||||
openfile->colorstrings = tmpsyntax->color;
|
||||
break;
|
||||
}
|
||||
|
||||
if (not_compiled)
|
||||
nfreeregex(&e->ext);
|
||||
}
|
||||
if (openfile->syntax != NULL)
|
||||
/* Now try and find a syntax that matches the magic string. */
|
||||
if (magicstring != NULL) {
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (found_in_list(sint->magics, magicstring))
|
||||
break;
|
||||
}
|
||||
if (stat(openfile->filename, &fileinfo) == 0)
|
||||
magic_close(cookie);
|
||||
}
|
||||
|
||||
if (stat(openfile->filename, &fileinfo) == 0)
|
||||
magic_close(cookie);
|
||||
}
|
||||
#endif /* HAVE_LIBMAGIC */
|
||||
|
||||
/* If nothing at all matched, see if there is a default syntax. */
|
||||
if (sint == NULL) {
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (strcmp(sint->name, "default") == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we didn't find any syntax yet, and we do have a default one,
|
||||
* use it. */
|
||||
if (openfile->colorstrings == NULL && defcolor != NULL) {
|
||||
openfile->syntax = defsyntax;
|
||||
openfile->colorstrings = defcolor;
|
||||
}
|
||||
openfile->syntax = sint;
|
||||
openfile->colorstrings = (sint == NULL ? NULL : sint->color);
|
||||
|
||||
for (tmpcolor = openfile->colorstrings; tmpcolor != NULL;
|
||||
tmpcolor = tmpcolor->next) {
|
||||
/* tmpcolor->start_regex and tmpcolor->end_regex have already
|
||||
* been checked for validity elsewhere. Compile their specified
|
||||
* regexes if we haven't already. */
|
||||
if (tmpcolor->start == NULL) {
|
||||
tmpcolor->start = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
regcomp(tmpcolor->start, fixbounds(tmpcolor->start_regex),
|
||||
REG_EXTENDED | (tmpcolor->icase ? REG_ICASE : 0));
|
||||
/* If a syntax was found, compile its specified regexes (which have
|
||||
* already been checked for validity when they were read in). */
|
||||
for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) {
|
||||
if (ink->start == NULL) {
|
||||
ink->start = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
regcomp(ink->start, fixbounds(ink->start_regex), ink->rex_flags);
|
||||
}
|
||||
|
||||
if (tmpcolor->end_regex != NULL && tmpcolor->end == NULL) {
|
||||
tmpcolor->end = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
regcomp(tmpcolor->end, fixbounds(tmpcolor->end_regex),
|
||||
REG_EXTENDED | (tmpcolor->icase ? REG_ICASE : 0));
|
||||
if (ink->end_regex != NULL && ink->end == NULL) {
|
||||
ink->end = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
regcomp(ink->end, fixbounds(ink->end_regex), ink->rex_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset the multiline coloring cache for one specific regex (given by
|
||||
* index) for lines that need reevaluation. */
|
||||
void reset_multis_for_id(filestruct *fileptr, int index)
|
||||
/* Determine whether the matches of multiline regexes are still the same,
|
||||
* and if not, schedule a screen refresh, so things will be repainted. */
|
||||
void check_the_multis(filestruct *line)
|
||||
{
|
||||
filestruct *row;
|
||||
|
||||
/* Reset the cache of earlier lines, as far back as needed. */
|
||||
for (row = fileptr->prev; row != NULL; row = row->prev) {
|
||||
alloc_multidata_if_needed(row);
|
||||
if (row->multidata[index] == CNONE)
|
||||
break;
|
||||
row->multidata[index] = -1;
|
||||
}
|
||||
for (; row != NULL; row = row->prev) {
|
||||
alloc_multidata_if_needed(row);
|
||||
if (row->multidata[index] != CNONE)
|
||||
break;
|
||||
row->multidata[index] = -1;
|
||||
}
|
||||
|
||||
/* Reset the cache of the current line. */
|
||||
fileptr->multidata[index] = -1;
|
||||
|
||||
/* Reset the cache of later lines, as far ahead as needed. */
|
||||
for (row = fileptr->next; row != NULL; row = row->next) {
|
||||
alloc_multidata_if_needed(row);
|
||||
if (row->multidata[index] == CNONE)
|
||||
break;
|
||||
row->multidata[index] = -1;
|
||||
}
|
||||
for (; row != NULL; row = row->next) {
|
||||
alloc_multidata_if_needed(row);
|
||||
if (row->multidata[index] != CNONE)
|
||||
break;
|
||||
row->multidata[index] = -1;
|
||||
}
|
||||
|
||||
edit_refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
/* Reset multi-line strings around the filestruct fileptr, trying to be
|
||||
* smart about stopping. Bool force means: reset everything regardless,
|
||||
* useful when we don't know how much screen state has changed. */
|
||||
void reset_multis(filestruct *fileptr, bool force)
|
||||
{
|
||||
int nobegin, noend;
|
||||
const colortype *ink;
|
||||
bool astart, anend;
|
||||
regmatch_t startmatch, endmatch;
|
||||
const colortype *tmpcolor = openfile->colorstrings;
|
||||
|
||||
/* If there is no syntax or no multiline regex, there is nothing to do. */
|
||||
if (openfile->syntax == NULL || openfile->syntax->nmultis == 0)
|
||||
return;
|
||||
|
||||
for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) {
|
||||
/* If it's not a multi-line regex, amscray. */
|
||||
if (tmpcolor->end == NULL)
|
||||
for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) {
|
||||
/* If it's not a multiline regex, skip. */
|
||||
if (ink->end == NULL)
|
||||
continue;
|
||||
|
||||
alloc_multidata_if_needed(fileptr);
|
||||
alloc_multidata_if_needed(line);
|
||||
|
||||
if (force == FALSE) {
|
||||
/* Check whether the multidata still matches the current situation. */
|
||||
nobegin = regexec(tmpcolor->start, fileptr->data, 1, &startmatch, 0);
|
||||
noend = regexec(tmpcolor->end, fileptr->data, 1, &endmatch, 0);
|
||||
if ((fileptr->multidata[tmpcolor->id] == CWHOLELINE ||
|
||||
fileptr->multidata[tmpcolor->id] == CNONE) &&
|
||||
nobegin && noend)
|
||||
astart = (regexec(ink->start, line->data, 1, &startmatch, 0) == 0);
|
||||
anend = (regexec(ink->end, line->data, 1, &endmatch, 0) == 0);
|
||||
|
||||
/* Check whether the multidata still matches the current situation. */
|
||||
if (line->multidata[ink->id] == CNONE ||
|
||||
line->multidata[ink->id] == CWHOLELINE) {
|
||||
if (!astart && !anend)
|
||||
continue;
|
||||
else if (fileptr->multidata[tmpcolor->id] == CSTARTENDHERE &&
|
||||
!nobegin && !noend && startmatch.rm_so < endmatch.rm_so)
|
||||
} else if (line->multidata[ink->id] == CSTARTENDHERE) {
|
||||
if (astart && anend && startmatch.rm_so < endmatch.rm_so)
|
||||
continue;
|
||||
else if (fileptr->multidata[tmpcolor->id] == CBEGINBEFORE &&
|
||||
nobegin && !noend)
|
||||
} else if (line->multidata[ink->id] == CBEGINBEFORE) {
|
||||
if (!astart && anend)
|
||||
continue;
|
||||
else if (fileptr->multidata[tmpcolor->id] == CENDAFTER &&
|
||||
!nobegin && noend)
|
||||
} else if (line->multidata[ink->id] == CENDAFTER) {
|
||||
if (astart && !anend)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If we got here, things have changed. */
|
||||
reset_multis_for_id(fileptr, tmpcolor->id);
|
||||
/* There is a mismatch, so something changed: repaint. */
|
||||
refresh_needed = TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,138 +347,94 @@ void alloc_multidata_if_needed(filestruct *fileptr)
|
||||
}
|
||||
}
|
||||
|
||||
/* Poll the keyboard every second to see if the user starts typing. */
|
||||
bool key_was_pressed(void)
|
||||
{
|
||||
static time_t last_time = 0;
|
||||
|
||||
if (time(NULL) != last_time) {
|
||||
last_time = time(NULL);
|
||||
return (wgetch(edit) != ERR);
|
||||
} else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Precalculate the multi-line start and end regex info so we can
|
||||
* speed up rendering (with any hope at all...). */
|
||||
void precalc_multicolorinfo(void)
|
||||
{
|
||||
const colortype *tmpcolor = openfile->colorstrings;
|
||||
const colortype *ink;
|
||||
regmatch_t startmatch, endmatch;
|
||||
filestruct *fileptr, *endptr;
|
||||
filestruct *line, *tailline;
|
||||
|
||||
if (openfile->colorstrings == NULL || ISSET(NO_COLOR_SYNTAX))
|
||||
return;
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Entering precalculation of multiline color info\n");
|
||||
fprintf(stderr, "Precalculating the multiline color info...\n");
|
||||
#endif
|
||||
/* Let us get keypresses to see if the user is trying to start
|
||||
* editing. Later we may want to throw up a statusbar message
|
||||
* before starting this if it takes too long to do this routine.
|
||||
* For now silently abort if they hit a key. */
|
||||
nodelay(edit, TRUE);
|
||||
|
||||
for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) {
|
||||
for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) {
|
||||
/* If this is not a multi-line regex, skip it. */
|
||||
if (tmpcolor->end == NULL)
|
||||
if (ink->end == NULL)
|
||||
continue;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Starting work on color id %d\n", tmpcolor->id);
|
||||
#endif
|
||||
|
||||
for (fileptr = openfile->fileage; fileptr != NULL; fileptr = fileptr->next) {
|
||||
int startx = 0, nostart = 0;
|
||||
for (line = openfile->fileage; line != NULL; line = line->next) {
|
||||
int index = 0;
|
||||
|
||||
if (key_was_pressed())
|
||||
goto precalc_cleanup;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "working on lineno %ld... ", (long)fileptr->lineno);
|
||||
#endif
|
||||
alloc_multidata_if_needed(fileptr);
|
||||
alloc_multidata_if_needed(line);
|
||||
/* Assume nothing applies until proven otherwise below. */
|
||||
line->multidata[ink->id] = CNONE;
|
||||
|
||||
while ((nostart = regexec(tmpcolor->start, &fileptr->data[startx],
|
||||
1, &startmatch, (startx == 0) ? 0 : REG_NOTBOL)) == 0) {
|
||||
/* Look for an end, and start marking how many lines are
|
||||
* encompassed, which should speed up rendering later. */
|
||||
startx += startmatch.rm_eo;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "start found at pos %lu... ", (unsigned long)startx);
|
||||
#endif
|
||||
/* Look first on this line for an end. */
|
||||
if (regexec(tmpcolor->end, &fileptr->data[startx], 1,
|
||||
&endmatch, (startx == 0) ? 0 : REG_NOTBOL) == 0) {
|
||||
startx += endmatch.rm_eo;
|
||||
/* Step ahead when both start and end are mere anchors. */
|
||||
/* For an unpaired start match, mark all remaining lines. */
|
||||
if (line->prev && line->prev->multidata[ink->id] == CWOULDBE) {
|
||||
line->multidata[ink->id] = CWOULDBE;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* When the line contains a start match, look for an end, and if
|
||||
* found, mark all the lines that are affected. */
|
||||
while (regexec(ink->start, line->data + index, 1,
|
||||
&startmatch, (index == 0) ? 0 : REG_NOTBOL) == 0) {
|
||||
/* Begin looking for an end match after the start match. */
|
||||
index += startmatch.rm_eo;
|
||||
|
||||
/* If there is an end match on this line, mark the line, but
|
||||
* continue looking for other starts after it. */
|
||||
if (regexec(ink->end, line->data + index, 1,
|
||||
&endmatch, (index == 0) ? 0 : REG_NOTBOL) == 0) {
|
||||
line->multidata[ink->id] = CSTARTENDHERE;
|
||||
index += endmatch.rm_eo;
|
||||
/* If both start and end are mere anchors, step ahead. */
|
||||
if (startmatch.rm_so == startmatch.rm_eo &&
|
||||
endmatch.rm_so == endmatch.rm_eo)
|
||||
startx += 1;
|
||||
fileptr->multidata[tmpcolor->id] = CSTARTENDHERE;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "end found on this line\n");
|
||||
#endif
|
||||
endmatch.rm_so == endmatch.rm_eo) {
|
||||
/* When at end-of-line, we're done. */
|
||||
if (line->data[index] == '\0')
|
||||
break;
|
||||
index = move_mbright(line->data, index);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Nice, we didn't find the end regex on this line. Let's start looking for it. */
|
||||
for (endptr = fileptr->next; endptr != NULL; endptr = endptr->next) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "\nadvancing to line %ld to find end... ", (long)endptr->lineno);
|
||||
#endif
|
||||
/* Check for interrupting keyboard input again. */
|
||||
if (key_was_pressed())
|
||||
goto precalc_cleanup;
|
||||
/* Look for an end match on later lines. */
|
||||
tailline = line->next;
|
||||
|
||||
if (regexec(tmpcolor->end, endptr->data, 1, &endmatch, 0) == 0)
|
||||
while (tailline != NULL) {
|
||||
if (regexec(ink->end, tailline->data, 1, &endmatch, 0) == 0)
|
||||
break;
|
||||
tailline = tailline->next;
|
||||
}
|
||||
|
||||
if (endptr == NULL) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "no end found, breaking out\n");
|
||||
#endif
|
||||
if (tailline == NULL) {
|
||||
line->multidata[ink->id] = CWOULDBE;
|
||||
break;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "end found\n");
|
||||
#endif
|
||||
|
||||
/* We found it, we found it, la la la la la. Mark all
|
||||
* the lines in between and the end properly. */
|
||||
fileptr->multidata[tmpcolor->id] = CENDAFTER;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "marking line %ld as CENDAFTER\n", (long)fileptr->lineno);
|
||||
#endif
|
||||
for (fileptr = fileptr->next; fileptr != endptr; fileptr = fileptr->next) {
|
||||
alloc_multidata_if_needed(fileptr);
|
||||
fileptr->multidata[tmpcolor->id] = CWHOLELINE;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "marking intermediary line %ld as CWHOLELINE\n", (long)fileptr->lineno);
|
||||
#endif
|
||||
line->multidata[ink->id] = CENDAFTER;
|
||||
|
||||
for (line = line->next; line != tailline; line = line->next) {
|
||||
alloc_multidata_if_needed(line);
|
||||
line->multidata[ink->id] = CWHOLELINE;
|
||||
}
|
||||
|
||||
alloc_multidata_if_needed(endptr);
|
||||
fileptr->multidata[tmpcolor->id] = CBEGINBEFORE;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "marking line %ld as CBEGINBEFORE\n", (long)fileptr->lineno);
|
||||
#endif
|
||||
/* Skip to the end point of the match. */
|
||||
startx = endmatch.rm_eo;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "jumping to line %ld pos %lu to continue\n", (long)fileptr->lineno, (unsigned long)startx);
|
||||
#endif
|
||||
}
|
||||
alloc_multidata_if_needed(tailline);
|
||||
tailline->multidata[ink->id] = CBEGINBEFORE;
|
||||
|
||||
if (nostart && startx == 0) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "no match\n");
|
||||
#endif
|
||||
fileptr->multidata[tmpcolor->id] = CNONE;
|
||||
continue;
|
||||
/* Begin looking for a new start after the end match. */
|
||||
index = endmatch.rm_eo;
|
||||
}
|
||||
}
|
||||
}
|
||||
precalc_cleanup:
|
||||
nodelay(edit, FALSE);
|
||||
}
|
||||
|
||||
#endif /* !DISABLE_COLOR */
|
||||
|
||||
144
src/cut.c
144
src/cut.c
@@ -1,23 +1,23 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* cut.c *
|
||||
* cut.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
|
||||
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* Copyright (C) 2014 Mark Majeres *
|
||||
* Copyright (C) 2016 Benno Schulenberg *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -49,10 +49,10 @@ inline bool keeping_cutbuffer(void)
|
||||
void cut_line(void)
|
||||
{
|
||||
if (openfile->current != openfile->filebot)
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, openfile->current, 0,
|
||||
extract_buffer(&cutbuffer, &cutbottom, openfile->current, 0,
|
||||
openfile->current->next, 0);
|
||||
else
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, openfile->current, 0,
|
||||
extract_buffer(&cutbuffer, &cutbottom, openfile->current, 0,
|
||||
openfile->current, strlen(openfile->current->data));
|
||||
openfile->placewewant = 0;
|
||||
}
|
||||
@@ -60,15 +60,15 @@ void cut_line(void)
|
||||
#ifndef NANO_TINY
|
||||
/* Move all currently marked text into the cutbuffer, and set the
|
||||
* current place we want to where the text used to start. */
|
||||
void cut_marked(void)
|
||||
void cut_marked(bool *right_side_up)
|
||||
{
|
||||
filestruct *top, *bot;
|
||||
size_t top_x, bot_x;
|
||||
|
||||
mark_order((const filestruct **)&top, &top_x,
|
||||
(const filestruct **)&bot, &bot_x, NULL);
|
||||
(const filestruct **)&bot, &bot_x, right_side_up);
|
||||
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, top, top_x, bot, bot_x);
|
||||
extract_buffer(&cutbuffer, &cutbottom, top, top_x, bot, bot_x);
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
|
||||
@@ -82,20 +82,18 @@ void cut_to_eol(void)
|
||||
{
|
||||
size_t data_len = strlen(openfile->current->data);
|
||||
|
||||
assert(openfile->current_x <= data_len);
|
||||
|
||||
if (openfile->current_x < data_len)
|
||||
/* If we're not at the end of the line, move all the text from
|
||||
* the current position up to it, not counting the newline at
|
||||
* the end, into the cutbuffer. */
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, openfile->current,
|
||||
extract_buffer(&cutbuffer, &cutbottom, openfile->current,
|
||||
openfile->current_x, openfile->current, data_len);
|
||||
else if (openfile->current != openfile->filebot) {
|
||||
/* If we're at the end of the line, and it isn't the last line
|
||||
* of the file, move all the text from the current position up
|
||||
* to the beginning of the next line, i.e. the newline at the
|
||||
* end, into the cutbuffer. */
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, openfile->current,
|
||||
extract_buffer(&cutbuffer, &cutbottom, openfile->current,
|
||||
openfile->current_x, openfile->current->next, 0);
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
@@ -105,7 +103,7 @@ void cut_to_eol(void)
|
||||
* file into the cutbuffer. */
|
||||
void cut_to_eof(void)
|
||||
{
|
||||
move_to_filestruct(&cutbuffer, &cutbottom,
|
||||
extract_buffer(&cutbuffer, &cutbottom,
|
||||
openfile->current, openfile->current_x,
|
||||
openfile->filebot, strlen(openfile->filebot->data));
|
||||
}
|
||||
@@ -115,13 +113,7 @@ void cut_to_eof(void)
|
||||
* copy_text is TRUE, copy the text back into the filestruct afterward.
|
||||
* If cut_till_eof is TRUE, move all text from the current cursor
|
||||
* position to the end of the file into the cutbuffer. */
|
||||
void do_cut_text(
|
||||
#ifndef NANO_TINY
|
||||
bool copy_text, bool cut_till_eof
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
)
|
||||
void do_cut_text(bool copy_text, bool cut_till_eof)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
filestruct *cb_save = NULL;
|
||||
@@ -130,46 +122,39 @@ void do_cut_text(
|
||||
/* The length of the string at the current end of the cutbuffer,
|
||||
* before we add text to it. */
|
||||
bool old_no_newlines = ISSET(NO_NEWLINES);
|
||||
bool right_side_up = TRUE;
|
||||
/* There *is* no region, *or* it is marked forward. */
|
||||
#endif
|
||||
size_t was_totsize = openfile->totsize;
|
||||
|
||||
assert(openfile->current != NULL && openfile->current->data != NULL);
|
||||
|
||||
/* If keep_cutbuffer is FALSE and the cutbuffer isn't empty, blow
|
||||
* away the text in the cutbuffer. */
|
||||
if (!keep_cutbuffer && cutbuffer != NULL) {
|
||||
/* If a chain of cuts was broken, empty the cutbuffer. */
|
||||
if (!keep_cutbuffer) {
|
||||
free_filestruct(cutbuffer);
|
||||
cutbuffer = NULL;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Blew away cutbuffer =)\n");
|
||||
#endif
|
||||
/* Indicate that future cuts should add to the cutbuffer. */
|
||||
keep_cutbuffer = TRUE;
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (copy_text) {
|
||||
/* If the cutbuffer isn't empty, remember where it currently ends. */
|
||||
if (cutbuffer != NULL) {
|
||||
/* If the cutbuffer isn't empty, save where it currently
|
||||
* ends. This is where we'll add the new text. */
|
||||
cb_save = cutbottom;
|
||||
cb_save_len = strlen(cutbottom->data);
|
||||
}
|
||||
|
||||
/* Set NO_NEWLINES to TRUE, so that we don't disturb the last
|
||||
* line of the file when moving text to the cutbuffer. */
|
||||
/* Don't add a magicline when moving text to the cutbuffer. */
|
||||
SET(NO_NEWLINES);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Ensure that the text we're going to move into the cutbuffer will
|
||||
* be added to the text already there, instead of replacing it. */
|
||||
keep_cutbuffer = TRUE;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (cut_till_eof) {
|
||||
/* Move all text up to the end of the file into the cutbuffer. */
|
||||
cut_to_eof();
|
||||
} else if (openfile->mark_set) {
|
||||
/* Move the marked text to the cutbuffer, and turn the mark off. */
|
||||
cut_marked();
|
||||
cut_marked(&right_side_up);
|
||||
openfile->mark_set = FALSE;
|
||||
} else if (ISSET(CUT_TO_END))
|
||||
/* Move all text up to the end of the line into the cutbuffer. */
|
||||
@@ -181,35 +166,35 @@ void do_cut_text(
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (copy_text) {
|
||||
/* Copy the text in the cutbuffer, starting at its saved end if
|
||||
* there is one, back into the filestruct. This effectively
|
||||
* uncuts the text we just cut without marking the file as
|
||||
* modified. */
|
||||
/* Copy the text that is in the cutbuffer (starting at its saved end,
|
||||
* if there is one) back into the current buffer. This effectively
|
||||
* uncuts the text we just cut. */
|
||||
if (cutbuffer != NULL) {
|
||||
if (cb_save != NULL) {
|
||||
cb_save->data += cb_save_len;
|
||||
copy_from_filestruct(cb_save);
|
||||
copy_from_buffer(cb_save);
|
||||
cb_save->data -= cb_save_len;
|
||||
} else
|
||||
copy_from_filestruct(cutbuffer);
|
||||
copy_from_buffer(cutbuffer);
|
||||
|
||||
/* Set the current place we want to where the text from the
|
||||
* cutbuffer ends. */
|
||||
openfile->placewewant = xplustabs();
|
||||
/* If the copied region was marked forward, put the new desired
|
||||
* x position at its end; otherwise, leave it at its beginning. */
|
||||
if (right_side_up)
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
|
||||
/* Set NO_NEWLINES back to what it was before, since we're done
|
||||
* disturbing the text. */
|
||||
/* Restore the magicline behavior now that we're done fiddling. */
|
||||
if (!old_no_newlines)
|
||||
UNSET(NO_NEWLINES);
|
||||
} else
|
||||
#endif /* !NANO_TINY */
|
||||
/* Only set the modification flag if actually something was cut. */
|
||||
if (openfile->totsize != was_totsize)
|
||||
set_modified();
|
||||
|
||||
edit_refresh_needed = TRUE;
|
||||
refresh_needed = TRUE;
|
||||
|
||||
#ifndef DISABLE_COLOR
|
||||
reset_multis(openfile->current, FALSE);
|
||||
check_the_multis(openfile->current);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -222,10 +207,10 @@ void do_cut_text_void(void)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
add_undo(CUT);
|
||||
#endif
|
||||
do_cut_text(FALSE, FALSE);
|
||||
#ifndef NANO_TINY
|
||||
update_undo(CUT);
|
||||
#else
|
||||
do_cut_text();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -238,6 +223,11 @@ void do_copy_text(void)
|
||||
static struct filestruct *next_contiguous_line = NULL;
|
||||
bool mark_set = openfile->mark_set;
|
||||
|
||||
/* Remember the current viewport and cursor position. */
|
||||
ssize_t is_edittop_lineno = openfile->edittop->lineno;
|
||||
ssize_t is_current_lineno = openfile->current->lineno;
|
||||
size_t is_current_x = openfile->current_x;
|
||||
|
||||
if (mark_set || openfile->current != next_contiguous_line)
|
||||
cutbuffer_reset();
|
||||
|
||||
@@ -245,6 +235,13 @@ void do_copy_text(void)
|
||||
|
||||
/* If the mark was set, blow away the cutbuffer on the next copy. */
|
||||
next_contiguous_line = (mark_set ? NULL : openfile->current);
|
||||
|
||||
if (mark_set) {
|
||||
/* Restore the viewport and cursor position. */
|
||||
openfile->edittop = fsfromline(is_edittop_lineno);
|
||||
openfile->current = fsfromline(is_current_lineno);
|
||||
openfile->current_x = is_current_x;
|
||||
}
|
||||
}
|
||||
|
||||
/* Cut from the current cursor position to the end of the file. */
|
||||
@@ -259,9 +256,9 @@ void do_cut_till_eof(void)
|
||||
/* Copy text from the cutbuffer into the current filestruct. */
|
||||
void do_uncut_text(void)
|
||||
{
|
||||
assert(openfile->current != NULL && openfile->current->data != NULL);
|
||||
ssize_t was_lineno = openfile->current->lineno;
|
||||
|
||||
/* If the cutbuffer is empty, get out. */
|
||||
/* If the cutbuffer is empty, there is nothing to do. */
|
||||
if (cutbuffer == NULL)
|
||||
return;
|
||||
|
||||
@@ -271,23 +268,30 @@ void do_uncut_text(void)
|
||||
|
||||
/* Add a copy of the text in the cutbuffer to the current filestruct
|
||||
* at the current cursor position. */
|
||||
copy_from_filestruct(cutbuffer);
|
||||
copy_from_buffer(cutbuffer);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
update_undo(PASTE);
|
||||
#endif
|
||||
|
||||
/* Set the current place we want to where the text from the
|
||||
* cutbuffer ends. */
|
||||
if (openfile->current->lineno - was_lineno < editwinrows)
|
||||
focusing = FALSE;
|
||||
|
||||
/* Set the desired x position to where the pasted text ends. */
|
||||
openfile->placewewant = xplustabs();
|
||||
|
||||
/* Mark the file as modified. */
|
||||
set_modified();
|
||||
|
||||
edit_refresh_needed = TRUE;
|
||||
/* Update the cursor position to account for the inserted lines. */
|
||||
reset_cursor();
|
||||
|
||||
ensure_line_is_visible();
|
||||
|
||||
refresh_needed = TRUE;
|
||||
|
||||
#ifndef DISABLE_COLOR
|
||||
reset_multis(openfile->current, FALSE);
|
||||
check_the_multis(openfile->current);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
1539
src/files.c
1539
src/files.c
File diff suppressed because it is too large
Load Diff
828
src/global.c
828
src/global.c
File diff suppressed because it is too large
Load Diff
70
src/help.c
70
src/help.c
@@ -1,23 +1,22 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* help.c *
|
||||
* help.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, *
|
||||
* 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* Copyright (C) 2014, 2015, 2016 Benno Schulenberg *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -56,6 +55,7 @@ void do_help(void)
|
||||
functionptrtype func;
|
||||
/* The function of the key the user typed in. */
|
||||
|
||||
/* Don't show a cursor in the help screen. */
|
||||
curs_set(0);
|
||||
blank_edit();
|
||||
blank_statusbar();
|
||||
@@ -118,12 +118,13 @@ void do_help(void)
|
||||
|
||||
old_line = line;
|
||||
|
||||
lastmessage = HUSH;
|
||||
|
||||
kbinput = get_kbinput(edit);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH) {
|
||||
kbinput = ERR;
|
||||
curs_set(0);
|
||||
continue; /* Redraw the screen. */
|
||||
}
|
||||
#endif
|
||||
@@ -140,6 +141,12 @@ void do_help(void)
|
||||
|
||||
if (func == total_refresh) {
|
||||
total_redraw();
|
||||
} else if (func == do_up_void) {
|
||||
if (line > 0)
|
||||
line--;
|
||||
} else if (func == do_down_void) {
|
||||
if (line + (editwinrows - 1) < last_line)
|
||||
line++;
|
||||
} else if (func == do_page_up) {
|
||||
if (line > editwinrows - 2)
|
||||
line -= editwinrows - 2;
|
||||
@@ -148,12 +155,6 @@ void do_help(void)
|
||||
} else if (func == do_page_down) {
|
||||
if (line + (editwinrows - 1) < last_line)
|
||||
line += editwinrows - 2;
|
||||
} else if (func == do_up_void) {
|
||||
if (line > 0)
|
||||
line--;
|
||||
} else if (func == do_down_void) {
|
||||
if (line + (editwinrows - 1) < last_line)
|
||||
line++;
|
||||
} else if (func == do_first_line) {
|
||||
line = 0;
|
||||
} else if (func == do_last_line) {
|
||||
@@ -162,7 +163,8 @@ void do_help(void)
|
||||
} else if (func == do_exit) {
|
||||
/* Exit from the help viewer. */
|
||||
break;
|
||||
}
|
||||
} else
|
||||
unbound_key(kbinput);
|
||||
}
|
||||
|
||||
if (old_no_help) {
|
||||
@@ -174,8 +176,6 @@ void do_help(void)
|
||||
} else
|
||||
bottombars(oldmenu);
|
||||
|
||||
curs_set(1);
|
||||
|
||||
#ifndef DISABLE_BROWSER
|
||||
if (oldmenu == MBROWSER || oldmenu == MWHEREISFILE || oldmenu == MGOTODIR)
|
||||
browser_refresh();
|
||||
@@ -339,14 +339,12 @@ void help_init(void)
|
||||
"the third line from the bottom and shows important "
|
||||
"messages. ");
|
||||
htx[1] = N_("The bottom two lines show the most commonly used "
|
||||
"shortcuts in the editor.\n\n The notation for "
|
||||
"shortcuts is as follows: Control-key sequences are "
|
||||
"notated with a caret (^) symbol and can be entered "
|
||||
"either by using the Control (Ctrl) key or pressing "
|
||||
"the Escape (Esc) key twice. Escape-key sequences are "
|
||||
"notated with the Meta (M-) symbol and can be entered "
|
||||
"using either the Esc, Alt, or Meta key depending on "
|
||||
"your keyboard setup. ");
|
||||
"shortcuts in the editor.\n\n Shortcuts are written as "
|
||||
"follows: Control-key sequences are notated with a '^' "
|
||||
"and can be entered either by using the Ctrl key or "
|
||||
"pressing the Esc key twice. Meta-key sequences are "
|
||||
"notated with 'M-' and can be entered using either the "
|
||||
"Alt, Cmd, or Esc key, depending on your keyboard setup. ");
|
||||
htx[2] = N_("Also, pressing Esc twice and then typing a "
|
||||
"three-digit decimal number from 000 to 255 will enter "
|
||||
"the character with the corresponding value. The "
|
||||
@@ -421,7 +419,11 @@ void help_init(void)
|
||||
* but allow it to spill into the second, for "M-Space". */
|
||||
if (scsfound == 1) {
|
||||
sprintf(ptr, "%s ", s->keystr);
|
||||
ptr += 6;
|
||||
/* Unicode arrows take three bytes instead of one. */
|
||||
if (s->keystr[1] == '\xE2')
|
||||
ptr += 8;
|
||||
else
|
||||
ptr += 6;
|
||||
} else {
|
||||
ptr += sprintf(ptr, "(%s)\t", s->keystr);
|
||||
break;
|
||||
@@ -448,7 +450,7 @@ void help_init(void)
|
||||
|
||||
/* First see how many toggles there are. */
|
||||
for (s = sclist; s != NULL; s = s->next)
|
||||
maximum = (s->toggle && s->ordinal > maximum) ? s->ordinal : maximum;
|
||||
maximum = (s->toggle && s->ordinal > maximum) ? s->ordinal : maximum;
|
||||
|
||||
/* Now show them in the original order. */
|
||||
while (counter < maximum) {
|
||||
@@ -456,7 +458,7 @@ void help_init(void)
|
||||
for (s = sclist; s != NULL; s = s->next)
|
||||
if (s->toggle && s->ordinal == counter) {
|
||||
ptr += sprintf(ptr, "%s\t\t%s %s\n", (s->menus == MMAIN ? s->keystr : ""),
|
||||
_(flagtostr(s->toggle)), _("enable/disable"));
|
||||
_(flagtostr(s->toggle)), _("enable/disable"));
|
||||
if (s->toggle == NO_COLOR_SYNTAX || s->toggle == TABS_TO_SPACES)
|
||||
ptr += sprintf(ptr, "\n");
|
||||
break;
|
||||
|
||||
484
src/move.c
484
src/move.c
@@ -1,23 +1,22 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* move.c *
|
||||
* move.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
|
||||
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* Copyright (C) 2014, 2015, 2016 Benno Schulenberg *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -29,11 +28,11 @@
|
||||
/* Move to the first line of the file. */
|
||||
void do_first_line(void)
|
||||
{
|
||||
openfile->current = openfile->edittop = openfile->fileage;
|
||||
openfile->current = openfile->fileage;
|
||||
openfile->current_x = 0;
|
||||
openfile->placewewant = 0;
|
||||
|
||||
edit_refresh_needed = TRUE;
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
/* Move to the last line of the file. */
|
||||
@@ -42,46 +41,44 @@ void do_last_line(void)
|
||||
openfile->current = openfile->filebot;
|
||||
openfile->current_x = strlen(openfile->filebot->data);
|
||||
openfile->placewewant = xplustabs();
|
||||
openfile->current_y = editwinrows - 1;
|
||||
|
||||
edit_refresh_needed = TRUE;
|
||||
/* Set the last line of the screen as the target for the cursor. */
|
||||
openfile->current_y = editwinrows - 1;
|
||||
ensure_line_is_visible();
|
||||
|
||||
refresh_needed = TRUE;
|
||||
focusing = FALSE;
|
||||
}
|
||||
|
||||
/* Move up one page. */
|
||||
void do_page_up(void)
|
||||
{
|
||||
int i, skipped = 0;
|
||||
int i, mustmove, skipped = 0;
|
||||
|
||||
/* If the cursor is less than a page away from the top of the file,
|
||||
* put it at the beginning of the first line. */
|
||||
if (openfile->current->lineno == 1 || (
|
||||
#ifndef NANO_TINY
|
||||
!ISSET(SOFTWRAP) &&
|
||||
#endif
|
||||
openfile->current->lineno <= editwinrows - 2)) {
|
||||
if (openfile->current->lineno == 1 || (!ISSET(SOFTWRAP) &&
|
||||
openfile->current->lineno <= editwinrows - 2)) {
|
||||
do_first_line();
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we're not in smooth scrolling mode, put the cursor at the
|
||||
* beginning of the top line of the edit window, as Pico does. */
|
||||
#ifndef NANO_TINY
|
||||
if (!ISSET(SMOOTH_SCROLL)) {
|
||||
#endif
|
||||
openfile->current = openfile->edittop;
|
||||
openfile->placewewant = openfile->current_y = 0;
|
||||
#ifndef NANO_TINY
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = editwinrows - 2; i - skipped > 0 && openfile->current !=
|
||||
openfile->fileage; i--) {
|
||||
mustmove = (editwinrows < 3) ? 1 : editwinrows - 2;
|
||||
|
||||
for (i = mustmove; i - skipped > 0 && openfile->current != openfile->fileage; i--) {
|
||||
openfile->current = openfile->current->prev;
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP) && openfile->current) {
|
||||
skipped += strlenpt(openfile->current->data) / COLS;
|
||||
skipped += strlenpt(openfile->current->data) / editwincols;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "do_page_up: i = %d, skipped = %d based on line %ld len %lu\n",
|
||||
fprintf(stderr, "paging up: i = %d, skipped = %d based on line %ld len %lu\n",
|
||||
i, skipped, (long)openfile->current->lineno, (unsigned long)strlenpt(openfile->current->data));
|
||||
#endif
|
||||
}
|
||||
@@ -89,55 +86,48 @@ void do_page_up(void)
|
||||
}
|
||||
|
||||
openfile->current_x = actual_x(openfile->current->data,
|
||||
openfile->placewewant);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "do_page_up: openfile->current->lineno = %lu, skipped = %d\n",
|
||||
(unsigned long)openfile->current->lineno, skipped);
|
||||
#endif
|
||||
openfile->placewewant);
|
||||
|
||||
/* Scroll the edit window up a page. */
|
||||
edit_update(NONE);
|
||||
adjust_viewport(STATIONARY);
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
/* Move down one page. */
|
||||
void do_page_down(void)
|
||||
{
|
||||
int i;
|
||||
int i, mustmove;
|
||||
|
||||
/* If the cursor is less than a page away from the bottom of the file,
|
||||
* put it at the end of the last line. */
|
||||
if (openfile->current->lineno + maxrows - 2 >=
|
||||
openfile->filebot->lineno) {
|
||||
if (openfile->current->lineno + maxlines - 2 >= openfile->filebot->lineno) {
|
||||
do_last_line();
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we're not in smooth scrolling mode, put the cursor at the
|
||||
* beginning of the top line of the edit window, as Pico does. */
|
||||
#ifndef NANO_TINY
|
||||
if (!ISSET(SMOOTH_SCROLL)) {
|
||||
#endif
|
||||
openfile->current = openfile->edittop;
|
||||
openfile->placewewant = openfile->current_y = 0;
|
||||
#ifndef NANO_TINY
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = maxrows - 2; i > 0 && openfile->current !=
|
||||
openfile->filebot; i--) {
|
||||
mustmove = (maxlines < 3) ? 1 : maxlines - 2;
|
||||
|
||||
for (i = mustmove; i > 0 && openfile->current != openfile->filebot; i--) {
|
||||
openfile->current = openfile->current->next;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "do_page_down: moving to line %lu\n", (unsigned long)openfile->current->lineno);
|
||||
fprintf(stderr, "paging down: moving to line %lu\n", (unsigned long)openfile->current->lineno);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
openfile->current_x = actual_x(openfile->current->data,
|
||||
openfile->placewewant);
|
||||
openfile->placewewant);
|
||||
|
||||
/* Scroll the edit window down a page. */
|
||||
edit_update(NONE);
|
||||
adjust_viewport(STATIONARY);
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
@@ -146,21 +136,18 @@ void do_page_down(void)
|
||||
* afterwards. */
|
||||
void do_para_begin(bool allow_update)
|
||||
{
|
||||
filestruct *current_save = openfile->current;
|
||||
const size_t pww_save = openfile->placewewant;
|
||||
filestruct *was_current = openfile->current;
|
||||
|
||||
if (openfile->current != openfile->fileage) {
|
||||
do {
|
||||
do
|
||||
openfile->current = openfile->current->prev;
|
||||
openfile->current_y--;
|
||||
} while (!begpar(openfile->current));
|
||||
while (!begpar(openfile->current));
|
||||
}
|
||||
|
||||
openfile->current_x = 0;
|
||||
openfile->placewewant = 0;
|
||||
|
||||
if (allow_update)
|
||||
edit_redraw(current_save, pww_save);
|
||||
edit_redraw(was_current);
|
||||
}
|
||||
|
||||
/* Move up to the beginning of the last beginning-of-paragraph line
|
||||
@@ -178,31 +165,26 @@ void do_para_begin_void(void)
|
||||
* paragraph or isn't in a paragraph. */
|
||||
void do_para_end(bool allow_update)
|
||||
{
|
||||
filestruct *const current_save = openfile->current;
|
||||
const size_t pww_save = openfile->placewewant;
|
||||
filestruct *was_current = openfile->current;
|
||||
|
||||
while (openfile->current != openfile->filebot &&
|
||||
!inpar(openfile->current))
|
||||
!inpar(openfile->current))
|
||||
openfile->current = openfile->current->next;
|
||||
|
||||
while (openfile->current != openfile->filebot &&
|
||||
inpar(openfile->current->next) &&
|
||||
!begpar(openfile->current->next)) {
|
||||
inpar(openfile->current->next) &&
|
||||
!begpar(openfile->current->next)) {
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current_y++;
|
||||
}
|
||||
|
||||
if (openfile->current != openfile->filebot) {
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current_x = 0;
|
||||
openfile->placewewant = 0;
|
||||
} else {
|
||||
} else
|
||||
openfile->current_x = strlen(openfile->current->data);
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
|
||||
if (allow_update)
|
||||
edit_redraw(current_save, pww_save);
|
||||
edit_redraw(was_current);
|
||||
}
|
||||
|
||||
/* Move down to the beginning of the last line of the current paragraph.
|
||||
@@ -214,62 +196,44 @@ void do_para_end_void(void)
|
||||
}
|
||||
#endif /* !DISABLE_JUSTIFY */
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Move to the next word in the file. If allow_punct is TRUE, treat
|
||||
* punctuation as part of a word. If allow_update is TRUE, update the
|
||||
* screen afterwards. Return TRUE if we started on a word, and FALSE
|
||||
* otherwise. */
|
||||
bool do_next_word(bool allow_punct, bool allow_update)
|
||||
/* Move to the preceding block of text in the file. */
|
||||
void do_prev_block(void)
|
||||
{
|
||||
size_t pww_save = openfile->placewewant;
|
||||
filestruct *current_save = openfile->current;
|
||||
bool started_on_word = is_word_mbchar(openfile->current->data +
|
||||
openfile->current_x, allow_punct);
|
||||
bool seen_space = !started_on_word;
|
||||
filestruct *was_current = openfile->current;
|
||||
bool is_text = FALSE, seen_text = FALSE;
|
||||
|
||||
assert(openfile->current != NULL && openfile->current->data != NULL);
|
||||
|
||||
/* Move forward until we reach the start of a word. */
|
||||
while (TRUE) {
|
||||
/* If at the end of a line, move to the beginning of the next one. */
|
||||
if (openfile->current->data[openfile->current_x] == '\0') {
|
||||
/* If at the end of the file, stop. */
|
||||
if (openfile->current->next == NULL)
|
||||
break;
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current_x = 0;
|
||||
seen_space = TRUE;
|
||||
} else {
|
||||
/* Step forward one character. */
|
||||
openfile->current_x = move_mbright(openfile->current->data,
|
||||
openfile->current_x);
|
||||
}
|
||||
|
||||
/* If this is not a word character, then it's a separator; else
|
||||
* if we've already seen a separator, then it's a word start. */
|
||||
if (!is_word_mbchar(openfile->current->data + openfile->current_x,
|
||||
allow_punct))
|
||||
seen_space = TRUE;
|
||||
else if (seen_space)
|
||||
break;
|
||||
/* Skip backward until first blank line after some nonblank line(s). */
|
||||
while (openfile->current->prev != NULL && (!seen_text || is_text)) {
|
||||
openfile->current = openfile->current->prev;
|
||||
is_text = !white_string(openfile->current->data);
|
||||
seen_text = seen_text || is_text;
|
||||
}
|
||||
|
||||
openfile->placewewant = xplustabs();
|
||||
/* Step forward one line again if this one is blank. */
|
||||
if (openfile->current->next != NULL &&
|
||||
white_string(openfile->current->data))
|
||||
openfile->current = openfile->current->next;
|
||||
|
||||
/* If allow_update is TRUE, update the screen. */
|
||||
if (allow_update)
|
||||
edit_redraw(current_save, pww_save);
|
||||
|
||||
/* Return whether we started on a word. */
|
||||
return started_on_word;
|
||||
openfile->current_x = 0;
|
||||
edit_redraw(was_current);
|
||||
}
|
||||
|
||||
/* Move to the next word in the file, treating punctuation as part of a
|
||||
* word if the WORD_BOUNDS flag is set, and update the screen
|
||||
* afterwards. */
|
||||
void do_next_word_void(void)
|
||||
/* Move to the next block of text in the file. */
|
||||
void do_next_block(void)
|
||||
{
|
||||
do_next_word(ISSET(WORD_BOUNDS), TRUE);
|
||||
filestruct *was_current = openfile->current;
|
||||
bool is_white = white_string(openfile->current->data);
|
||||
bool seen_white = is_white;
|
||||
|
||||
/* Skip forward until first nonblank line after some blank line(s). */
|
||||
while (openfile->current->next != NULL && (!seen_white || is_white)) {
|
||||
openfile->current = openfile->current->next;
|
||||
is_white = white_string(openfile->current->data);
|
||||
seen_white = seen_white || is_white;
|
||||
}
|
||||
|
||||
openfile->current_x = 0;
|
||||
edit_redraw(was_current);
|
||||
}
|
||||
|
||||
/* Move to the previous word in the file. If allow_punct is TRUE, treat
|
||||
@@ -277,8 +241,7 @@ void do_next_word_void(void)
|
||||
* screen afterwards. */
|
||||
void do_prev_word(bool allow_punct, bool allow_update)
|
||||
{
|
||||
size_t pww_save = openfile->placewewant;
|
||||
filestruct *current_save = openfile->current;
|
||||
filestruct *was_current = openfile->current;
|
||||
bool seen_a_word = FALSE, step_forward = FALSE;
|
||||
|
||||
assert(openfile->current != NULL && openfile->current->data != NULL);
|
||||
@@ -314,21 +277,88 @@ void do_prev_word(bool allow_punct, bool allow_update)
|
||||
/* Move one character forward again to sit on the start of the word. */
|
||||
openfile->current_x = move_mbright(openfile->current->data,
|
||||
openfile->current_x);
|
||||
openfile->placewewant = xplustabs();
|
||||
|
||||
/* If allow_update is TRUE, update the screen. */
|
||||
if (allow_update)
|
||||
edit_redraw(current_save, pww_save);
|
||||
if (allow_update) {
|
||||
focusing = FALSE;
|
||||
edit_redraw(was_current);
|
||||
}
|
||||
}
|
||||
|
||||
/* Move to the previous word in the file, treating punctuation as part
|
||||
* of a word if the WORD_BOUNDS flag is set, and update the screen
|
||||
* afterwards. */
|
||||
/* Move to the previous word in the file, treating punctuation as part of a
|
||||
* word if the WORD_BOUNDS flag is set, and update the screen afterwards. */
|
||||
void do_prev_word_void(void)
|
||||
{
|
||||
do_prev_word(ISSET(WORD_BOUNDS), TRUE);
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Move to the next word in the file. If allow_punct is TRUE, treat
|
||||
* punctuation as part of a word. If allow_update is TRUE, update the
|
||||
* screen afterwards. Return TRUE if we started on a word, and FALSE
|
||||
* otherwise. */
|
||||
bool do_next_word(bool allow_punct, bool allow_update)
|
||||
{
|
||||
filestruct *was_current = openfile->current;
|
||||
bool started_on_word = is_word_mbchar(openfile->current->data +
|
||||
openfile->current_x, allow_punct);
|
||||
bool seen_space = !started_on_word;
|
||||
|
||||
assert(openfile->current != NULL && openfile->current->data != NULL);
|
||||
|
||||
/* Move forward until we reach the start of a word. */
|
||||
while (TRUE) {
|
||||
/* If at the end of a line, move to the beginning of the next one. */
|
||||
if (openfile->current->data[openfile->current_x] == '\0') {
|
||||
/* If at the end of the file, stop. */
|
||||
if (openfile->current->next == NULL)
|
||||
break;
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current_x = 0;
|
||||
seen_space = TRUE;
|
||||
} else {
|
||||
/* Step forward one character. */
|
||||
openfile->current_x = move_mbright(openfile->current->data,
|
||||
openfile->current_x);
|
||||
}
|
||||
|
||||
/* If this is not a word character, then it's a separator; else
|
||||
* if we've already seen a separator, then it's a word start. */
|
||||
if (!is_word_mbchar(openfile->current->data + openfile->current_x,
|
||||
allow_punct))
|
||||
seen_space = TRUE;
|
||||
else if (seen_space)
|
||||
break;
|
||||
}
|
||||
|
||||
/* If allow_update is TRUE, update the screen. */
|
||||
if (allow_update) {
|
||||
focusing = FALSE;
|
||||
edit_redraw(was_current);
|
||||
}
|
||||
|
||||
/* Return whether we started on a word. */
|
||||
return started_on_word;
|
||||
}
|
||||
|
||||
/* Move to the next word in the file, treating punctuation as part of a word
|
||||
* if the WORD_BOUNDS flag is set, and update the screen afterwards. */
|
||||
void do_next_word_void(void)
|
||||
{
|
||||
do_next_word(ISSET(WORD_BOUNDS), TRUE);
|
||||
}
|
||||
|
||||
/* Make sure that the current line, when it is partially scrolled off the
|
||||
* screen in softwrap mode, is scrolled fully into view. */
|
||||
void ensure_line_is_visible(void)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP) && strlenpt(openfile->current->data) / editwincols +
|
||||
openfile->current_y >= editwinrows) {
|
||||
adjust_viewport(ISSET(SMOOTH_SCROLL) ? FLOWING : CENTERING);
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Move to the beginning of the current line. If the SMART_HOME flag is
|
||||
* set, move to the first non-whitespace character of the current line
|
||||
@@ -336,7 +366,7 @@ void do_prev_word_void(void)
|
||||
* if we are. */
|
||||
void do_home(void)
|
||||
{
|
||||
size_t pww_save = openfile->placewewant;
|
||||
size_t was_column = xplustabs();
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SMART_HOME)) {
|
||||
@@ -347,49 +377,40 @@ void do_home(void)
|
||||
if (openfile->current_x == current_x_save ||
|
||||
openfile->current->data[openfile->current_x] == '\0')
|
||||
openfile->current_x = 0;
|
||||
|
||||
openfile->placewewant = xplustabs();
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
openfile->current_x = 0;
|
||||
openfile->placewewant = 0;
|
||||
#ifndef NANO_TINY
|
||||
}
|
||||
#endif
|
||||
|
||||
if (need_screen_update(pww_save))
|
||||
openfile->placewewant = xplustabs();
|
||||
|
||||
if (need_horizontal_scroll(was_column, openfile->placewewant))
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
}
|
||||
|
||||
/* Move to the end of the current line. */
|
||||
void do_end(void)
|
||||
{
|
||||
size_t pww_save = openfile->placewewant;
|
||||
size_t was_column = xplustabs();
|
||||
|
||||
openfile->current_x = strlen(openfile->current->data);
|
||||
openfile->placewewant = xplustabs();
|
||||
|
||||
if (need_screen_update(pww_save))
|
||||
if (need_horizontal_scroll(was_column, openfile->placewewant))
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
|
||||
ensure_line_is_visible();
|
||||
}
|
||||
|
||||
/* If scroll_only is FALSE, move up one line. If scroll_only is TRUE,
|
||||
* scroll up one line without scrolling the cursor. */
|
||||
void do_up(
|
||||
#ifndef NANO_TINY
|
||||
bool scroll_only
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
)
|
||||
void do_up(bool scroll_only)
|
||||
{
|
||||
size_t was_column = xplustabs();
|
||||
|
||||
/* If we're at the top of the file, or if scroll_only is TRUE and
|
||||
* the top of the file is onscreen, get out. */
|
||||
if (openfile->current == openfile->fileage
|
||||
#ifndef NANO_TINY
|
||||
|| (scroll_only && openfile->edittop == openfile->fileage)
|
||||
#endif
|
||||
)
|
||||
if (openfile->current == openfile->fileage ||
|
||||
(scroll_only && openfile->edittop == openfile->fileage))
|
||||
return;
|
||||
|
||||
assert(ISSET(SOFTWRAP) || openfile->current_y == openfile->current->lineno - openfile->edittop->lineno);
|
||||
@@ -397,67 +418,41 @@ void do_up(
|
||||
/* Move the current line of the edit window up. */
|
||||
openfile->current = openfile->current->prev;
|
||||
openfile->current_x = actual_x(openfile->current->data,
|
||||
openfile->placewewant);
|
||||
openfile->placewewant);
|
||||
|
||||
/* If scroll_only is FALSE and if we're on the first line of the
|
||||
* edit window, scroll the edit window up one line if we're in
|
||||
* smooth scrolling mode, or up half a page if we're not. If
|
||||
* scroll_only is TRUE, scroll the edit window up one line
|
||||
* unconditionally. */
|
||||
if (openfile->current_y == 0
|
||||
#ifndef NANO_TINY
|
||||
|| (ISSET(SOFTWRAP) && openfile->edittop->lineno == openfile->current->next->lineno) || scroll_only
|
||||
#endif
|
||||
)
|
||||
edit_scroll(UPWARD,
|
||||
#ifndef NANO_TINY
|
||||
(ISSET(SMOOTH_SCROLL) || scroll_only) ? 1 :
|
||||
#endif
|
||||
editwinrows / 2 + 1);
|
||||
/* When the cursor was on the first line of the edit window (or when just
|
||||
* scrolling without moving the cursor), scroll the edit window up -- one
|
||||
* line if we're in smooth scrolling mode, and half a page otherwise. */
|
||||
if (openfile->current->next == openfile->edittop || scroll_only)
|
||||
edit_scroll(UPWARD, (ISSET(SMOOTH_SCROLL) || scroll_only) ?
|
||||
1 : editwinrows / 2 + 1);
|
||||
|
||||
/* If we're below the first line of the edit window, update the
|
||||
* line we were on before and the line we're on now. The former
|
||||
* needs to be redrawn if we're not on the first page, and the
|
||||
* latter needs to be drawn unconditionally. */
|
||||
/* If the lines weren't already redrawn, see if they need to be. */
|
||||
if (openfile->current_y > 0) {
|
||||
if (need_screen_update(0))
|
||||
/* Redraw the prior line if it was horizontally scrolled. */
|
||||
if (need_horizontal_scroll(was_column, 0))
|
||||
update_line(openfile->current->next, 0);
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
/* Redraw the current line if it needs to be horizontally scrolled. */
|
||||
if (need_horizontal_scroll(0, xplustabs()))
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
}
|
||||
}
|
||||
|
||||
/* Move up one line. */
|
||||
void do_up_void(void)
|
||||
{
|
||||
do_up(
|
||||
#ifndef NANO_TINY
|
||||
FALSE
|
||||
#endif
|
||||
);
|
||||
do_up(FALSE);
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Scroll up one line without scrolling the cursor. */
|
||||
void do_scroll_up(void)
|
||||
{
|
||||
do_up(TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If scroll_only is FALSE, move down one line. If scroll_only is TRUE,
|
||||
* scroll down one line without scrolling the cursor. */
|
||||
void do_down(
|
||||
#ifndef NANO_TINY
|
||||
bool scroll_only
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
)
|
||||
void do_down(bool scroll_only)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
int amount = 0, enough;
|
||||
filestruct *topline;
|
||||
#endif
|
||||
size_t was_column = xplustabs();
|
||||
|
||||
/* If we're at the bottom of the file, get out. */
|
||||
if (openfile->current == openfile->filebot)
|
||||
@@ -467,76 +462,77 @@ void do_down(
|
||||
openfile->current->lineno - openfile->edittop->lineno);
|
||||
assert(openfile->current->next != NULL);
|
||||
|
||||
/* Move the current line of the edit window down. */
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current_x = actual_x(openfile->current->data,
|
||||
openfile->placewewant);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
/* Compute the amount to scroll. */
|
||||
amount = (strlenpt(openfile->current->data) / COLS + openfile->current_y + 2
|
||||
+ strlenpt(openfile->current->prev->data) / COLS - editwinrows);
|
||||
/* Compute the number of lines to scroll. */
|
||||
amount = strlenpt(openfile->current->data) / editwincols -
|
||||
xplustabs() / editwincols +
|
||||
strlenpt(openfile->current->next->data) / editwincols +
|
||||
openfile->current_y - editwinrows + 2;
|
||||
topline = openfile->edittop;
|
||||
/* Reduce the amount when there are overlong lines at the top. */
|
||||
for (enough = 1; enough < amount; enough++) {
|
||||
amount -= strlenpt(topline->data) / COLS;
|
||||
if (amount <= 0) {
|
||||
amount -= strlenpt(topline->data) / editwincols;
|
||||
if (amount > 0)
|
||||
topline = topline->next;
|
||||
if (amount < enough) {
|
||||
amount = enough;
|
||||
break;
|
||||
}
|
||||
topline = topline->next;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If scroll_only is FALSE and if we're on the last line of the
|
||||
* edit window, scroll the edit window down one line if we're in
|
||||
* smooth scrolling mode, or down half a page if we're not. If
|
||||
* scroll_only is TRUE, scroll the edit window down one line
|
||||
* unconditionally. */
|
||||
if (openfile->current_y == editwinrows - 1
|
||||
#ifndef NANO_TINY
|
||||
|| amount > 0 || scroll_only
|
||||
#endif
|
||||
) {
|
||||
/* Move to the next line in the file. */
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current_x = actual_x(openfile->current->data,
|
||||
openfile->placewewant);
|
||||
|
||||
/* When the cursor was on the last line of the edit window (or when just
|
||||
* scrolling without moving the cursor), scroll the edit window down -- one
|
||||
* line if we're in smooth scrolling mode, and half a page otherwise. */
|
||||
#ifndef NANO_TINY
|
||||
if (openfile->current_y == editwinrows - 1 || amount > 0 || scroll_only) {
|
||||
if (amount < 1 || scroll_only)
|
||||
amount = 1;
|
||||
#endif
|
||||
edit_scroll(DOWNWARD,
|
||||
#ifndef NANO_TINY
|
||||
(ISSET(SMOOTH_SCROLL) || scroll_only) ? amount :
|
||||
#endif
|
||||
editwinrows / 2 + 1);
|
||||
edit_refresh_needed = TRUE;
|
||||
|
||||
edit_scroll(DOWNWARD, (ISSET(SMOOTH_SCROLL) || scroll_only) ?
|
||||
amount : editwinrows / 2 + 1);
|
||||
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
refresh_needed = TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* If we're above the last line of the edit window, update the line
|
||||
* we were on before and the line we're on now. The former needs to
|
||||
* be redrawn if we're not on the first page, and the latter needs
|
||||
* to be drawn unconditionally. */
|
||||
if (openfile->current_y < editwinrows - 1
|
||||
#ifndef NANO_TINY
|
||||
|| ISSET(SOFTWRAP)
|
||||
#else
|
||||
if (openfile->current_y == editwinrows - 1)
|
||||
edit_scroll(DOWNWARD, editwinrows / 2 + 1);
|
||||
#endif
|
||||
) {
|
||||
if (need_screen_update(0))
|
||||
|
||||
/* If the lines weren't already redrawn, see if they need to be. */
|
||||
if (openfile->current_y < editwinrows - 1) {
|
||||
/* Redraw the prior line if it was horizontally scrolled. */
|
||||
if (need_horizontal_scroll(was_column, 0))
|
||||
update_line(openfile->current->prev, 0);
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
/* Redraw the current line if it needs to be horizontally scrolled. */
|
||||
if (need_horizontal_scroll(0, xplustabs()))
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
}
|
||||
}
|
||||
|
||||
/* Move down one line. */
|
||||
void do_down_void(void)
|
||||
{
|
||||
do_down(
|
||||
#ifndef NANO_TINY
|
||||
FALSE
|
||||
#endif
|
||||
);
|
||||
do_down(FALSE);
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Scroll up one line without scrolling the cursor. */
|
||||
void do_scroll_up(void)
|
||||
{
|
||||
do_up(TRUE);
|
||||
}
|
||||
|
||||
/* Scroll down one line without scrolling the cursor. */
|
||||
void do_scroll_down(void)
|
||||
{
|
||||
@@ -547,11 +543,11 @@ void do_scroll_down(void)
|
||||
/* Move left one character. */
|
||||
void do_left(void)
|
||||
{
|
||||
size_t pww_save = openfile->placewewant;
|
||||
size_t was_column = xplustabs();
|
||||
|
||||
if (openfile->current_x > 0)
|
||||
openfile->current_x = move_mbleft(openfile->current->data,
|
||||
openfile->current_x);
|
||||
openfile->current_x);
|
||||
else if (openfile->current != openfile->fileage) {
|
||||
do_up_void();
|
||||
openfile->current_x = strlen(openfile->current->data);
|
||||
@@ -559,27 +555,35 @@ void do_left(void)
|
||||
|
||||
openfile->placewewant = xplustabs();
|
||||
|
||||
if (need_screen_update(pww_save))
|
||||
if (need_horizontal_scroll(was_column, openfile->placewewant))
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
}
|
||||
|
||||
/* Move right one character. */
|
||||
void do_right(void)
|
||||
{
|
||||
size_t pww_save = openfile->placewewant;
|
||||
size_t was_column = xplustabs();
|
||||
|
||||
assert(openfile->current_x <= strlen(openfile->current->data));
|
||||
|
||||
if (openfile->current->data[openfile->current_x] != '\0')
|
||||
openfile->current_x = move_mbright(openfile->current->data,
|
||||
openfile->current_x);
|
||||
openfile->current_x);
|
||||
else if (openfile->current != openfile->filebot) {
|
||||
do_down_void();
|
||||
openfile->current_x = 0;
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP))
|
||||
openfile->current_y -= strlenpt(openfile->current->data) / editwincols;
|
||||
#endif
|
||||
}
|
||||
|
||||
openfile->placewewant = xplustabs();
|
||||
|
||||
if (need_screen_update(pww_save))
|
||||
if (need_horizontal_scroll(was_column, openfile->placewewant))
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
|
||||
if (openfile->current_x == 0)
|
||||
do_down_void();
|
||||
else
|
||||
ensure_line_is_visible();
|
||||
}
|
||||
|
||||
1000
src/nano.c
1000
src/nano.c
File diff suppressed because it is too large
Load Diff
180
src/nano.h
180
src/nano.h
@@ -1,23 +1,22 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* nano.h *
|
||||
* nano.h -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
|
||||
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* Copyright (C) 2014, 2015, 2016 Benno Schulenberg *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -59,7 +58,7 @@
|
||||
|
||||
/* Macros for flags, indexing each bit in a small array. */
|
||||
#define FLAGS(flag) flags[((flag) / (sizeof(unsigned) * 8))]
|
||||
#define FLAGMASK(flag) (1 << ((flag) % (sizeof(unsigned) * 8)))
|
||||
#define FLAGMASK(flag) ((unsigned)1 << ((flag) % (sizeof(unsigned) * 8)))
|
||||
#define SET(flag) FLAGS(flag) |= FLAGMASK(flag)
|
||||
#define UNSET(flag) FLAGS(flag) &= ~FLAGMASK(flag)
|
||||
#define ISSET(flag) ((FLAGS(flag) & FLAGMASK(flag)) != 0)
|
||||
@@ -93,6 +92,10 @@
|
||||
#include <curses.h>
|
||||
#endif /* CURSES_H */
|
||||
|
||||
#if defined(NCURSES_VERSION_MAJOR) && (NCURSES_VERSION_MAJOR < 6)
|
||||
#define USING_OLD_NCURSES yes
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
/* Native language support. */
|
||||
#ifdef HAVE_LIBINTL_H
|
||||
@@ -168,39 +171,38 @@ typedef enum {
|
||||
NIX_FILE, DOS_FILE, MAC_FILE
|
||||
} file_format;
|
||||
|
||||
typedef enum {
|
||||
HUSH, MILD, ALERT
|
||||
} message_type;
|
||||
|
||||
typedef enum {
|
||||
OVERWRITE, APPEND, PREPEND
|
||||
} append_type;
|
||||
} kind_of_writing_type;
|
||||
|
||||
typedef enum {
|
||||
SOFTMARK, HARDMARK
|
||||
} mark_type;
|
||||
|
||||
typedef enum {
|
||||
UPWARD, DOWNWARD
|
||||
} scroll_dir;
|
||||
|
||||
typedef enum {
|
||||
CENTER, NONE
|
||||
CENTERING, FLOWING, STATIONARY
|
||||
} update_type;
|
||||
|
||||
typedef enum {
|
||||
CONTROL, META, FKEY, RAWINPUT
|
||||
} key_type;
|
||||
|
||||
typedef enum {
|
||||
ADD, DEL, BACK, CUT, CUT_EOF, REPLACE,
|
||||
#ifndef DISABLE_WRAPPING
|
||||
SPLIT_BEGIN, SPLIT_END,
|
||||
#endif
|
||||
#ifndef DISABLE_COMMENT
|
||||
COMMENT, UNCOMMENT, PREFLIGHT,
|
||||
#endif
|
||||
JOIN, PASTE, INSERT, ENTER, OTHER
|
||||
} undo_type;
|
||||
|
||||
/* Structure types. */
|
||||
typedef struct color_pair {
|
||||
int pairnum;
|
||||
/* The color pair number used for this foreground color and
|
||||
* background color. */
|
||||
bool bright;
|
||||
/* Is this color A_BOLD? */
|
||||
} color_pair;
|
||||
|
||||
#ifndef DISABLE_COLOR
|
||||
typedef struct colortype {
|
||||
short fg;
|
||||
@@ -209,11 +211,13 @@ typedef struct colortype {
|
||||
/* This syntax's background color. */
|
||||
bool bright;
|
||||
/* Is this color A_BOLD? */
|
||||
bool icase;
|
||||
/* Is this regex string case insensitive? */
|
||||
int pairnum;
|
||||
/* The color pair number used for this foreground color and
|
||||
* background color. */
|
||||
int attributes;
|
||||
/* Pair number and brightness composed into ready-to-use attributes. */
|
||||
int rex_flags;
|
||||
/* The regex compilation flags (with or without REG_ICASE). */
|
||||
char *start_regex;
|
||||
/* The start (or all) of the regex string. */
|
||||
regex_t *start;
|
||||
@@ -229,16 +233,14 @@ typedef struct colortype {
|
||||
} colortype;
|
||||
|
||||
typedef struct regexlisttype {
|
||||
char *ext_regex;
|
||||
/* The regexstrings for the things that match this syntax. */
|
||||
regex_t *ext;
|
||||
/* The compiled regexes. */
|
||||
char *full_regex;
|
||||
/* A regex string to match things that imply a certain syntax. */
|
||||
struct regexlisttype *next;
|
||||
/* Next set of regexes. */
|
||||
/* The next regex. */
|
||||
} regexlisttype;
|
||||
|
||||
typedef struct syntaxtype {
|
||||
char *desc;
|
||||
char *name;
|
||||
/* The name of this syntax. */
|
||||
regexlisttype *extensions;
|
||||
/* The list of extensions that this syntax applies to. */
|
||||
@@ -246,14 +248,16 @@ typedef struct syntaxtype {
|
||||
/* The list of headerlines that this syntax applies to. */
|
||||
regexlisttype *magics;
|
||||
/* The list of libmagic results that this syntax applies to. */
|
||||
colortype *color;
|
||||
/* The colors used in this syntax. */
|
||||
char *linter;
|
||||
/* The command to lint this type of file. */
|
||||
/* The command with which to lint this type of file. */
|
||||
char *formatter;
|
||||
/* Use this formatter command (for programming lang mainly) */
|
||||
/* The formatting command (for programming languages mainly). */
|
||||
char *comment;
|
||||
/* The line comment prefix (and postfix) for this type of file. */
|
||||
colortype *color;
|
||||
/* The colors and their regexes used in this syntax. */
|
||||
int nmultis;
|
||||
/* How many multi-line strings this syntax has. */
|
||||
/* How many multiline regex strings this syntax has. */
|
||||
struct syntaxtype *next;
|
||||
/* Next syntax. */
|
||||
} syntaxtype;
|
||||
@@ -284,6 +288,8 @@ typedef struct lintstruct {
|
||||
/* Whole line engulfed by the regex, start < me, end > me. */
|
||||
#define CSTARTENDHERE (1<<5)
|
||||
/* Regex starts and ends within this line. */
|
||||
#define CWOULDBE (1<<6)
|
||||
/* An unpaired start match on or before this line. */
|
||||
#endif /* !DISABLE_COLOR */
|
||||
|
||||
/* More structure types. */
|
||||
@@ -321,6 +327,14 @@ typedef struct partition {
|
||||
} partition;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
typedef struct undo_group {
|
||||
ssize_t top_line;
|
||||
/* First line of group. */
|
||||
ssize_t bottom_line;
|
||||
/* Last line of group. */
|
||||
struct undo_group *next;
|
||||
} undo_group;
|
||||
|
||||
typedef struct undo {
|
||||
ssize_t lineno;
|
||||
undo_type type;
|
||||
@@ -335,19 +349,20 @@ typedef struct undo {
|
||||
/* The file size after the action. */
|
||||
int xflags;
|
||||
/* Some flag data we need. */
|
||||
undo_group *grouping;
|
||||
/* Undo info specific to groups of lines. */
|
||||
|
||||
/* Cut-specific stuff we need. */
|
||||
filestruct *cutbuffer;
|
||||
/* Copy of the cutbuffer. */
|
||||
filestruct *cutbottom;
|
||||
/* Copy of cutbottom. */
|
||||
bool mark_set;
|
||||
/* Was the marker set when we cut? */
|
||||
ssize_t mark_begin_lineno;
|
||||
/* copy copy copy */
|
||||
/* Mostly the line number of the current line; sometimes something else. */
|
||||
size_t mark_begin_x;
|
||||
/* Another shadow variable. */
|
||||
/* The x position corresponding to the above line number. */
|
||||
struct undo *next;
|
||||
/* A pointer to the undo item of the preceding action. */
|
||||
} undo;
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
@@ -384,6 +399,8 @@ typedef struct openfilestruct {
|
||||
/* The file's y-coordinate position. */
|
||||
bool modified;
|
||||
/* Whether the file has been modified. */
|
||||
struct stat *current_stat;
|
||||
/* The file's current stat information. */
|
||||
#ifndef NANO_TINY
|
||||
bool mark_set;
|
||||
/* Whether the mark is on in this file. */
|
||||
@@ -391,10 +408,10 @@ typedef struct openfilestruct {
|
||||
/* The file's line where the mark is, if any. */
|
||||
size_t mark_begin_x;
|
||||
/* The file's mark's x-coordinate position, if any. */
|
||||
mark_type kind_of_mark;
|
||||
/* Whether this is a soft or a hard mark. */
|
||||
file_format fmt;
|
||||
/* The file's format. */
|
||||
struct stat *current_stat;
|
||||
/* The file's current stat information. */
|
||||
undo *undotop;
|
||||
/* The top of the undo list. */
|
||||
undo *current_undo;
|
||||
@@ -418,29 +435,31 @@ typedef struct openfilestruct {
|
||||
|
||||
#ifndef DISABLE_NANORC
|
||||
typedef struct rcoption {
|
||||
const char *name;
|
||||
const char *name;
|
||||
/* The name of the rcfile option. */
|
||||
long flag;
|
||||
long flag;
|
||||
/* The flag associated with it, if any. */
|
||||
} rcoption;
|
||||
#endif
|
||||
|
||||
typedef struct sc {
|
||||
char *keystr;
|
||||
/* The shortcut key for a function, ASCII version. */
|
||||
key_type type;
|
||||
/* What kind of command key it is, for convenience later. */
|
||||
int seq;
|
||||
/* The actual sequence to check once the type is determined. */
|
||||
const char *keystr;
|
||||
/* The string that describes a keystroke, like "^C" or "M-R". */
|
||||
bool meta;
|
||||
/* Whether this is a Meta keystroke. */
|
||||
int keycode;
|
||||
/* The integer that, together with meta, identifies the keystroke. */
|
||||
int menus;
|
||||
/* Which menus this applies to. */
|
||||
void (*scfunc)(void);
|
||||
/* The function we're going to run. */
|
||||
#ifndef NANO_TINY
|
||||
int toggle;
|
||||
/* If a toggle, what we're toggling. */
|
||||
int ordinal;
|
||||
/* The how-manieth toggle this is, in order to be able to
|
||||
* keep them in sequence. */
|
||||
#endif
|
||||
struct sc *next;
|
||||
/* Next in the list. */
|
||||
} sc;
|
||||
@@ -467,10 +486,18 @@ typedef struct subnfunc {
|
||||
/* Next item in the list. */
|
||||
} subnfunc;
|
||||
|
||||
#ifdef ENABLE_WORDCOMPLETION
|
||||
typedef struct completion_word {
|
||||
char *word;
|
||||
struct completion_word *next;
|
||||
} completion_word;
|
||||
#endif
|
||||
|
||||
/* The elements of the interface that can be colored differently. */
|
||||
enum
|
||||
{
|
||||
TITLE_BAR = 0,
|
||||
LINE_NUMBER,
|
||||
STATUS_BAR,
|
||||
KEY_COMBO,
|
||||
FUNCTION_TAG,
|
||||
@@ -517,7 +544,10 @@ enum
|
||||
POS_HISTORY,
|
||||
LOCKING,
|
||||
NOREAD_MODE,
|
||||
MAKE_IT_UNIX
|
||||
MAKE_IT_UNIX,
|
||||
JUSTIFY_TRIM,
|
||||
SHOW_CURSOR,
|
||||
LINE_NUMBERS
|
||||
};
|
||||
|
||||
/* Flags for the menus in which a given function should be present. */
|
||||
@@ -540,16 +570,28 @@ enum
|
||||
#define MMOST (MMAIN|MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MWRITEFILE|MINSERTFILE|\
|
||||
MEXTCMD|MBROWSER|MWHEREISFILE|MGOTODIR|MSPELL|MLINTER)
|
||||
|
||||
/* Control key sequences. Changing these would be very, very bad. */
|
||||
#define NANO_CONTROL_SPACE 0
|
||||
#define NANO_CONTROL_I 9
|
||||
#define NANO_CONTROL_3 27
|
||||
#define NANO_CONTROL_7 31
|
||||
#define NANO_CONTROL_8 127
|
||||
/* Basic control codes. */
|
||||
#define TAB_CODE 0x09
|
||||
#define ESC_CODE 0x1B
|
||||
#define DEL_CODE 0x7F
|
||||
|
||||
/* Codes for "modified" Arrow keys, beyond KEY_MAX of ncurses. */
|
||||
#define CONTROL_LEFT 0x401
|
||||
#define CONTROL_RIGHT 0x402
|
||||
#define CONTROL_UP 0x403
|
||||
#define CONTROL_DOWN 0x404
|
||||
#define SHIFT_CONTROL_LEFT 0x405
|
||||
#define SHIFT_CONTROL_RIGHT 0x406
|
||||
#define SHIFT_CONTROL_UP 0x407
|
||||
#define SHIFT_CONTROL_DOWN 0x408
|
||||
#define SHIFT_ALT_LEFT 0x409
|
||||
#define SHIFT_ALT_RIGHT 0x40a
|
||||
#define SHIFT_ALT_UP 0x40b
|
||||
#define SHIFT_ALT_DOWN 0x40c
|
||||
#define SHIFT_PAGEUP 0x40d
|
||||
#define SHIFT_PAGEDOWN 0x40e
|
||||
#define SHIFT_HOME 0x40f
|
||||
#define SHIFT_END 0x410
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* An imaginary key for when we get a SIGWINCH (window resize). */
|
||||
@@ -557,18 +599,15 @@ enum
|
||||
|
||||
/* Some extra flags for the undo function. */
|
||||
#define WAS_FINAL_BACKSPACE (1<<1)
|
||||
#define WAS_MARKED_FORWARD (1<<2)
|
||||
#define WAS_WHOLE_LINE (1<<3)
|
||||
#define WAS_WHOLE_LINE (1<<2)
|
||||
/* The flags for the mark need to be the highest. */
|
||||
#define MARK_WAS_SET (1<<3)
|
||||
#define WAS_MARKED_FORWARD (1<<4)
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* The maximum number of entries displayed in the main shortcut list. */
|
||||
#define MAIN_VISIBLE (((COLS + 40) / 20) * 2)
|
||||
|
||||
/* The minimum editor window columns and rows required for nano to work
|
||||
* correctly. */
|
||||
#define MIN_EDITOR_COLS 4
|
||||
#define MIN_EDITOR_ROWS 1
|
||||
|
||||
/* The default number of characters from the end of the line where
|
||||
* wrapping occurs. */
|
||||
#define CHARS_FROM_EOL 8
|
||||
@@ -583,4 +622,7 @@ enum
|
||||
/* The maximum number of bytes buffered at one time. */
|
||||
#define MAX_BUF_SIZE 128
|
||||
|
||||
/* The largest size_t number that doesn't have the high bit set. */
|
||||
#define HIGHEST_POSITIVE ((~(size_t)0) >> 1)
|
||||
|
||||
#endif /* !NANO_H */
|
||||
|
||||
647
src/prompt.c
647
src/prompt.c
@@ -1,23 +1,22 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* prompt.c *
|
||||
* prompt.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
|
||||
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* Copyright (C) 2016 Benno Schulenberg *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -29,23 +28,14 @@
|
||||
|
||||
static char *prompt = NULL;
|
||||
/* The prompt string used for statusbar questions. */
|
||||
static size_t statusbar_x = (size_t)-1;
|
||||
static size_t statusbar_x = HIGHEST_POSITIVE;
|
||||
/* The cursor position in answer. */
|
||||
static size_t statusbar_pww = (size_t)-1;
|
||||
/* The place we want in answer. */
|
||||
static size_t old_statusbar_x = (size_t)-1;
|
||||
/* The old cursor position in answer, if any. */
|
||||
static size_t old_pww = (size_t)-1;
|
||||
/* The old place we want in answer, if any. */
|
||||
|
||||
/* Read in a character, interpret it as a shortcut or toggle if
|
||||
* necessary, and return it.
|
||||
* Set ran_func to TRUE if we ran a function associated with a
|
||||
* shortcut key, and set finished to TRUE if we're done after running
|
||||
* or trying to run a function associated with a shortcut key.
|
||||
* refresh_func is the function we will call to refresh the edit window. */
|
||||
int do_statusbar_input(bool *ran_func, bool *finished,
|
||||
void (*refresh_func)(void))
|
||||
/* Read in a keystroke, interpret it if it is a shortcut or toggle, and
|
||||
* return it. Set ran_func to TRUE if we ran a function associated with
|
||||
* a shortcut key, and set finished to TRUE if we're done after running
|
||||
* or trying to run a function associated with a shortcut key. */
|
||||
int do_statusbar_input(bool *ran_func, bool *finished)
|
||||
{
|
||||
int input;
|
||||
/* The character we read in. */
|
||||
@@ -71,14 +61,11 @@ int do_statusbar_input(bool *ran_func, bool *finished,
|
||||
#ifndef DISABLE_MOUSE
|
||||
/* If we got a mouse click and it was on a shortcut, read in the
|
||||
* shortcut character. */
|
||||
if (func_key && input == KEY_MOUSE) {
|
||||
if (input == KEY_MOUSE) {
|
||||
if (do_statusbar_mouse() == 1)
|
||||
input = get_kbinput(bottomwin);
|
||||
else {
|
||||
meta_key = FALSE;
|
||||
func_key = FALSE;
|
||||
input = ERR;
|
||||
}
|
||||
else
|
||||
return ERR;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -92,131 +79,86 @@ int do_statusbar_input(bool *ran_func, bool *finished,
|
||||
/* If we got a non-high-bit control key, a meta key sequence, or a
|
||||
* function key, and it's not a shortcut or toggle, throw it out. */
|
||||
if (!have_shortcut) {
|
||||
if (is_ascii_cntrl_char(input) || meta_key || func_key) {
|
||||
if (is_ascii_cntrl_char(input) || meta_key || !is_byte(input)) {
|
||||
beep();
|
||||
meta_key = FALSE;
|
||||
func_key = FALSE;
|
||||
input = ERR;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we got a character, and it isn't a shortcut or toggle,
|
||||
* it's a normal text character. Display the warning if we're
|
||||
* in view mode, or add the character to the input buffer if
|
||||
* we're not. */
|
||||
/* If the keystroke isn't a shortcut nor a toggle, it's a normal text
|
||||
* character: add the it to the input buffer, when allowed. */
|
||||
if (input != ERR && !have_shortcut) {
|
||||
/* If we're using restricted mode, the filename isn't blank,
|
||||
* and we're at the "Write File" prompt, disable text input. */
|
||||
if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
|
||||
currmenu != MWRITEFILE) {
|
||||
/* Only accept input when not in restricted mode, or when not at
|
||||
* the "Write File" prompt, or when there is no filename yet. */
|
||||
if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE ||
|
||||
openfile->filename[0] == '\0') {
|
||||
kbinput_len++;
|
||||
kbinput = (int *)nrealloc(kbinput, kbinput_len * sizeof(int));
|
||||
kbinput[kbinput_len - 1] = input;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we got a shortcut, or if there aren't any other characters
|
||||
* waiting after the one we read in, we need to display all the
|
||||
* characters in the input buffer if it isn't empty. */
|
||||
if (have_shortcut || get_key_buffer_len() == 0) {
|
||||
if (kbinput != NULL) {
|
||||
/* Display all the characters in the input buffer at
|
||||
* once, filtering out control characters. */
|
||||
char *output = charalloc(kbinput_len + 1);
|
||||
size_t i;
|
||||
bool got_enter;
|
||||
/* Whether we got the Enter key. */
|
||||
/* If we got a shortcut, or if there aren't any other keystrokes waiting
|
||||
* after the one we read in, we need to insert all the characters in the
|
||||
* input buffer (if not empty) into the answer. */
|
||||
if ((have_shortcut || get_key_buffer_len() == 0) && kbinput != NULL) {
|
||||
/* Inject all characters in the input buffer at once, filtering out
|
||||
* control characters. */
|
||||
do_statusbar_output(kbinput, kbinput_len, TRUE);
|
||||
|
||||
for (i = 0; i < kbinput_len; i++)
|
||||
output[i] = (char)kbinput[i];
|
||||
output[i] = '\0';
|
||||
/* Empty the input buffer. */
|
||||
kbinput_len = 0;
|
||||
free(kbinput);
|
||||
kbinput = NULL;
|
||||
}
|
||||
|
||||
do_statusbar_output(output, kbinput_len, &got_enter, FALSE);
|
||||
|
||||
free(output);
|
||||
|
||||
/* Empty the input buffer. */
|
||||
kbinput_len = 0;
|
||||
free(kbinput);
|
||||
kbinput = NULL;
|
||||
}
|
||||
|
||||
if (have_shortcut) {
|
||||
if (s->scfunc == do_tab || s->scfunc == do_enter)
|
||||
;
|
||||
else if (s->scfunc == total_refresh) {
|
||||
total_redraw();
|
||||
refresh_func();
|
||||
} else if (s->scfunc == do_cut_text_void) {
|
||||
/* If we're using restricted mode, the filename
|
||||
* isn't blank, and we're at the "Write File"
|
||||
* prompt, disable Cut. */
|
||||
if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
|
||||
currmenu != MWRITEFILE)
|
||||
do_statusbar_cut_text();
|
||||
} else if (s->scfunc == do_left)
|
||||
do_statusbar_left();
|
||||
else if (s->scfunc == do_right)
|
||||
do_statusbar_right();
|
||||
if (have_shortcut) {
|
||||
if (s->scfunc == do_tab || s->scfunc == do_enter)
|
||||
;
|
||||
else if (s->scfunc == do_left)
|
||||
do_statusbar_left();
|
||||
else if (s->scfunc == do_right)
|
||||
do_statusbar_right();
|
||||
#ifndef NANO_TINY
|
||||
else if (s->scfunc == do_prev_word_void)
|
||||
do_statusbar_prev_word();
|
||||
else if (s->scfunc == do_next_word_void)
|
||||
do_statusbar_next_word();
|
||||
else if (s->scfunc == do_prev_word_void)
|
||||
do_statusbar_prev_word();
|
||||
else if (s->scfunc == do_next_word_void)
|
||||
do_statusbar_next_word();
|
||||
#endif
|
||||
else if (s->scfunc == do_home)
|
||||
do_statusbar_home();
|
||||
else if (s->scfunc == do_end)
|
||||
do_statusbar_end();
|
||||
else if (s->scfunc == do_verbatim_input) {
|
||||
/* If we're using restricted mode, the filename
|
||||
* isn't blank, and we're at the "Write File"
|
||||
* prompt, disable verbatim input. */
|
||||
if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE ||
|
||||
openfile->filename[0] == '\0') {
|
||||
bool got_enter;
|
||||
/* Whether we got the Enter key. */
|
||||
|
||||
do_statusbar_verbatim_input(&got_enter);
|
||||
|
||||
/* If we got the Enter key, remove it from the input
|
||||
* buffer, set input to the key value for Enter, and
|
||||
* set finished to TRUE to indicate that we're done. */
|
||||
if (got_enter) {
|
||||
get_input(NULL, 1);
|
||||
input = sc_seq_or(do_enter, 0);
|
||||
*finished = TRUE;
|
||||
}
|
||||
}
|
||||
} else if (s->scfunc == do_delete) {
|
||||
/* If we're using restricted mode, the filename
|
||||
* isn't blank, and we're at the "Write File"
|
||||
* prompt, disable Delete. */
|
||||
if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
|
||||
currmenu != MWRITEFILE)
|
||||
do_statusbar_delete();
|
||||
} else if (s->scfunc == do_backspace) {
|
||||
/* If we're using restricted mode, the filename
|
||||
* isn't blank, and we're at the "Write File"
|
||||
* prompt, disable Backspace. */
|
||||
if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
|
||||
currmenu != MWRITEFILE)
|
||||
do_statusbar_backspace();
|
||||
} else {
|
||||
/* Handle any other shortcut in the current menu, setting
|
||||
* ran_func to TRUE if we try to run their associated
|
||||
* functions and setting finished to TRUE to indicate
|
||||
* that we're done after running or trying to run their
|
||||
* associated functions. */
|
||||
f = sctofunc(s);
|
||||
if (s->scfunc != NULL) {
|
||||
*ran_func = TRUE;
|
||||
if (f && (!ISSET(VIEW_MODE) || f->viewok) &&
|
||||
else if (s->scfunc == do_home)
|
||||
do_statusbar_home();
|
||||
else if (s->scfunc == do_end)
|
||||
do_statusbar_end();
|
||||
/* When in restricted mode at the "Write File" prompt and the
|
||||
* filename isn't blank, disallow any input and deletion. */
|
||||
else if (ISSET(RESTRICTED) && currmenu == MWRITEFILE &&
|
||||
openfile->filename[0] != '\0' &&
|
||||
(s->scfunc == do_verbatim_input ||
|
||||
s->scfunc == do_cut_text_void ||
|
||||
s->scfunc == do_delete ||
|
||||
s->scfunc == do_backspace))
|
||||
;
|
||||
else if (s->scfunc == do_verbatim_input) {
|
||||
do_statusbar_verbatim_input();
|
||||
} else if (s->scfunc == do_cut_text_void)
|
||||
do_statusbar_cut_text();
|
||||
else if (s->scfunc == do_delete)
|
||||
do_statusbar_delete();
|
||||
else if (s->scfunc == do_backspace)
|
||||
do_statusbar_backspace();
|
||||
else {
|
||||
/* Handle any other shortcut in the current menu, setting
|
||||
* ran_func to TRUE if we try to run their associated functions,
|
||||
* and setting finished to TRUE to indicatethat we're done after
|
||||
* running or trying to run their associated functions. */
|
||||
f = sctofunc(s);
|
||||
if (s->scfunc != NULL) {
|
||||
*ran_func = TRUE;
|
||||
if (f && (!ISSET(VIEW_MODE) || f->viewok) &&
|
||||
f->scfunc != do_gotolinecolumn_void)
|
||||
f->scfunc();
|
||||
}
|
||||
*finished = TRUE;
|
||||
f->scfunc();
|
||||
}
|
||||
*finished = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,8 +176,6 @@ int do_statusbar_mouse(void)
|
||||
if (retval == 0 && wmouse_trafo(bottomwin, &mouse_y, &mouse_x, FALSE)) {
|
||||
size_t start_col;
|
||||
|
||||
assert(prompt != NULL);
|
||||
|
||||
start_col = strlenpt(prompt) + 2;
|
||||
|
||||
/* Move to where the click occurred. */
|
||||
@@ -243,7 +183,7 @@ int do_statusbar_mouse(void)
|
||||
statusbar_x = actual_x(answer,
|
||||
get_statusbar_page_start(start_col, start_col +
|
||||
statusbar_xplustabs()) + mouse_x - start_col);
|
||||
update_bar_if_needed();
|
||||
update_the_statusbar();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,84 +191,63 @@ int do_statusbar_mouse(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* The user typed output_len multibyte characters. Add them to the
|
||||
* statusbar prompt, setting got_enter to TRUE if we get a newline, and
|
||||
* filtering out all ASCII control characters if allow_cntrls is
|
||||
* TRUE. */
|
||||
void do_statusbar_output(char *output, size_t output_len, bool
|
||||
*got_enter, bool allow_cntrls)
|
||||
/* The user typed input_len multibyte characters. Add them to the answer,
|
||||
* filtering out ASCII control characters if filtering is TRUE. */
|
||||
void do_statusbar_output(int *the_input, size_t input_len,
|
||||
bool filtering)
|
||||
{
|
||||
size_t answer_len, i = 0;
|
||||
char *output = charalloc(input_len + 1);
|
||||
char *char_buf = charalloc(mb_cur_max());
|
||||
int char_buf_len;
|
||||
int i, char_len;
|
||||
|
||||
assert(answer != NULL);
|
||||
/* Copy the typed stuff so it can be treated. */
|
||||
for (i = 0; i < input_len; i++)
|
||||
output[i] = (char)the_input[i];
|
||||
output[i] = '\0';
|
||||
|
||||
answer_len = strlen(answer);
|
||||
*got_enter = FALSE;
|
||||
i = 0;
|
||||
|
||||
while (i < output_len) {
|
||||
/* If allow_cntrls is TRUE, convert nulls and newlines
|
||||
* properly. */
|
||||
if (allow_cntrls) {
|
||||
/* Null to newline, if needed. */
|
||||
if (output[i] == '\0')
|
||||
output[i] = '\n';
|
||||
/* Newline to Enter, if needed. */
|
||||
else if (output[i] == '\n') {
|
||||
/* Set got_enter to TRUE to indicate that we got the
|
||||
* Enter key, put back the rest of the characters in
|
||||
* output so that they can be parsed and output again,
|
||||
* and get out. */
|
||||
*got_enter = TRUE;
|
||||
unparse_kbinput(output + i, output_len - i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
while (i < input_len) {
|
||||
/* Encode any NUL byte as 0x0A. */
|
||||
if (output[i] == '\0')
|
||||
output[i] = '\n';
|
||||
|
||||
/* Interpret the next multibyte character. */
|
||||
char_buf_len = parse_mbchar(output + i, char_buf, NULL);
|
||||
char_len = parse_mbchar(output + i, char_buf, NULL);
|
||||
|
||||
i += char_buf_len;
|
||||
i += char_len;
|
||||
|
||||
/* If allow_cntrls is FALSE, filter out an ASCII control
|
||||
* character. */
|
||||
if (!allow_cntrls && is_ascii_cntrl_char(*(output + i -
|
||||
char_buf_len)))
|
||||
/* When filtering, skip any ASCII control character. */
|
||||
if (filtering && is_ascii_cntrl_char(*(output + i - char_len)))
|
||||
continue;
|
||||
|
||||
/* More dangerousness fun. =) */
|
||||
answer = charealloc(answer, answer_len + (char_buf_len * 2));
|
||||
/* Insert the typed character into the existing answer string. */
|
||||
answer = charealloc(answer, strlen(answer) + char_len + 1);
|
||||
charmove(answer + statusbar_x + char_len, answer + statusbar_x,
|
||||
strlen(answer) - statusbar_x + 1);
|
||||
strncpy(answer + statusbar_x, char_buf, char_len);
|
||||
|
||||
assert(statusbar_x <= answer_len);
|
||||
|
||||
charmove(answer + statusbar_x + char_buf_len, answer + statusbar_x,
|
||||
answer_len - statusbar_x + char_buf_len);
|
||||
strncpy(answer + statusbar_x, char_buf, char_buf_len);
|
||||
answer_len += char_buf_len;
|
||||
|
||||
statusbar_x += char_buf_len;
|
||||
statusbar_x += char_len;
|
||||
}
|
||||
|
||||
free(char_buf);
|
||||
|
||||
statusbar_pww = statusbar_xplustabs();
|
||||
free(output);
|
||||
|
||||
update_the_statusbar();
|
||||
}
|
||||
|
||||
/* Move to the beginning of the prompt text. */
|
||||
/* Move to the beginning of the answer. */
|
||||
void do_statusbar_home(void)
|
||||
{
|
||||
statusbar_x = 0;
|
||||
update_bar_if_needed();
|
||||
update_the_statusbar();
|
||||
}
|
||||
|
||||
/* Move to the end of the prompt text. */
|
||||
/* Move to the end of the answer. */
|
||||
void do_statusbar_end(void)
|
||||
{
|
||||
statusbar_x = strlen(answer);
|
||||
update_bar_if_needed();
|
||||
update_the_statusbar();
|
||||
}
|
||||
|
||||
/* Move left one character. */
|
||||
@@ -336,16 +255,16 @@ void do_statusbar_left(void)
|
||||
{
|
||||
if (statusbar_x > 0) {
|
||||
statusbar_x = move_mbleft(answer, statusbar_x);
|
||||
update_bar_if_needed();
|
||||
update_the_statusbar();
|
||||
}
|
||||
}
|
||||
|
||||
/* Move right one character. */
|
||||
void do_statusbar_right(void)
|
||||
{
|
||||
if (statusbar_x < strlen(answer)) {
|
||||
if (answer[statusbar_x] != '\0') {
|
||||
statusbar_x = move_mbright(answer, statusbar_x);
|
||||
update_bar_if_needed();
|
||||
update_the_statusbar();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,50 +280,33 @@ void do_statusbar_backspace(void)
|
||||
/* Delete one character. */
|
||||
void do_statusbar_delete(void)
|
||||
{
|
||||
statusbar_pww = statusbar_xplustabs();
|
||||
|
||||
if (answer[statusbar_x] != '\0') {
|
||||
int char_buf_len = parse_mbchar(answer + statusbar_x, NULL, NULL);
|
||||
size_t line_len = strlen(answer + statusbar_x);
|
||||
int char_len = parse_mbchar(answer + statusbar_x, NULL, NULL);
|
||||
|
||||
assert(statusbar_x < strlen(answer));
|
||||
|
||||
charmove(answer + statusbar_x, answer + statusbar_x + char_buf_len,
|
||||
strlen(answer) - statusbar_x - char_buf_len + 1);
|
||||
|
||||
null_at(&answer, statusbar_x + line_len - char_buf_len);
|
||||
charmove(answer + statusbar_x, answer + statusbar_x + char_len,
|
||||
strlen(answer) - statusbar_x - char_len + 1);
|
||||
|
||||
update_the_statusbar();
|
||||
}
|
||||
}
|
||||
|
||||
/* Move text from the prompt into oblivion. */
|
||||
/* Zap some or all text from the answer. */
|
||||
void do_statusbar_cut_text(void)
|
||||
{
|
||||
assert(answer != NULL);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(CUT_TO_END))
|
||||
null_at(&answer, statusbar_x);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
null_at(&answer, 0);
|
||||
if (!ISSET(CUT_TO_END))
|
||||
statusbar_x = 0;
|
||||
statusbar_pww = statusbar_xplustabs();
|
||||
}
|
||||
|
||||
null_at(&answer, statusbar_x);
|
||||
|
||||
update_the_statusbar();
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Move to the next word in the prompt text. */
|
||||
/* Move to the next word in the answer. */
|
||||
void do_statusbar_next_word(void)
|
||||
{
|
||||
bool seen_space = !is_word_mbchar(answer + statusbar_x, FALSE);
|
||||
|
||||
assert(answer != NULL);
|
||||
|
||||
/* Move forward until we reach the start of a word. */
|
||||
while (answer[statusbar_x] != '\0') {
|
||||
statusbar_x = move_mbright(answer, statusbar_x);
|
||||
@@ -417,16 +319,14 @@ void do_statusbar_next_word(void)
|
||||
break;
|
||||
}
|
||||
|
||||
update_bar_if_needed();
|
||||
update_the_statusbar();
|
||||
}
|
||||
|
||||
/* Move to the previous word in the prompt text. */
|
||||
/* Move to the previous word in the answer. */
|
||||
void do_statusbar_prev_word(void)
|
||||
{
|
||||
bool seen_a_word = FALSE, step_forward = FALSE;
|
||||
|
||||
assert(answer != NULL);
|
||||
|
||||
/* Move backward until we pass over the start of a word. */
|
||||
while (statusbar_x != 0) {
|
||||
statusbar_x = move_mbleft(answer, statusbar_x);
|
||||
@@ -444,122 +344,96 @@ void do_statusbar_prev_word(void)
|
||||
/* Move one character forward again to sit on the start of the word. */
|
||||
statusbar_x = move_mbright(answer, statusbar_x);
|
||||
|
||||
update_bar_if_needed();
|
||||
update_the_statusbar();
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Get verbatim input. Set got_enter to TRUE if we got the Enter key as
|
||||
* part of the verbatim input. */
|
||||
void do_statusbar_verbatim_input(bool *got_enter)
|
||||
/* Get verbatim input and inject it into the answer, without filtering. */
|
||||
void do_statusbar_verbatim_input(void)
|
||||
{
|
||||
int *kbinput;
|
||||
size_t kbinput_len, i;
|
||||
char *output;
|
||||
size_t kbinput_len;
|
||||
|
||||
*got_enter = FALSE;
|
||||
|
||||
/* Read in all the verbatim characters. */
|
||||
kbinput = get_verbatim_kbinput(bottomwin, &kbinput_len);
|
||||
|
||||
/* Display all the verbatim characters at once, not filtering out
|
||||
* control characters. */
|
||||
output = charalloc(kbinput_len + 1);
|
||||
|
||||
for (i = 0; i < kbinput_len; i++)
|
||||
output[i] = (char)kbinput[i];
|
||||
output[i] = '\0';
|
||||
|
||||
do_statusbar_output(output, kbinput_len, got_enter, TRUE);
|
||||
|
||||
free(output);
|
||||
do_statusbar_output(kbinput, kbinput_len, FALSE);
|
||||
}
|
||||
|
||||
/* Return the placewewant associated with statusbar_x, i.e. the
|
||||
* zero-based column position of the cursor. The value will be no
|
||||
* smaller than statusbar_x. */
|
||||
/* Return the zero-based column position of the cursor in the answer. */
|
||||
size_t statusbar_xplustabs(void)
|
||||
{
|
||||
return strnlenpt(answer, statusbar_x);
|
||||
}
|
||||
|
||||
/* nano scrolls horizontally within a line in chunks. This function
|
||||
* returns the column number of the first character displayed in the
|
||||
* statusbar prompt when the cursor is at the given column with the
|
||||
* prompt ending at start_col. Note that (0 <= column -
|
||||
* get_statusbar_page_start(column) < COLS). */
|
||||
size_t get_statusbar_page_start(size_t start_col, size_t column)
|
||||
/* Return the column number of the first character of the answer that is
|
||||
* displayed in the statusbar when the cursor is at the given column,
|
||||
* with the available room for the answer starting at base. Note that
|
||||
* (0 <= column - get_statusbar_page_start(column) < COLS). */
|
||||
size_t get_statusbar_page_start(size_t base, size_t column)
|
||||
{
|
||||
if (column == start_col || column < COLS - 1 || COLS == start_col + 1)
|
||||
if (column == base || column < COLS - 1)
|
||||
return 0;
|
||||
else if (COLS > base + 2)
|
||||
return column - base - 1 - (column - base - 1) % (COLS - base - 2);
|
||||
else
|
||||
return column - start_col - (column - start_col) % (COLS -
|
||||
start_col - 1);
|
||||
return column - 2;
|
||||
}
|
||||
|
||||
/* Put the cursor in the statusbar prompt at statusbar_x. */
|
||||
/* Reinitialize the cursor position in the answer. */
|
||||
void reinit_statusbar_x(void)
|
||||
{
|
||||
statusbar_x = HIGHEST_POSITIVE;
|
||||
}
|
||||
|
||||
/* Put the cursor in the answer at statusbar_x. */
|
||||
void reset_statusbar_cursor(void)
|
||||
{
|
||||
size_t start_col = strlenpt(prompt) + 2;
|
||||
size_t xpt = statusbar_xplustabs();
|
||||
|
||||
/* Work around a cursor-misplacement bug in VTEs. */
|
||||
wmove(bottomwin, 0, 0);
|
||||
wnoutrefresh(bottomwin);
|
||||
doupdate();
|
||||
|
||||
wmove(bottomwin, 0, start_col + xpt -
|
||||
get_statusbar_page_start(start_col, start_col + xpt));
|
||||
get_statusbar_page_start(start_col, start_col + xpt));
|
||||
|
||||
wnoutrefresh(bottomwin);
|
||||
}
|
||||
|
||||
/* Repaint the statusbar. */
|
||||
void update_the_statusbar(void)
|
||||
{
|
||||
size_t start_col, index, page_start;
|
||||
size_t base, the_page, end_page;
|
||||
char *expanded;
|
||||
|
||||
assert(prompt != NULL && statusbar_x <= strlen(answer));
|
||||
base = strlenpt(prompt) + 2;
|
||||
the_page = get_statusbar_page_start(base, base + strnlenpt(answer, statusbar_x));
|
||||
end_page = get_statusbar_page_start(base, base + strlenpt(answer) - 1);
|
||||
|
||||
start_col = strlenpt(prompt) + 2;
|
||||
index = strnlenpt(answer, statusbar_x);
|
||||
page_start = get_statusbar_page_start(start_col, start_col + index);
|
||||
|
||||
if (interface_color_pair[TITLE_BAR].bright)
|
||||
wattron(bottomwin, A_BOLD);
|
||||
wattron(bottomwin, interface_color_pair[TITLE_BAR].pairnum);
|
||||
wattron(bottomwin, interface_color_pair[TITLE_BAR]);
|
||||
|
||||
blank_statusbar();
|
||||
|
||||
mvwaddnstr(bottomwin, 0, 0, prompt, actual_x(prompt, COLS - 2));
|
||||
mvwaddstr(bottomwin, 0, 0, prompt);
|
||||
waddch(bottomwin, ':');
|
||||
waddch(bottomwin, (page_start == 0) ? ' ' : '$');
|
||||
waddch(bottomwin, (the_page == 0) ? ' ' : '<');
|
||||
|
||||
expanded = display_string(answer, page_start, COLS - start_col - 1, FALSE);
|
||||
expanded = display_string(answer, the_page, COLS - base - 1, FALSE);
|
||||
waddstr(bottomwin, expanded);
|
||||
free(expanded);
|
||||
|
||||
wattroff(bottomwin, A_BOLD);
|
||||
wattroff(bottomwin, interface_color_pair[TITLE_BAR].pairnum);
|
||||
waddch(bottomwin, (the_page >= end_page) ? ' ' : '>');
|
||||
|
||||
wattroff(bottomwin, interface_color_pair[TITLE_BAR]);
|
||||
|
||||
statusbar_pww = statusbar_xplustabs();
|
||||
reset_statusbar_cursor();
|
||||
wnoutrefresh(bottomwin);
|
||||
}
|
||||
|
||||
/* Update the statusbar line /if/ the placewewant changes page. */
|
||||
void update_bar_if_needed(void)
|
||||
{
|
||||
size_t start_col = strlenpt(prompt) + 2;
|
||||
size_t was_pww = statusbar_pww;
|
||||
|
||||
statusbar_pww = statusbar_xplustabs();
|
||||
|
||||
if (get_statusbar_page_start(start_col, start_col + statusbar_pww) !=
|
||||
get_statusbar_page_start(start_col, start_col + was_pww))
|
||||
update_the_statusbar();
|
||||
}
|
||||
|
||||
/* Get a string of input at the statusbar prompt. */
|
||||
functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
#ifndef DISABLE_TABCOMP
|
||||
bool allow_files,
|
||||
bool *list,
|
||||
#endif
|
||||
const char *curranswer,
|
||||
functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||
bool allow_files, bool *listed,
|
||||
#ifndef DISABLE_HISTORIES
|
||||
filestruct **history_list,
|
||||
#endif
|
||||
@@ -587,15 +461,11 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
#endif
|
||||
#endif /* !DISABLE_HISTORIES */
|
||||
|
||||
answer = mallocstrcpy(answer, curranswer);
|
||||
|
||||
if (statusbar_x > strlen(answer)) {
|
||||
if (statusbar_x > strlen(answer))
|
||||
statusbar_x = strlen(answer);
|
||||
statusbar_pww = statusbar_xplustabs();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answer, (unsigned long) statusbar_x);
|
||||
fprintf(stderr, "acquiring: answer = \"%s\", statusbar_x = %lu\n", answer, (unsigned long) statusbar_x);
|
||||
#endif
|
||||
|
||||
update_the_statusbar();
|
||||
@@ -604,22 +474,24 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
wnoutrefresh(edit);
|
||||
wnoutrefresh(bottomwin);
|
||||
|
||||
/* If we're using restricted mode, we aren't allowed to change the
|
||||
* name of the current file once it has one, because that would
|
||||
* allow writing to files not specified on the command line. In
|
||||
* this case, disable all keys that would change the text if the
|
||||
* filename isn't blank and we're at the "Write File" prompt. */
|
||||
while (TRUE) {
|
||||
kbinput = do_statusbar_input(&ran_func, &finished, refresh_func);
|
||||
assert(statusbar_x <= strlen(answer));
|
||||
/* Ensure the cursor is shown when waiting for input. */
|
||||
curs_set(1);
|
||||
|
||||
kbinput = do_statusbar_input(&ran_func, &finished);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* If the window size changed, go reformat the prompt string. */
|
||||
if (kbinput == KEY_WINCH) {
|
||||
refresh_func();
|
||||
update_the_statusbar();
|
||||
continue;
|
||||
}
|
||||
*actual = KEY_WINCH;
|
||||
#ifndef DISABLE_HISTORIES
|
||||
free(magichistory);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
func = func_from_key(&kbinput);
|
||||
|
||||
if (func == do_cancel || func == do_enter)
|
||||
@@ -632,22 +504,19 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
if (func == do_tab) {
|
||||
#ifndef DISABLE_HISTORIES
|
||||
if (history_list != NULL) {
|
||||
if (last_kbinput != sc_seq_or(do_tab, NANO_CONTROL_I))
|
||||
if (last_kbinput != the_code_for(do_tab, TAB_CODE))
|
||||
complete_len = strlen(answer);
|
||||
|
||||
if (complete_len > 0) {
|
||||
answer = mallocstrcpy(answer,
|
||||
get_history_completion(history_list,
|
||||
answer, complete_len));
|
||||
answer = get_history_completion(history_list,
|
||||
answer, complete_len);
|
||||
statusbar_x = strlen(answer);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (allow_tabs)
|
||||
answer = input_tab(answer, allow_files, &statusbar_x,
|
||||
&tabbed, refresh_func, list);
|
||||
|
||||
update_the_statusbar();
|
||||
&tabbed, refresh_func, listed);
|
||||
} else
|
||||
#endif /* !DISABLE_TABCOMP */
|
||||
#ifndef DISABLE_HISTORIES
|
||||
@@ -655,7 +524,7 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
if (history_list != NULL) {
|
||||
/* If we're scrolling up at the bottom of the history list
|
||||
* and answer isn't blank, save answer in magichistory. */
|
||||
if ((*history_list)->next == NULL && answer[0] != '\0')
|
||||
if ((*history_list)->next == NULL && *answer != '\0')
|
||||
magichistory = mallocstrcpy(magichistory, answer);
|
||||
|
||||
/* Get the older search from the history list and save it in
|
||||
@@ -665,8 +534,6 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
statusbar_x = strlen(answer);
|
||||
}
|
||||
|
||||
update_the_statusbar();
|
||||
|
||||
/* This key has a shortcut-list entry when it's used to
|
||||
* move to an older search, which means that finished has
|
||||
* been set to TRUE. Set it back to FALSE here, so that
|
||||
@@ -691,8 +558,6 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
statusbar_x = strlen(answer);
|
||||
}
|
||||
|
||||
update_the_statusbar();
|
||||
|
||||
/* This key has a shortcut-list entry when it's used to
|
||||
* move to a newer search, which means that finished has
|
||||
* been set to TRUE. Set it back to FALSE here, so that
|
||||
@@ -702,8 +567,6 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
} else
|
||||
#endif /* !DISABLE_HISTORIES */
|
||||
if (func == do_help_void) {
|
||||
update_the_statusbar();
|
||||
|
||||
/* This key has a shortcut-list entry when it's used to go to
|
||||
* the help browser or display a message indicating that help
|
||||
* is disabled, which means that finished has been set to TRUE.
|
||||
@@ -717,11 +580,11 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
if (finished)
|
||||
break;
|
||||
|
||||
update_the_statusbar();
|
||||
|
||||
#if !defined(DISABLE_HISTORIES) && !defined(DISABLE_TABCOMP)
|
||||
last_kbinput = kbinput;
|
||||
#endif
|
||||
reset_statusbar_cursor();
|
||||
wnoutrefresh(bottomwin);
|
||||
}
|
||||
|
||||
#ifndef DISABLE_HISTORIES
|
||||
@@ -732,13 +595,6 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If we're done with this prompt, restore the cursor position
|
||||
* to what it was at the /previous/ prompt, in case there was. */
|
||||
if (func == do_cancel || func == do_enter) {
|
||||
statusbar_x = old_statusbar_x;
|
||||
statusbar_pww = old_pww;
|
||||
}
|
||||
|
||||
*actual = kbinput;
|
||||
|
||||
return func;
|
||||
@@ -755,10 +611,7 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
|
||||
* The allow_tabs parameter indicates whether we should allow tabs to be
|
||||
* interpreted. The allow_files parameter indicates whether we should
|
||||
* allow all files (as opposed to just directories) to be tab completed. */
|
||||
int do_prompt(bool allow_tabs,
|
||||
#ifndef DISABLE_TABCOMP
|
||||
bool allow_files,
|
||||
#endif
|
||||
int do_prompt(bool allow_tabs, bool allow_files,
|
||||
int menu, const char *curranswer,
|
||||
#ifndef DISABLE_HISTORIES
|
||||
filestruct **history_list,
|
||||
@@ -767,38 +620,43 @@ int do_prompt(bool allow_tabs,
|
||||
{
|
||||
va_list ap;
|
||||
int retval;
|
||||
functionptrtype func;
|
||||
#ifndef DISABLE_TABCOMP
|
||||
bool list = FALSE;
|
||||
#endif
|
||||
|
||||
prompt = charalloc(((COLS - 4) * mb_cur_max()) + 1);
|
||||
functionptrtype func = NULL;
|
||||
bool listed = FALSE;
|
||||
/* Save a possible current statusbar x position. */
|
||||
size_t was_statusbar_x = statusbar_x;
|
||||
|
||||
bottombars(menu);
|
||||
|
||||
va_start(ap, msg);
|
||||
vsnprintf(prompt, (COLS - 4) * mb_cur_max(), msg, ap);
|
||||
va_end(ap);
|
||||
null_at(&prompt, actual_x(prompt, COLS - 4));
|
||||
answer = mallocstrcpy(answer, curranswer);
|
||||
|
||||
func = get_prompt_string(&retval, allow_tabs,
|
||||
#ifndef DISABLE_TABCOMP
|
||||
allow_files,
|
||||
&list,
|
||||
#ifndef NANO_TINY
|
||||
redo_theprompt:
|
||||
#endif
|
||||
curranswer,
|
||||
prompt = charalloc((COLS * mb_cur_max()) + 1);
|
||||
va_start(ap, msg);
|
||||
vsnprintf(prompt, COLS * mb_cur_max(), msg, ap);
|
||||
va_end(ap);
|
||||
/* Reserve five columns for colon plus angles plus answer, ":<aa>". */
|
||||
null_at(&prompt, actual_x(prompt, (COLS < 5) ? 0 : COLS - 5));
|
||||
|
||||
func = acquire_an_answer(&retval, allow_tabs, allow_files, &listed,
|
||||
#ifndef DISABLE_HISTORIES
|
||||
history_list,
|
||||
history_list,
|
||||
#endif
|
||||
refresh_func);
|
||||
refresh_func);
|
||||
|
||||
free(prompt);
|
||||
prompt = NULL;
|
||||
|
||||
/* We're done with the prompt, so save the statusbar cursor
|
||||
* position. */
|
||||
old_statusbar_x = statusbar_x;
|
||||
old_pww = statusbar_pww;
|
||||
#ifndef NANO_TINY
|
||||
if (retval == KEY_WINCH)
|
||||
goto redo_theprompt;
|
||||
#endif
|
||||
|
||||
/* If we're done with this prompt, restore the x position to what
|
||||
* it was at a possible previous prompt. */
|
||||
if (func == do_cancel || func == do_enter)
|
||||
statusbar_x = was_statusbar_x;
|
||||
|
||||
/* If we left the prompt via Cancel or Enter, set the return value
|
||||
* properly. */
|
||||
@@ -815,10 +673,9 @@ int do_prompt(bool allow_tabs,
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_TABCOMP
|
||||
/* If we've done tab completion, there might be a list of filename
|
||||
* matches on the edit window at this point. Make sure that they're
|
||||
* cleared off. */
|
||||
if (list)
|
||||
/* If we've done tab completion, there might still be a list of
|
||||
* filename matches on the edit window. Clear them off. */
|
||||
if (listed)
|
||||
refresh_func();
|
||||
#endif
|
||||
|
||||
@@ -831,30 +688,22 @@ int do_prompt(bool allow_tabs,
|
||||
int do_yesno_prompt(bool all, const char *msg)
|
||||
{
|
||||
int response = -2, width = 16;
|
||||
const char *yesstr; /* String of Yes characters accepted. */
|
||||
const char *nostr; /* Same for No. */
|
||||
const char *allstr; /* And All, surprise! */
|
||||
int oldmenu = currmenu;
|
||||
char *message = display_string(msg, 0, COLS, FALSE);
|
||||
|
||||
assert(msg != NULL);
|
||||
|
||||
/* yesstr, nostr, and allstr are strings of any length. Each string
|
||||
* consists of all single-byte characters accepted as valid
|
||||
* characters for that value. The first value will be the one
|
||||
* displayed in the shortcuts. */
|
||||
/* TRANSLATORS: For the next three strings, if possible, specify
|
||||
* the single-byte shortcuts for both your language and English.
|
||||
* For example, in French: "OoYy" for "Oui". */
|
||||
yesstr = _("Yy");
|
||||
nostr = _("Nn");
|
||||
allstr = _("Aa");
|
||||
* For example, in French: "OoYy", for both "Oui" and "Yes". */
|
||||
const char *yesstr = _("Yy");
|
||||
const char *nostr = _("Nn");
|
||||
const char *allstr = _("Aa");
|
||||
|
||||
do {
|
||||
/* The above three variables consist of all the single-byte characters
|
||||
* that are accepted for the corresponding answer. Of each variable,
|
||||
* the first character is displayed in the help lines. */
|
||||
|
||||
while (response == -2) {
|
||||
int kbinput;
|
||||
functionptrtype func;
|
||||
#ifndef DISABLE_MOUSE
|
||||
int mouse_x, mouse_y;
|
||||
#endif
|
||||
|
||||
if (!ISSET(NO_HELP)) {
|
||||
char shortstr[3];
|
||||
@@ -885,34 +734,28 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||
onekey("^C", _("Cancel"), width);
|
||||
}
|
||||
|
||||
if (interface_color_pair[TITLE_BAR].bright)
|
||||
wattron(bottomwin, A_BOLD);
|
||||
wattron(bottomwin, interface_color_pair[TITLE_BAR].pairnum);
|
||||
|
||||
/* Color the statusbar over its full width and display the question. */
|
||||
wattron(bottomwin, interface_color_pair[TITLE_BAR]);
|
||||
blank_statusbar();
|
||||
mvwaddnstr(bottomwin, 0, 0, msg, actual_x(msg, COLS - 1));
|
||||
mvwaddnstr(bottomwin, 0, 0, message, actual_x(message, COLS - 1));
|
||||
wattroff(bottomwin, interface_color_pair[TITLE_BAR]);
|
||||
|
||||
wattroff(bottomwin, A_BOLD);
|
||||
wattroff(bottomwin, interface_color_pair[TITLE_BAR].pairnum);
|
||||
|
||||
/* Refresh edit window and statusbar before getting input. */
|
||||
wnoutrefresh(edit);
|
||||
wnoutrefresh(bottomwin);
|
||||
|
||||
/* When not replacing, show the cursor. */
|
||||
if (!all)
|
||||
curs_set(1);
|
||||
|
||||
currmenu = MYESNO;
|
||||
kbinput = get_kbinput(bottomwin);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
func = func_from_key(&kbinput);
|
||||
|
||||
if (func == do_cancel)
|
||||
response = -1;
|
||||
#ifndef DISABLE_MOUSE
|
||||
else if (kbinput == KEY_MOUSE) {
|
||||
int mouse_x, mouse_y;
|
||||
/* We can click on the Yes/No/All shortcuts to select an answer. */
|
||||
if (get_mouseinput(&mouse_x, &mouse_y, FALSE) == 0 &&
|
||||
wmouse_trafo(bottomwin, &mouse_y, &mouse_x, FALSE) &&
|
||||
@@ -933,10 +776,7 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||
}
|
||||
}
|
||||
#endif /* !DISABLE_MOUSE */
|
||||
else if (func == total_refresh) {
|
||||
total_redraw();
|
||||
continue;
|
||||
} else {
|
||||
else {
|
||||
/* Look for the kbinput in the Yes, No (and All) strings. */
|
||||
if (strchr(yesstr, kbinput) != NULL)
|
||||
response = 1;
|
||||
@@ -945,8 +785,9 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||
else if (all && strchr(allstr, kbinput) != NULL)
|
||||
response = 2;
|
||||
}
|
||||
} while (response == -2);
|
||||
}
|
||||
|
||||
free(message);
|
||||
|
||||
currmenu = oldmenu;
|
||||
return response;
|
||||
}
|
||||
|
||||
330
src/proto.h
330
src/proto.h
@@ -1,23 +1,21 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* proto.h *
|
||||
* proto.h -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
|
||||
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -28,16 +26,40 @@
|
||||
|
||||
/* All external variables. See global.c for their descriptions. */
|
||||
#ifndef NANO_TINY
|
||||
extern volatile sig_atomic_t sigwinch_counter;
|
||||
extern volatile sig_atomic_t the_window_resized;
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
extern bool console;
|
||||
#endif
|
||||
|
||||
extern bool meta_key;
|
||||
extern bool func_key;
|
||||
extern bool shift_held;
|
||||
|
||||
extern bool focusing;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
extern bool as_an_at;
|
||||
|
||||
extern int margin;
|
||||
extern int editwincols;
|
||||
|
||||
extern message_type lastmessage;
|
||||
|
||||
extern filestruct *pletion_line;
|
||||
|
||||
extern int controlleft;
|
||||
extern int controlright;
|
||||
extern int controlup;
|
||||
extern int controldown;
|
||||
#ifndef NANO_TINY
|
||||
extern int shiftcontrolleft;
|
||||
extern int shiftcontrolright;
|
||||
extern int shiftcontrolup;
|
||||
extern int shiftcontroldown;
|
||||
extern int shiftaltleft;
|
||||
extern int shiftaltright;
|
||||
extern int shiftaltup;
|
||||
extern int shiftaltdown;
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
@@ -46,20 +68,18 @@ extern ssize_t wrap_at;
|
||||
#endif
|
||||
|
||||
extern char *last_search;
|
||||
extern char *last_replace;
|
||||
|
||||
extern char *present_path;
|
||||
|
||||
extern unsigned flags[4];
|
||||
extern WINDOW *topwin;
|
||||
extern WINDOW *edit;
|
||||
extern WINDOW *bottomwin;
|
||||
extern int editwinrows;
|
||||
extern int maxrows;
|
||||
extern int maxlines;
|
||||
|
||||
extern filestruct *cutbuffer;
|
||||
extern filestruct *cutbottom;
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
extern filestruct *jusbuffer;
|
||||
#endif
|
||||
extern partition *filepart;
|
||||
extern openfilestruct *openfile;
|
||||
|
||||
@@ -89,7 +109,10 @@ extern size_t quotelen;
|
||||
#endif
|
||||
#endif /* !DISABLE_JUSTIFY */
|
||||
|
||||
extern char *word_chars;
|
||||
|
||||
extern bool nodelay_mode;
|
||||
|
||||
extern char *answer;
|
||||
|
||||
extern ssize_t tabsize;
|
||||
@@ -113,7 +136,7 @@ extern syntaxtype *syntaxes;
|
||||
extern char *syntaxstr;
|
||||
#endif
|
||||
|
||||
extern bool edit_refresh_needed;
|
||||
extern bool refresh_needed;
|
||||
|
||||
extern int currmenu;
|
||||
extern sc *sclist;
|
||||
@@ -140,7 +163,7 @@ extern int hilite_attribute;
|
||||
#ifndef DISABLE_COLOR
|
||||
extern char* specified_color_combo[NUMBER_OF_ELEMENTS];
|
||||
#endif
|
||||
extern color_pair interface_color_pair[NUMBER_OF_ELEMENTS];
|
||||
extern int interface_color_pair[NUMBER_OF_ELEMENTS];
|
||||
|
||||
extern char *homedir;
|
||||
|
||||
@@ -148,9 +171,9 @@ typedef void (*functionptrtype)(void);
|
||||
|
||||
/* All functions in browser.c. */
|
||||
#ifndef DISABLE_BROWSER
|
||||
char *do_browser(char *path, DIR *dir);
|
||||
char *do_browser(char *path);
|
||||
char *do_browse_from(const char *inpath);
|
||||
void browser_init(const char *path, DIR *dir);
|
||||
void read_the_list(const char *path, DIR *dir);
|
||||
functionptrtype parse_browser_input(int *kbinput);
|
||||
void browser_refresh(void);
|
||||
void browser_select_dirname(const char *needle);
|
||||
@@ -164,7 +187,7 @@ void do_last_file(void);
|
||||
char *striponedir(const char *path);
|
||||
#endif
|
||||
|
||||
/* All functions in chars.c. */
|
||||
/* Most functions in chars.c. */
|
||||
#ifdef ENABLE_UTF8
|
||||
void utf8_init(void);
|
||||
bool using_utf8(void);
|
||||
@@ -177,22 +200,17 @@ bool nisblank(int c);
|
||||
bool niswblank(wchar_t wc);
|
||||
#endif
|
||||
bool is_byte(int c);
|
||||
bool is_alpha_mbchar(const char *c);
|
||||
bool is_alnum_mbchar(const char *c);
|
||||
bool is_blank_mbchar(const char *c);
|
||||
bool is_ascii_cntrl_char(int c);
|
||||
bool is_cntrl_char(int c);
|
||||
#ifdef ENABLE_UTF8
|
||||
bool is_cntrl_wchar(wchar_t wc);
|
||||
#endif
|
||||
bool is_cntrl_mbchar(const char *c);
|
||||
bool is_punct_mbchar(const char *c);
|
||||
bool is_word_mbchar(const char *c, bool allow_punct);
|
||||
char control_rep(char c);
|
||||
#ifdef ENABLE_UTF8
|
||||
wchar_t control_wrep(wchar_t c);
|
||||
#endif
|
||||
char *control_mbrep(const char *c, char *crep, int *crep_len);
|
||||
char *mbrep(const char *c, char *crep, int *crep_len);
|
||||
char control_rep(const signed char c);
|
||||
char control_mbrep(const char *c, bool isdata);
|
||||
int length_of_char(const char *c, int *width);
|
||||
int mbwidth(const char *c);
|
||||
int mb_cur_max(void);
|
||||
char *make_mbchar(long chr, int *chr_mb_len);
|
||||
@@ -211,16 +229,12 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n);
|
||||
char *nstrcasestr(const char *haystack, const char *needle);
|
||||
#endif
|
||||
char *mbstrcasestr(const char *haystack, const char *needle);
|
||||
#if !defined(NANO_TINY) || !defined(DISABLE_TABCOMP)
|
||||
char *revstrstr(const char *haystack, const char *needle, const char
|
||||
*rev_start);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
char *revstrstr(const char *haystack, const char *needle,
|
||||
const char *pointer);
|
||||
char *revstrcasestr(const char *haystack, const char *needle, const char
|
||||
*rev_start);
|
||||
char *mbrevstrcasestr(const char *haystack, const char *needle, const
|
||||
char *rev_start);
|
||||
#endif
|
||||
size_t mbstrlen(const char *s);
|
||||
#ifndef HAVE_STRNLEN
|
||||
size_t nstrnlen(const char *s, size_t maxlen);
|
||||
@@ -247,12 +261,12 @@ bool is_valid_unicode(wchar_t wc);
|
||||
bool is_valid_mbstring(const char *s);
|
||||
#endif
|
||||
|
||||
/* All functions in color.c. */
|
||||
/* Most functions in color.c. */
|
||||
#ifndef DISABLE_COLOR
|
||||
void set_colorpairs(void);
|
||||
void color_init(void);
|
||||
void color_update(void);
|
||||
void reset_multis(filestruct *fileptr, bool force);
|
||||
void check_the_multis(filestruct *line);
|
||||
void alloc_multidata_if_needed(filestruct *fileptr);
|
||||
void precalc_multicolorinfo(void);
|
||||
#endif
|
||||
@@ -262,17 +276,11 @@ void cutbuffer_reset(void);
|
||||
bool keeping_cutbuffer(void);
|
||||
void cut_line(void);
|
||||
#ifndef NANO_TINY
|
||||
void cut_marked(void);
|
||||
void cut_marked(bool *right_side_up);
|
||||
void cut_to_eol(void);
|
||||
void cut_to_eof(void);
|
||||
#endif
|
||||
void do_cut_text(
|
||||
#ifndef NANO_TINY
|
||||
bool copy_text, bool cut_till_eof
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
void do_cut_text(bool copy_text, bool cut_till_eof);
|
||||
void do_cut_text_void(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_copy_text(void);
|
||||
@@ -289,22 +297,15 @@ void replace_buffer(const char *filename);
|
||||
#endif
|
||||
void display_buffer(void);
|
||||
#ifndef DISABLE_MULTIBUFFER
|
||||
void switch_to_prevnext_buffer(bool next, bool quiet);
|
||||
void switch_to_prev_buffer_void(void);
|
||||
void switch_to_next_buffer_void(void);
|
||||
bool close_buffer(bool quiet);
|
||||
bool close_buffer(void);
|
||||
#endif
|
||||
filestruct *read_line(char *buf, size_t buf_len, filestruct *prevnode);
|
||||
void read_file(FILE *f, int fd, const char *filename, bool undoable, bool checkwritable);
|
||||
void read_file(FILE *f, int fd, const char *filename, bool undoable,
|
||||
bool checkwritable);
|
||||
int open_file(const char *filename, bool newfie, bool quiet, FILE **f);
|
||||
char *get_next_filename(const char *name, const char *suffix);
|
||||
void do_insertfile(
|
||||
#ifndef NANO_TINY
|
||||
bool execute
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
void do_insertfile_void(void);
|
||||
char *get_full_path(const char *origpath);
|
||||
char *check_writable_directory(const char *path);
|
||||
@@ -319,11 +320,11 @@ int delete_lockfile(const char *lockfilename);
|
||||
int write_lockfile(const char *lockfilename, const char *origfilename, bool modified);
|
||||
#endif
|
||||
int copy_file(FILE *inn, FILE *out);
|
||||
bool write_file(const char *name, FILE *f_open, bool tmp, append_type
|
||||
append, bool nonamechange);
|
||||
bool write_file(const char *name, FILE *f_open, bool tmp,
|
||||
kind_of_writing_type method, bool nonamechange);
|
||||
#ifndef NANO_TINY
|
||||
bool write_marked_file(const char *name, FILE *f_open, bool tmp,
|
||||
append_type append);
|
||||
kind_of_writing_type method);
|
||||
#endif
|
||||
int do_writeout(bool exiting);
|
||||
void do_writeout_void(void);
|
||||
@@ -341,29 +342,28 @@ char **username_tab_completion(const char *buf, size_t *num_matches,
|
||||
size_t buf_len);
|
||||
char **cwd_tab_completion(const char *buf, bool allow_files, size_t
|
||||
*num_matches, size_t buf_len);
|
||||
char *input_tab(char *buf, bool allow_files, size_t *place, bool
|
||||
*lastwastab, void (*refresh_func)(void), bool *list);
|
||||
char *input_tab(char *buf, bool allow_files, size_t *place,
|
||||
bool *lastwastab, void (*refresh_func)(void), bool *listed);
|
||||
#endif
|
||||
const char *tail(const char *foo);
|
||||
const char *tail(const char *path);
|
||||
#ifndef DISABLE_HISTORIES
|
||||
char *histfilename(void);
|
||||
void load_history(void);
|
||||
bool writehist(FILE *hist, filestruct *histhead);
|
||||
bool writehist(FILE *hist, const filestruct *head);
|
||||
void save_history(void);
|
||||
int check_dotnano(void);
|
||||
void load_poshistory(void);
|
||||
void save_poshistory(void);
|
||||
void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos);
|
||||
int check_poshistory(const char *file, ssize_t *line, ssize_t *column);
|
||||
bool has_old_position(const char *file, ssize_t *line, ssize_t *column);
|
||||
#endif
|
||||
|
||||
/* Some functions in global.c. */
|
||||
size_t length_of_list(int menu);
|
||||
key_type strtokeytype(const char *str);
|
||||
const sc *first_sc_for(int menu, void (*func)(void));
|
||||
int sc_seq_or(void (*func)(void), int defaultval);
|
||||
int the_code_for(void (*func)(void), int defaultval);
|
||||
functionptrtype func_from_key(int *kbinput);
|
||||
void assign_keyinfo(sc *s);
|
||||
void assign_keyinfo(sc *s, const char *keystring, const int keycode);
|
||||
void print_sclist(void);
|
||||
void shortcut_init(void);
|
||||
#ifndef DISABLE_COLOR
|
||||
@@ -398,34 +398,21 @@ void do_para_begin_void(void);
|
||||
void do_para_end(bool allow_update);
|
||||
void do_para_end_void(void);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
bool do_next_word(bool allow_punct, bool allow_update);
|
||||
void do_next_word_void(void);
|
||||
void do_prev_block(void);
|
||||
void do_next_block(void);
|
||||
void do_prev_word(bool allow_punct, bool allow_update);
|
||||
void do_prev_word_void(void);
|
||||
#endif
|
||||
bool do_next_word(bool allow_punct, bool allow_update);
|
||||
void do_next_word_void(void);
|
||||
void ensure_line_is_visible(void);
|
||||
void do_home(void);
|
||||
void do_end(void);
|
||||
void do_up(
|
||||
#ifndef NANO_TINY
|
||||
bool scroll_only
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
void do_up(bool scroll_only);
|
||||
void do_up_void(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_scroll_up(void);
|
||||
#endif
|
||||
void do_down(
|
||||
#ifndef NANO_TINY
|
||||
bool scroll_only
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
void do_down(bool scroll_only);
|
||||
void do_down_void(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_scroll_up(void);
|
||||
void do_scroll_down(void);
|
||||
#endif
|
||||
void do_left(void);
|
||||
@@ -443,17 +430,13 @@ void renumber(filestruct *fileptr);
|
||||
partition *partition_filestruct(filestruct *top, size_t top_x,
|
||||
filestruct *bot, size_t bot_x);
|
||||
void unpartition_filestruct(partition **p);
|
||||
void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
|
||||
void extract_buffer(filestruct **file_top, filestruct **file_bot,
|
||||
filestruct *top, size_t top_x, filestruct *bot, size_t bot_x);
|
||||
void copy_from_filestruct(filestruct *somebuffer);
|
||||
void ingraft_buffer(filestruct *somebuffer);
|
||||
void copy_from_buffer(filestruct *somebuffer);
|
||||
openfilestruct *make_new_opennode(void);
|
||||
void splice_opennode(openfilestruct *begin, openfilestruct *newnode,
|
||||
openfilestruct *end);
|
||||
void unlink_opennode(openfilestruct *fileptr);
|
||||
void delete_opennode(openfilestruct *fileptr);
|
||||
#ifdef DEBUG
|
||||
void free_openfilestruct(openfilestruct *src);
|
||||
#endif
|
||||
void print_view_warning(void);
|
||||
void show_restricted_warning(void);
|
||||
#ifdef DISABLE_HELP
|
||||
@@ -461,11 +444,7 @@ void say_there_is_no_help(void);
|
||||
#endif
|
||||
void finish(void);
|
||||
void die(const char *msg, ...);
|
||||
void die_save_file(const char *die_filename
|
||||
#ifndef NANO_TINY
|
||||
, struct stat *die_stat
|
||||
#endif
|
||||
);
|
||||
void die_save_file(const char *die_filename, struct stat *die_stat);
|
||||
void window_init(void);
|
||||
#ifndef DISABLE_MOUSE
|
||||
void disable_mouse_support(void);
|
||||
@@ -479,9 +458,6 @@ void print_opt_full(const char *shortflag
|
||||
, const char *desc);
|
||||
void usage(void);
|
||||
void version(void);
|
||||
int more_space(void);
|
||||
int no_help(void);
|
||||
void no_current_file_name_warning(void);
|
||||
void do_exit(void);
|
||||
void close_and_go(void);
|
||||
void signal_init(void);
|
||||
@@ -493,32 +469,25 @@ RETSIGTYPE handle_sigwinch(int signal);
|
||||
void regenerate_screen(void);
|
||||
void allow_sigwinch(bool allow);
|
||||
void do_toggle(int flag);
|
||||
#endif
|
||||
void do_toggle_void(void);
|
||||
void disable_extended_io(void);
|
||||
#ifdef USE_SLANG
|
||||
void disable_signals(void);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
void enable_signals(void);
|
||||
#endif
|
||||
void disable_flow_control(void);
|
||||
void enable_flow_control(void);
|
||||
void terminal_init(void);
|
||||
void unbound_key(int code);
|
||||
int do_input(bool allow_funcs);
|
||||
#ifndef DISABLE_MOUSE
|
||||
int do_mouse(void);
|
||||
#endif
|
||||
void do_output(char *output, size_t output_len, bool allow_cntrls);
|
||||
|
||||
/* All functions in prompt.c. */
|
||||
int do_statusbar_input(bool *ran_func, bool *finished,
|
||||
void (*refresh_func)(void));
|
||||
/* Most functions in prompt.c. */
|
||||
#ifndef DISABLE_MOUSE
|
||||
int do_statusbar_mouse(void);
|
||||
#endif
|
||||
void do_statusbar_output(char *output, size_t output_len, bool
|
||||
*got_enter, bool allow_cntrls);
|
||||
void do_statusbar_output(int *the_input, size_t input_len,
|
||||
bool filtering);
|
||||
void do_statusbar_home(void);
|
||||
void do_statusbar_end(void);
|
||||
void do_statusbar_left(void);
|
||||
@@ -527,36 +496,21 @@ void do_statusbar_backspace(void);
|
||||
void do_statusbar_delete(void);
|
||||
void do_statusbar_cut_text(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_statusbar_next_word(void);
|
||||
void do_statusbar_prev_word(void);
|
||||
void do_statusbar_next_word(void);
|
||||
#endif
|
||||
void do_statusbar_verbatim_input(bool *got_enter);
|
||||
void do_statusbar_verbatim_input(void);
|
||||
size_t statusbar_xplustabs(void);
|
||||
size_t get_statusbar_page_start(size_t start_col, size_t column);
|
||||
void reinit_statusbar_x(void);
|
||||
void reset_statusbar_cursor(void);
|
||||
void update_the_statusbar(void);
|
||||
void update_bar_if_needed(void);
|
||||
void total_statusbar_refresh(void (*refresh_func)(void));
|
||||
functionptrtype get_prompt_string(int *value, bool allow_tabs,
|
||||
#ifndef DISABLE_TABCOMP
|
||||
bool allow_files,
|
||||
bool *list,
|
||||
#endif
|
||||
const char *curranswer,
|
||||
#ifndef DISABLE_HISTORIES
|
||||
filestruct **history_list,
|
||||
#endif
|
||||
void (*refresh_func)(void));
|
||||
int do_prompt(bool allow_tabs,
|
||||
#ifndef DISABLE_TABCOMP
|
||||
bool allow_files,
|
||||
#endif
|
||||
int do_prompt(bool allow_tabs, bool allow_files,
|
||||
int menu, const char *curranswer,
|
||||
#ifndef DISABLE_HISTORIES
|
||||
filestruct **history_list,
|
||||
#endif
|
||||
void (*refresh_func)(void), const char *msg, ...);
|
||||
void do_prompt_abort(void);
|
||||
int do_yesno_prompt(bool all, const char *msg);
|
||||
|
||||
/* Most functions in rcfile.c. */
|
||||
@@ -564,23 +518,12 @@ int do_yesno_prompt(bool all, const char *msg);
|
||||
char *parse_next_word(char *ptr);
|
||||
#endif
|
||||
#ifndef DISABLE_NANORC
|
||||
void rcfile_error(const char *msg, ...);
|
||||
char *parse_argument(char *ptr);
|
||||
#ifndef DISABLE_COLOR
|
||||
char *parse_next_regex(char *ptr);
|
||||
bool nregcomp(const char *regex, int eflags);
|
||||
void parse_syntax(char *ptr);
|
||||
void parse_include(char *ptr);
|
||||
short color_to_short(const char *colorname, bool *bright);
|
||||
void parse_colors(char *ptr, bool icase);
|
||||
bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright);
|
||||
void grab_and_store(const char *kind, char *ptr, regexlisttype **storage);
|
||||
#endif
|
||||
void parse_rcfile(FILE *rcstream
|
||||
#ifndef DISABLE_COLOR
|
||||
, bool syntax_only
|
||||
#endif
|
||||
);
|
||||
void do_rcfile(void);
|
||||
void parse_rcfile(FILE *rcstream, bool syntax_only);
|
||||
void do_rcfiles(void);
|
||||
#endif /* !DISABLE_NANORC */
|
||||
|
||||
/* All functions in search.c. */
|
||||
@@ -591,31 +534,21 @@ void regexp_cleanup(void);
|
||||
void not_found_msg(const char *str);
|
||||
void search_replace_abort(void);
|
||||
int search_init(bool replacing, bool use_answer);
|
||||
bool findnextstr(
|
||||
#ifndef DISABLE_SPELLER
|
||||
bool whole_word_only,
|
||||
#endif
|
||||
const filestruct *begin, size_t begin_x,
|
||||
const char *needle, size_t *needle_len);
|
||||
void findnextstr_wrap_reset(void);
|
||||
int findnextstr(const char *needle, bool whole_word_only, bool have_region,
|
||||
size_t *match_len, bool skipone, const filestruct *begin, size_t begin_x);
|
||||
void do_search(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_findprevious(void);
|
||||
void do_findnext(void);
|
||||
#endif
|
||||
#if !defined(NANO_TINY) || !defined(DISABLE_BROWSER)
|
||||
void do_research(void);
|
||||
#endif
|
||||
void go_looking(void);
|
||||
#ifdef HAVE_REGEX_H
|
||||
int replace_regexp(char *string, bool create);
|
||||
#endif
|
||||
char *replace_line(const char *needle);
|
||||
ssize_t do_replace_loop(
|
||||
#ifndef DISABLE_SPELLER
|
||||
bool whole_word_only,
|
||||
#endif
|
||||
bool *canceled, const filestruct *real_current, size_t
|
||||
*real_current_x, const char *needle);
|
||||
ssize_t do_replace_loop(const char *needle, bool whole_word_only,
|
||||
const filestruct *real_current, size_t *real_current_x);
|
||||
void do_replace(void);
|
||||
void goto_line_posx(ssize_t line, size_t pos_x);
|
||||
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
||||
@@ -625,7 +558,7 @@ void do_gotolinecolumn_void(void);
|
||||
bool find_bracket_match(bool reverse, const char *bracket_set);
|
||||
void do_find_bracket(void);
|
||||
#ifndef DISABLE_TABCOMP
|
||||
char *get_history_completion(filestruct **h, const char *s, size_t len);
|
||||
char *get_history_completion(filestruct **h, char *s, size_t len);
|
||||
#endif
|
||||
#endif
|
||||
#ifndef DISABLE_HISTORIES
|
||||
@@ -656,14 +589,25 @@ void do_tab(void);
|
||||
void do_indent(ssize_t cols);
|
||||
void do_indent_void(void);
|
||||
void do_unindent(void);
|
||||
#endif
|
||||
bool white_string(const char *s);
|
||||
#ifdef ENABLE_COMMENT
|
||||
void do_comment(void);
|
||||
bool comment_line(undo_type action, filestruct *f, const char *comment_seq);
|
||||
#endif
|
||||
void do_undo(void);
|
||||
void do_redo(void);
|
||||
#endif
|
||||
void do_enter(void);
|
||||
#ifndef NANO_TINY
|
||||
RETSIGTYPE cancel_command(int signal);
|
||||
bool execute_command(const char *command);
|
||||
void discard_until(const undo *thisitem, openfilestruct *thefile);
|
||||
void add_undo(undo_type action);
|
||||
#ifndef DISABLE_COMMENT
|
||||
void update_comment_undo(ssize_t lineno);
|
||||
#endif
|
||||
void update_undo(undo_type action);
|
||||
#endif /* !NANO_TINY */
|
||||
#ifndef DISABLE_WRAPPING
|
||||
void wrap_reset(void);
|
||||
bool do_wrap(filestruct *line);
|
||||
@@ -707,12 +651,16 @@ void do_formatter(void);
|
||||
void do_wordlinechar_count(void);
|
||||
#endif
|
||||
void do_verbatim_input(void);
|
||||
void complete_a_word(void);
|
||||
|
||||
/* All functions in utils.c. */
|
||||
void get_homedir(void);
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
int digits(ssize_t n);
|
||||
#endif
|
||||
bool parse_num(const char *str, ssize_t *val);
|
||||
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column);
|
||||
void align(char **str);
|
||||
void snuggly_fit(char **str);
|
||||
void null_at(char **data, size_t index);
|
||||
void unsunder(char *str, size_t true_len);
|
||||
void sunder(char *str);
|
||||
@@ -728,7 +676,7 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream);
|
||||
const char *fixbounds(const char *r);
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
bool is_whole_word(size_t pos, const char *buf, const char *word);
|
||||
bool is_separate_word(size_t position, size_t length, const char *buf);
|
||||
#endif
|
||||
const char *strstrwrapper(const char *haystack, const char *needle,
|
||||
const char *start);
|
||||
@@ -737,7 +685,7 @@ void *nmalloc(size_t howmuch);
|
||||
void *nrealloc(void *ptr, size_t howmuch);
|
||||
char *mallocstrncpy(char *dest, const char *src, size_t n);
|
||||
char *mallocstrcpy(char *dest, const char *src);
|
||||
char *mallocstrassn(char *dest, char *src);
|
||||
char *free_and_assign(char *dest, char *src);
|
||||
size_t get_page_start(size_t column);
|
||||
size_t xplustabs(void);
|
||||
size_t actual_x(const char *s, size_t column);
|
||||
@@ -748,12 +696,11 @@ void new_magicline(void);
|
||||
void remove_magicline(void);
|
||||
void mark_order(const filestruct **top, size_t *top_x, const filestruct
|
||||
**bot, size_t *bot_x, bool *right_side_up);
|
||||
void discard_until(const undo *thisitem, openfilestruct *thefile);
|
||||
void add_undo(undo_type action);
|
||||
void update_undo(undo_type action);
|
||||
#endif
|
||||
size_t get_totsize(const filestruct *begin, const filestruct *end);
|
||||
#ifndef NANO_TINY
|
||||
filestruct *fsfromline(ssize_t lineno);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
void dump_filestruct(const filestruct *inptr);
|
||||
void dump_filestruct_reverse(void);
|
||||
@@ -763,7 +710,7 @@ void dump_filestruct_reverse(void);
|
||||
void get_key_buffer(WINDOW *win);
|
||||
size_t get_key_buffer_len(void);
|
||||
void unget_input(int *input, size_t input_len);
|
||||
void unget_kbinput(int kbinput, bool metakey, bool funckey);
|
||||
void unget_kbinput(int kbinput, bool metakey);
|
||||
int *get_input(WINDOW *win, size_t input_len);
|
||||
int get_kbinput(WINDOW *win);
|
||||
int parse_kbinput(WINDOW *win);
|
||||
@@ -772,45 +719,46 @@ int parse_escape_sequence(WINDOW *win, int kbinput);
|
||||
int get_byte_kbinput(int kbinput);
|
||||
#ifdef ENABLE_UTF8
|
||||
long add_unicode_digit(int kbinput, long factor, long *uni);
|
||||
long get_unicode_kbinput(int kbinput);
|
||||
long get_unicode_kbinput(WINDOW *win, int kbinput);
|
||||
#endif
|
||||
int get_control_kbinput(int kbinput);
|
||||
void unparse_kbinput(char *output, size_t output_len);
|
||||
int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
|
||||
int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
|
||||
int *parse_verbatim_kbinput(WINDOW *win, size_t *count);
|
||||
#ifndef DISABLE_MOUSE
|
||||
int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
|
||||
#endif
|
||||
const sc *get_shortcut(int *kbinput);
|
||||
void blank_line(WINDOW *win, int y, int x, int n);
|
||||
void blank_row(WINDOW *win, int y, int x, int n);
|
||||
void blank_titlebar(void);
|
||||
void blank_topbar(void);
|
||||
void blank_edit(void);
|
||||
void blank_statusbar(void);
|
||||
void blank_bottombars(void);
|
||||
void check_statusblank(void);
|
||||
char *display_string(const char *buf, size_t start_col, size_t len, bool
|
||||
dollars);
|
||||
char *display_string(const char *buf, size_t start_col, size_t span,
|
||||
bool dollars);
|
||||
void titlebar(const char *path);
|
||||
extern void set_modified(void);
|
||||
void statusbar(const char *msg, ...);
|
||||
void statusbar(const char *msg);
|
||||
void warn_and_shortly_pause(const char *msg);
|
||||
void statusline(message_type importance, const char *msg, ...);
|
||||
void bottombars(int menu);
|
||||
void onekey(const char *keystroke, const char *desc, size_t len);
|
||||
void onekey(const char *keystroke, const char *desc, int length);
|
||||
void reset_cursor(void);
|
||||
void edit_draw(filestruct *fileptr, const char *converted, int
|
||||
line, size_t start);
|
||||
void edit_draw(filestruct *fileptr, const char *converted,
|
||||
int line, size_t from_col);
|
||||
int update_line(filestruct *fileptr, size_t index);
|
||||
bool need_screen_update(size_t pww_save);
|
||||
void edit_scroll(scroll_dir direction, ssize_t nlines);
|
||||
void edit_redraw(filestruct *old_current, size_t pww_save);
|
||||
bool need_horizontal_scroll(const size_t old_column, const size_t new_column);
|
||||
void edit_scroll(scroll_dir direction, int nrows);
|
||||
void edit_redraw(filestruct *old_current);
|
||||
void edit_refresh(void);
|
||||
void edit_update(update_type location);
|
||||
void adjust_viewport(update_type location);
|
||||
void total_redraw(void);
|
||||
void total_refresh(void);
|
||||
void display_main_list(void);
|
||||
void do_cursorpos(bool constant);
|
||||
void do_cursorpos_void(void);
|
||||
void do_replace_highlight(bool highlight, const char *word);
|
||||
void spotlight(bool active, const char *word);
|
||||
void xon_complaint(void);
|
||||
void xoff_complaint(void);
|
||||
void do_suspend_void(void);
|
||||
|
||||
1101
src/rcfile.c
1101
src/rcfile.c
File diff suppressed because it is too large
Load Diff
960
src/search.c
960
src/search.c
File diff suppressed because it is too large
Load Diff
1181
src/text.c
1181
src/text.c
File diff suppressed because it is too large
Load Diff
432
src/utils.c
432
src/utils.c
@@ -1,23 +1,22 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* utils.c *
|
||||
* utils.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
|
||||
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 3, or (at your option) *
|
||||
* any later version. *
|
||||
* Copyright (C) 2016 Benno Schulenberg *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
* by the Free Software Foundation, either version 3 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* GNU nano is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty *
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
@@ -53,69 +52,93 @@ void get_homedir(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Read a ssize_t from str, and store it in *val (if val is not NULL).
|
||||
* On error, we return FALSE and don't change *val. Otherwise, we
|
||||
* return TRUE. */
|
||||
bool parse_num(const char *str, ssize_t *val)
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
/* Return the number of digits that the given integer n takes up. */
|
||||
int digits(ssize_t n)
|
||||
{
|
||||
if (n < 100000) {
|
||||
if (n < 1000) {
|
||||
if (n < 100)
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
} else {
|
||||
if (n < 10000)
|
||||
return 4;
|
||||
else
|
||||
return 5;
|
||||
}
|
||||
} else {
|
||||
if (n < 10000000) {
|
||||
if (n < 1000000)
|
||||
return 6;
|
||||
else
|
||||
return 7;
|
||||
}
|
||||
else {
|
||||
if (n < 100000000)
|
||||
return 8;
|
||||
else
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Read an integer from str. If it parses okay, store it in *result
|
||||
* and return TRUE; otherwise, return FALSE. */
|
||||
bool parse_num(const char *str, ssize_t *result)
|
||||
{
|
||||
char *first_error;
|
||||
ssize_t j;
|
||||
ssize_t value;
|
||||
|
||||
assert(str != NULL);
|
||||
|
||||
/* The manual page for strtol() says this is required, and
|
||||
* it looks like it is! */
|
||||
/* The manual page for strtol() says this is required. */
|
||||
errno = 0;
|
||||
|
||||
j = (ssize_t)strtol(str, &first_error, 10);
|
||||
value = (ssize_t)strtol(str, &first_error, 10);
|
||||
|
||||
if (errno == ERANGE || *str == '\0' || *first_error != '\0')
|
||||
return FALSE;
|
||||
|
||||
if (val != NULL)
|
||||
*val = j;
|
||||
*result = value;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Read two ssize_t's, separated by a comma, from str, and store them in
|
||||
* *line and *column (if they're not both NULL). Return FALSE on error,
|
||||
* or TRUE otherwise. */
|
||||
/* Read two numbers, separated by a comma, from str, and store them in
|
||||
* *line and *column. Return FALSE on error, and TRUE otherwise. */
|
||||
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column)
|
||||
{
|
||||
bool retval = TRUE;
|
||||
bool retval;
|
||||
char *firstpart;
|
||||
const char *comma;
|
||||
|
||||
assert(str != NULL);
|
||||
while (*str == ' ')
|
||||
str++;
|
||||
|
||||
comma = strchr(str, ',');
|
||||
comma = strpbrk(str, "m,. /;");
|
||||
|
||||
if (comma != NULL && column != NULL) {
|
||||
if (!parse_num(comma + 1, column))
|
||||
retval = FALSE;
|
||||
}
|
||||
if (comma == NULL)
|
||||
return parse_num(str, line);
|
||||
|
||||
if (line != NULL) {
|
||||
if (comma != NULL) {
|
||||
char *str_line = mallocstrncpy(NULL, str, comma - str + 1);
|
||||
str_line[comma - str] = '\0';
|
||||
retval = parse_num(comma + 1, column);
|
||||
|
||||
if (str_line[0] != '\0' && !parse_num(str_line, line))
|
||||
retval = FALSE;
|
||||
if (comma == str)
|
||||
return retval;
|
||||
|
||||
free(str_line);
|
||||
} else if (!parse_num(str, line))
|
||||
retval = FALSE;
|
||||
}
|
||||
firstpart = mallocstrcpy(NULL, str);
|
||||
firstpart[comma - str] = '\0';
|
||||
|
||||
retval = parse_num(firstpart, line) && retval;
|
||||
|
||||
free(firstpart);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* Fix the memory allocation for a string. */
|
||||
void align(char **str)
|
||||
/* Reduce the memory allocation of a string to what is needed. */
|
||||
void snuggly_fit(char **str)
|
||||
{
|
||||
assert(str != NULL);
|
||||
|
||||
if (*str != NULL)
|
||||
*str = charealloc(*str, strlen(*str) + 1);
|
||||
}
|
||||
@@ -123,8 +146,6 @@ void align(char **str)
|
||||
/* Null a string at a certain index and align it. */
|
||||
void null_at(char **data, size_t index)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
*data = charealloc(*data, index + 1);
|
||||
(*data)[index] = '\0';
|
||||
}
|
||||
@@ -133,8 +154,6 @@ void null_at(char **data, size_t index)
|
||||
* normally have newlines in it, so encode its nulls as newlines. */
|
||||
void unsunder(char *str, size_t true_len)
|
||||
{
|
||||
assert(str != NULL);
|
||||
|
||||
for (; true_len > 0; true_len--, str++) {
|
||||
if (*str == '\0')
|
||||
*str = '\n';
|
||||
@@ -145,8 +164,6 @@ void unsunder(char *str, size_t true_len)
|
||||
* normally have newlines in it, so decode its newlines as nulls. */
|
||||
void sunder(char *str)
|
||||
{
|
||||
assert(str != NULL);
|
||||
|
||||
for (; *str != '\0'; str++) {
|
||||
if (*str == '\n')
|
||||
*str = '\0';
|
||||
@@ -279,93 +296,95 @@ const char *fixbounds(const char *r)
|
||||
#endif /* HAVE_REGEX_H */
|
||||
|
||||
#ifndef DISABLE_SPELLER
|
||||
/* Is the word starting at position pos in buf a whole word? */
|
||||
bool is_whole_word(size_t pos, const char *buf, const char *word)
|
||||
/* Is the word starting at the given position in buf and of the given length
|
||||
* a separate word? That is: is it not part of a longer word?*/
|
||||
bool is_separate_word(size_t position, size_t length, const char *buf)
|
||||
{
|
||||
char *p = charalloc(mb_cur_max()), *r = charalloc(mb_cur_max());
|
||||
size_t word_end = pos + strlen(word);
|
||||
bool retval;
|
||||
char before[mb_cur_max()], after[mb_cur_max()];
|
||||
size_t word_end = position + length;
|
||||
|
||||
assert(buf != NULL && pos <= strlen(buf) && word != NULL);
|
||||
/* Get the characters before and after the word, if any. */
|
||||
parse_mbchar(buf + move_mbleft(buf, position), before, NULL);
|
||||
parse_mbchar(buf + word_end, after, NULL);
|
||||
|
||||
parse_mbchar(buf + move_mbleft(buf, pos), p, NULL);
|
||||
parse_mbchar(buf + word_end, r, NULL);
|
||||
|
||||
/* If we're at the beginning of the line or the character before the
|
||||
* word isn't a non-punctuation "word" character, and if we're at
|
||||
* the end of the line or the character after the word isn't a
|
||||
* non-punctuation "word" character, we have a whole word. */
|
||||
retval = (pos == 0 || !is_word_mbchar(p, FALSE)) &&
|
||||
(word_end == strlen(buf) || !is_word_mbchar(r, FALSE));
|
||||
|
||||
free(p);
|
||||
free(r);
|
||||
|
||||
return retval;
|
||||
/* If the word starts at the beginning of the line OR the character before
|
||||
* the word isn't a letter, and if the word ends at the end of the line OR
|
||||
* the character after the word isn't a letter, we have a whole word. */
|
||||
return ((position == 0 || !is_alpha_mbchar(before)) &&
|
||||
(buf[word_end] == '\0' || !is_alpha_mbchar(after)));
|
||||
}
|
||||
#endif /* !DISABLE_SPELLER */
|
||||
|
||||
/* If we are searching backwards, we will find the last match that
|
||||
* starts no later than start. Otherwise we find the first match
|
||||
* starting no earlier than start. If we are doing a regexp search, we
|
||||
* fill in the global variable regmatches with at most 9 subexpression
|
||||
* matches. Also, all .rm_so elements are relative to the start of the
|
||||
* whole match, so regmatches[0].rm_so == 0. */
|
||||
/* Return the position of the needle in the haystack, or NULL if not found.
|
||||
* When searching backwards, we will find the last match that starts no later
|
||||
* than the given start; otherwise, we find the first match starting no earlier
|
||||
* than start. If we are doing a regexp search, and we find a match, we fill
|
||||
* in the global variable regmatches with at most 9 subexpression matches. */
|
||||
const char *strstrwrapper(const char *haystack, const char *needle,
|
||||
const char *start)
|
||||
{
|
||||
/* start can be 1 character before the start or after the end of the
|
||||
* line. In either case, we just say no match was found. */
|
||||
if ((start > haystack && *(start - 1) == '\0') || start < haystack)
|
||||
return NULL;
|
||||
|
||||
assert(haystack != NULL && needle != NULL && start != NULL);
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP)) {
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(BACKWARDS_SEARCH)) {
|
||||
if (regexec(&search_regexp, haystack, 1, regmatches,
|
||||
0) == 0 && haystack + regmatches[0].rm_so <= start) {
|
||||
const char *retval = haystack + regmatches[0].rm_so;
|
||||
size_t last_find, ceiling, far_end;
|
||||
size_t floor = 0, next_rung = 0;
|
||||
/* The start of the search range, and the next start. */
|
||||
|
||||
/* Search forward until there are no more matches. */
|
||||
while (regexec(&search_regexp, retval + 1, 1,
|
||||
regmatches, REG_NOTBOL) == 0 &&
|
||||
retval + regmatches[0].rm_so + 1 <= start)
|
||||
retval += regmatches[0].rm_so + 1;
|
||||
/* Finally, put the subexpression matches in global
|
||||
* variable regmatches. The REG_NOTBOL flag doesn't
|
||||
* matter now. */
|
||||
regexec(&search_regexp, retval, 10, regmatches, 0);
|
||||
return retval;
|
||||
if (regexec(&search_regexp, haystack, 1, regmatches, 0) != 0)
|
||||
return NULL;
|
||||
|
||||
far_end = strlen(haystack);
|
||||
ceiling = start - haystack;
|
||||
last_find = regmatches[0].rm_so;
|
||||
|
||||
/* A result beyond the search range also means: no match. */
|
||||
if (last_find > ceiling)
|
||||
return NULL;
|
||||
|
||||
/* Move the start-of-range forward until there is no more match;
|
||||
* then the last match found is the first match backwards. */
|
||||
while (regmatches[0].rm_so <= ceiling) {
|
||||
floor = next_rung;
|
||||
last_find = regmatches[0].rm_so;
|
||||
/* If this is the last possible match, don't try to advance. */
|
||||
if (last_find == ceiling)
|
||||
break;
|
||||
next_rung = move_mbright(haystack, last_find);
|
||||
regmatches[0].rm_so = next_rung;
|
||||
regmatches[0].rm_eo = far_end;
|
||||
if (regexec(&search_regexp, haystack, 1, regmatches,
|
||||
REG_STARTEND) != 0)
|
||||
break;
|
||||
}
|
||||
} else
|
||||
#endif /* !NANO_TINY */
|
||||
if (regexec(&search_regexp, start, 10, regmatches,
|
||||
(start > haystack) ? REG_NOTBOL : 0) == 0) {
|
||||
const char *retval = start + regmatches[0].rm_so;
|
||||
|
||||
regexec(&search_regexp, retval, 10, regmatches, 0);
|
||||
return retval;
|
||||
/* Find the last match again, to get possible submatches. */
|
||||
regmatches[0].rm_so = floor;
|
||||
regmatches[0].rm_eo = far_end;
|
||||
if (regexec(&search_regexp, haystack, 10, regmatches,
|
||||
REG_STARTEND) != 0)
|
||||
statusline(ALERT, "BAD: failed to refind the match!");
|
||||
|
||||
return haystack + regmatches[0].rm_so;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
/* Do a forward regex search from the starting point. */
|
||||
regmatches[0].rm_so = start - haystack;
|
||||
regmatches[0].rm_eo = strlen(haystack);
|
||||
if (regexec(&search_regexp, haystack, 10, regmatches,
|
||||
REG_STARTEND) != 0)
|
||||
return NULL;
|
||||
else
|
||||
return haystack + regmatches[0].rm_so;
|
||||
}
|
||||
#endif /* HAVE_REGEX_H */
|
||||
#if !defined(NANO_TINY) || !defined(DISABLE_SPELLER)
|
||||
if (ISSET(CASE_SENSITIVE)) {
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(BACKWARDS_SEARCH))
|
||||
return revstrstr(haystack, needle, start);
|
||||
else
|
||||
#endif
|
||||
return strstr(start, needle);
|
||||
}
|
||||
#endif /* !DISABLE_SPELLER || !NANO_TINY */
|
||||
#ifndef NANO_TINY
|
||||
else if (ISSET(BACKWARDS_SEARCH))
|
||||
} else if (ISSET(BACKWARDS_SEARCH))
|
||||
return mbrevstrcasestr(haystack, needle, start);
|
||||
#endif
|
||||
|
||||
return mbstrcasestr(start, needle);
|
||||
}
|
||||
|
||||
@@ -405,8 +424,8 @@ void *nrealloc(void *ptr, size_t howmuch)
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Copy the first n characters of one malloc()ed string to another
|
||||
* pointer. Should be used as: "dest = mallocstrncpy(dest, src, n);". */
|
||||
/* Allocate and copy the first n characters of the given src string, after
|
||||
* freeing the destination. Usage: "dest = mallocstrncpy(dest, src, n);". */
|
||||
char *mallocstrncpy(char *dest, const char *src, size_t n)
|
||||
{
|
||||
if (src == NULL)
|
||||
@@ -421,17 +440,15 @@ char *mallocstrncpy(char *dest, const char *src, size_t n)
|
||||
return dest;
|
||||
}
|
||||
|
||||
/* Copy one malloc()ed string to another pointer. Should be used as:
|
||||
/* Free the dest string and return a malloc'ed copy of src. Should be used as:
|
||||
* "dest = mallocstrcpy(dest, src);". */
|
||||
char *mallocstrcpy(char *dest, const char *src)
|
||||
{
|
||||
return mallocstrncpy(dest, src, (src == NULL) ? 1 : strlen(src) + 1);
|
||||
}
|
||||
|
||||
/* Free the malloc()ed string at dest and return the malloc()ed string
|
||||
* at src. Should be used as: "answer = mallocstrassn(answer,
|
||||
* real_dir_from_tilde(answer));". */
|
||||
char *mallocstrassn(char *dest, char *src)
|
||||
/* Free the string at dest and return the string at src. */
|
||||
char *free_and_assign(char *dest, char *src)
|
||||
{
|
||||
free(dest);
|
||||
return src;
|
||||
@@ -443,95 +460,78 @@ char *mallocstrassn(char *dest, char *src)
|
||||
* get_page_start(column) < COLS). */
|
||||
size_t get_page_start(size_t column)
|
||||
{
|
||||
if (column == 0 || column < COLS - 1)
|
||||
if (column == 0 || column < editwincols - 1)
|
||||
return 0;
|
||||
else if (COLS > 8)
|
||||
return column - 7 - (column - 7) % (COLS - 8);
|
||||
else if (editwincols > 8)
|
||||
return column - 7 - (column - 7) % (editwincols - 8);
|
||||
else
|
||||
return column - (COLS - 2);
|
||||
return column - (editwincols - 2);
|
||||
}
|
||||
|
||||
/* Return the placewewant associated with current_x, i.e. the zero-based
|
||||
* column position of the cursor. The value will be no smaller than
|
||||
* current_x. */
|
||||
* column position of the cursor. */
|
||||
size_t xplustabs(void)
|
||||
{
|
||||
if (openfile->current)
|
||||
return strnlenpt(openfile->current->data, openfile->current_x);
|
||||
else
|
||||
return 0;
|
||||
return strnlenpt(openfile->current->data, openfile->current_x);
|
||||
}
|
||||
|
||||
/* Return the index in s of the character displayed at the given column,
|
||||
* i.e. the largest value such that strnlenpt(s, actual_x(s, column)) <=
|
||||
* column. */
|
||||
size_t actual_x(const char *s, size_t column)
|
||||
/* Return the index in text of the character that (when displayed) will
|
||||
* not overshoot the given column. */
|
||||
size_t actual_x(const char *text, size_t column)
|
||||
{
|
||||
size_t i = 0;
|
||||
/* The position in s, returned. */
|
||||
size_t len = 0;
|
||||
/* The screen display width to s[i]. */
|
||||
size_t index = 0;
|
||||
/* The index in text, returned. */
|
||||
size_t width = 0;
|
||||
/* The screen display width to text[index], in columns. */
|
||||
|
||||
assert(s != NULL);
|
||||
while (*text != '\0') {
|
||||
int charlen = parse_mbchar(text, NULL, &width);
|
||||
|
||||
while (*s != '\0') {
|
||||
int s_len = parse_mbchar(s, NULL, &len);
|
||||
|
||||
if (len > column)
|
||||
if (width > column)
|
||||
break;
|
||||
|
||||
i += s_len;
|
||||
s += s_len;
|
||||
index += charlen;
|
||||
text += charlen;
|
||||
}
|
||||
|
||||
return i;
|
||||
return index;
|
||||
}
|
||||
|
||||
/* A strnlen() with tabs and multicolumn characters factored in, similar
|
||||
* to xplustabs(). How many columns wide are the first maxlen characters
|
||||
* of s? */
|
||||
size_t strnlenpt(const char *s, size_t maxlen)
|
||||
/* A strnlen() with tabs and multicolumn characters factored in:
|
||||
* how many columns wide are the first maxlen bytes of text? */
|
||||
size_t strnlenpt(const char *text, size_t maxlen)
|
||||
{
|
||||
size_t len = 0;
|
||||
/* The screen display width to s[i]. */
|
||||
size_t width = 0;
|
||||
/* The screen display width to text[maxlen]. */
|
||||
|
||||
if (maxlen == 0)
|
||||
return 0;
|
||||
|
||||
assert(s != NULL);
|
||||
while (*text != '\0') {
|
||||
int charlen = parse_mbchar(text, NULL, &width);
|
||||
|
||||
while (*s != '\0') {
|
||||
int s_len = parse_mbchar(s, NULL, &len);
|
||||
|
||||
s += s_len;
|
||||
|
||||
if (maxlen <= s_len)
|
||||
if (maxlen <= charlen)
|
||||
break;
|
||||
|
||||
maxlen -= s_len;
|
||||
maxlen -= charlen;
|
||||
text += charlen;
|
||||
}
|
||||
|
||||
return len;
|
||||
return width;
|
||||
}
|
||||
|
||||
/* A strlen() with tabs and multicolumn characters factored in, similar
|
||||
* to xplustabs(). How many columns wide is s? */
|
||||
size_t strlenpt(const char *s)
|
||||
/* A strlen() with tabs and multicolumn characters factored in:
|
||||
* how many columns wide is text? */
|
||||
size_t strlenpt(const char *text)
|
||||
{
|
||||
return strnlenpt(s, (size_t)-1);
|
||||
return strnlenpt(text, (size_t)-1);
|
||||
}
|
||||
|
||||
/* Append a new magicline to filebot. */
|
||||
void new_magicline(void)
|
||||
{
|
||||
openfile->filebot->next = (filestruct *)nmalloc(sizeof(filestruct));
|
||||
openfile->filebot->next = make_new_node(openfile->filebot);
|
||||
openfile->filebot->next->data = mallocstrcpy(NULL, "");
|
||||
openfile->filebot->next->prev = openfile->filebot;
|
||||
openfile->filebot->next->next = NULL;
|
||||
openfile->filebot->next->lineno = openfile->filebot->lineno + 1;
|
||||
#ifndef DISABLE_COLOR
|
||||
openfile->filebot->next->multidata = NULL;
|
||||
#endif
|
||||
openfile->filebot = openfile->filebot->next;
|
||||
openfile->totsize++;
|
||||
}
|
||||
@@ -543,9 +543,7 @@ void new_magicline(void)
|
||||
void remove_magicline(void)
|
||||
{
|
||||
if (openfile->filebot->data[0] == '\0' &&
|
||||
openfile->filebot != openfile->fileage) {
|
||||
assert(openfile->filebot != openfile->edittop && openfile->filebot != openfile->current);
|
||||
|
||||
openfile->filebot != openfile->fileage) {
|
||||
openfile->filebot = openfile->filebot->prev;
|
||||
free_filestruct(openfile->filebot->next);
|
||||
openfile->filebot->next = NULL;
|
||||
@@ -561,11 +559,9 @@ void remove_magicline(void)
|
||||
void mark_order(const filestruct **top, size_t *top_x, const filestruct
|
||||
**bot, size_t *bot_x, bool *right_side_up)
|
||||
{
|
||||
assert(top != NULL && top_x != NULL && bot != NULL && bot_x != NULL);
|
||||
|
||||
if ((openfile->current->lineno == openfile->mark_begin->lineno &&
|
||||
openfile->current_x > openfile->mark_begin_x) ||
|
||||
openfile->current->lineno > openfile->mark_begin->lineno) {
|
||||
openfile->current_x > openfile->mark_begin_x) ||
|
||||
openfile->current->lineno > openfile->mark_begin->lineno) {
|
||||
*top = openfile->mark_begin;
|
||||
*top_x = openfile->mark_begin_x;
|
||||
*bot = openfile->current;
|
||||
@@ -581,54 +577,46 @@ void mark_order(const filestruct **top, size_t *top_x, const filestruct
|
||||
*right_side_up = FALSE;
|
||||
}
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Calculate the number of characters between begin and end, and return
|
||||
* it. */
|
||||
size_t get_totsize(const filestruct *begin, const filestruct *end)
|
||||
{
|
||||
size_t totsize = 0;
|
||||
const filestruct *f;
|
||||
|
||||
/* Go through the lines from begin to end->prev, if we can. */
|
||||
for (f = begin; f != end && f != NULL; f = f->next) {
|
||||
/* Count the number of characters on this line. */
|
||||
totsize += mbstrlen(f->data);
|
||||
|
||||
/* Count the newline if we have one. */
|
||||
if (f->next != NULL)
|
||||
totsize++;
|
||||
}
|
||||
|
||||
/* Go through the line at end, if we can. */
|
||||
if (f != NULL) {
|
||||
/* Count the number of characters on this line. */
|
||||
totsize += mbstrlen(f->data);
|
||||
|
||||
/* Count the newline if we have one. */
|
||||
if (f->next != NULL)
|
||||
totsize++;
|
||||
}
|
||||
|
||||
return totsize;
|
||||
}
|
||||
|
||||
/* Get back a pointer given a line number in the current openfilestruct. */
|
||||
/* Given a line number, return a pointer to the corresponding struct. */
|
||||
filestruct *fsfromline(ssize_t lineno)
|
||||
{
|
||||
filestruct *f = openfile->current;
|
||||
|
||||
if (lineno <= openfile->current->lineno)
|
||||
for (; f->lineno != lineno && f != openfile->fileage; f = f->prev)
|
||||
;
|
||||
while (f->lineno != lineno && f->prev != NULL)
|
||||
f = f->prev;
|
||||
else
|
||||
for (; f->lineno != lineno && f->next != NULL; f = f->next)
|
||||
;
|
||||
while (f->lineno != lineno && f->next != NULL)
|
||||
f = f->next;
|
||||
|
||||
if (f->lineno != lineno) {
|
||||
statusline(ALERT, _("Internal error: can't match line %ld. "
|
||||
"Please save your work."), (long)lineno);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (f->lineno != lineno)
|
||||
f = NULL;
|
||||
return f;
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Count the number of characters from begin to end, and return it. */
|
||||
size_t get_totsize(const filestruct *begin, const filestruct *end)
|
||||
{
|
||||
const filestruct *line;
|
||||
size_t totsize = 0;
|
||||
|
||||
/* Sum the number of characters (plus a newline) in each line. */
|
||||
for (line = begin; line != end->next; line = line->next)
|
||||
totsize += mbstrlen(line->data) + 1;
|
||||
|
||||
/* The last line of a file doesn't have a newline -- otherwise it
|
||||
* wouldn't be the last line -- so subtract 1 when at EOF. */
|
||||
if (line == NULL)
|
||||
totsize--;
|
||||
|
||||
return totsize;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Dump the filestruct inptr to stderr. */
|
||||
|
||||
3232
src/winio.c
3232
src/winio.c
File diff suppressed because it is too large
Load Diff
@@ -22,8 +22,8 @@ pkgdata_DATA = asm.nanorc \
|
||||
man.nanorc \
|
||||
mgp.nanorc \
|
||||
mutt.nanorc \
|
||||
nftables.nanorc \
|
||||
nanorc.nanorc \
|
||||
nftables.nanorc \
|
||||
objc.nanorc \
|
||||
ocaml.nanorc \
|
||||
patch.nanorc \
|
||||
@@ -34,6 +34,7 @@ pkgdata_DATA = asm.nanorc \
|
||||
pov.nanorc \
|
||||
python.nanorc \
|
||||
ruby.nanorc \
|
||||
rust.nanorc \
|
||||
sh.nanorc \
|
||||
spec.nanorc \
|
||||
tcl.nanorc \
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
syntax "asm" "\.(S|s|asm)$"
|
||||
magic "[Aa]ssembl(y|er)"
|
||||
comment "//"
|
||||
|
||||
color red "\<[A-Z_]{2,}\>"
|
||||
color brightgreen "\.(data|subsection|text)"
|
||||
@@ -1,6 +1,7 @@
|
||||
## Here is an example for Autoconf.
|
||||
|
||||
syntax "autoconf" "\.(ac|m4)$"
|
||||
comment "#"
|
||||
|
||||
# Keywords:
|
||||
color yellow "\<(if|test|then|elif|else|fi|for|in|do|done)\>"
|
||||
@@ -19,7 +20,7 @@ color red "\"[^"]*\"" "\'[^']*\'"
|
||||
color green "`[^`]*`"
|
||||
|
||||
# Error lines:
|
||||
color black "^\*\*\*.*"
|
||||
color brightred "^\*\*\*.*"
|
||||
|
||||
# Brackets:
|
||||
color magenta "\[|\]|\(|\)"
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
syntax "awk" "\.awk$"
|
||||
magic "awk.*script text"
|
||||
comment "#"
|
||||
|
||||
# Records.
|
||||
icolor brightred "\$[0-9A-Z_!@#$*?-]+"
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
syntax "c" "\.(c(c|pp|xx|\+\+)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
|
||||
magic "(ASCII|UTF-8 Unicode) C(\+\+)? program text"
|
||||
comment "//"
|
||||
|
||||
color brightred "\<[A-Z_][0-9A-Z_]+\>"
|
||||
color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|auto|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
|
||||
color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
|
||||
color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
|
||||
color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|override|using|mutable|volatile|register|explicit)\>"
|
||||
color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
|
||||
color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
|
||||
color magenta "\<(goto|continue|break|return)\>"
|
||||
@@ -12,7 +12,7 @@ color yellow "<[^>]*@[^>]*>"
|
||||
# Command-line options.
|
||||
color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+"
|
||||
# Bug and patch numbers.
|
||||
color cyan "bug #[0-9]{5,9}" "patch #[0-9]{4,9}"
|
||||
color cyan "(BZ|bug|patch) #[0-9]+" "PR [[:alnum:]]+/[0-9]+"
|
||||
# Probable constants, for variety.
|
||||
color brightred "\<[A-Z_][0-9A-Z_]+\>"
|
||||
# Key sequences.
|
||||
@@ -1,6 +1,7 @@
|
||||
## Syntax highlighting for CMake files.
|
||||
|
||||
syntax "cmake" "(CMakeLists\.txt|\.cmake)$"
|
||||
comment "#"
|
||||
|
||||
icolor green "^[[:space:]]*[A-Z0-9_]+"
|
||||
icolor brightyellow "^[[:space:]]*(include|include_directories|include_external_msproject)\>"
|
||||
@@ -1,6 +1,7 @@
|
||||
## Here is an example for CSS files.
|
||||
|
||||
syntax "css" "\.css$"
|
||||
comment "/*|*/"
|
||||
|
||||
color brightred "."
|
||||
color brightyellow start="\{" end="\}"
|
||||
@@ -1,6 +1,7 @@
|
||||
## Here is an example for apt's sources.list.
|
||||
|
||||
syntax "sources.list" "sources\.list(~|\.old|\.save)?$" "sources\.list\.d/.*\.list(~|\.old|\.save)?$"
|
||||
comment "#"
|
||||
|
||||
# Coloring the deb lines, working from tail to head. First the
|
||||
# components -- well, everything, and thus also the components.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user