Compare commits
807 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c561b4280f | ||
|
|
df9ca85961 | ||
|
|
7475b4d3bf | ||
|
|
f502f6fdb2 | ||
|
|
fd667b5191 | ||
|
|
aabfefde7e | ||
|
|
bccb0ea0bb | ||
|
|
6ca22b80ef | ||
|
|
cf52f2ed62 | ||
|
|
294051769c | ||
|
|
7157f5a3ce | ||
|
|
5ca4e9f5b3 | ||
|
|
3e899b15c2 | ||
|
|
a33b04ce90 | ||
|
|
36ab5d91de | ||
|
|
8dc1b97465 | ||
|
|
350115242d | ||
|
|
7bf413db76 | ||
|
|
aafda2358f | ||
|
|
6b9084ad09 | ||
|
|
d0501d0ebd | ||
|
|
ba5a191f26 | ||
|
|
364a1518de | ||
|
|
93b2877758 | ||
|
|
832037e2ec | ||
|
|
ad2920acd0 | ||
|
|
e59a0f5e77 | ||
|
|
fd10c0eadd | ||
|
|
7e53fcb581 | ||
|
|
8249f3560f | ||
|
|
dd1b16cd54 | ||
|
|
43b39ed04f | ||
|
|
17a8b24fe5 | ||
|
|
b9db967bc4 | ||
|
|
2a5d129738 | ||
|
|
6980cfbf70 | ||
|
|
a0d2e63c8e | ||
|
|
57c52de99a | ||
|
|
9067f7a0c7 | ||
|
|
e4fa0b54a2 | ||
|
|
b41405233f | ||
|
|
88561506c9 | ||
|
|
a08ca026f0 | ||
|
|
180a53cc0c | ||
|
|
d18cfb26cd | ||
|
|
eb70578c5e | ||
|
|
63efc59758 | ||
|
|
dcd34b246a | ||
|
|
b0dcb15f94 | ||
|
|
7dbfbbb8d6 | ||
|
|
4cefd699ca | ||
|
|
8eddf7bc26 | ||
|
|
2623f39c7b | ||
|
|
da71322000 | ||
|
|
292e505e01 | ||
|
|
a322dab482 | ||
|
|
0ed1695fd4 | ||
|
|
60d31d2ea6 | ||
|
|
b744eec1a9 | ||
|
|
a6f64212ae | ||
|
|
a6cee410ef | ||
|
|
f7682730bd | ||
|
|
5f90e067f1 | ||
|
|
b0f563980d | ||
|
|
258e7c6e65 | ||
|
|
65321f9234 | ||
|
|
bde8858a3a | ||
|
|
a2b7fc1c81 | ||
|
|
69e6ccf641 | ||
|
|
14717d7449 | ||
|
|
ed76a045ae | ||
|
|
62ffc221aa | ||
|
|
ec8fd9f365 | ||
|
|
d3a8488b0e | ||
|
|
b3d6c27502 | ||
|
|
2e4d78a714 | ||
|
|
476c838753 | ||
|
|
ecb4dac494 | ||
|
|
95df7dbc8e | ||
|
|
a84cdaaa50 | ||
|
|
97a993d401 | ||
|
|
1542cbf942 | ||
|
|
727abceb0f | ||
|
|
5899181a31 | ||
|
|
a2fdf6c486 | ||
|
|
29d493a986 | ||
|
|
940a17268b | ||
|
|
ee78f2348b | ||
|
|
2261377309 | ||
|
|
cb1675dac7 | ||
|
|
808d0894f1 | ||
|
|
07c1ac9035 | ||
|
|
2b9c0c5724 | ||
|
|
abfde53945 | ||
|
|
f21508f071 | ||
|
|
2c228796a8 | ||
|
|
a84653dc19 | ||
|
|
1388af2bdc | ||
|
|
2e6886406c | ||
|
|
80ff5e76d6 | ||
|
|
1a2d0c1770 | ||
|
|
eb413a99f2 | ||
|
|
fcb9e58b2d | ||
|
|
675a8e4899 | ||
|
|
3344571227 | ||
|
|
f9b1306adf | ||
|
|
722467cb6b | ||
|
|
b3b3d04552 | ||
|
|
b9e3e4edb8 | ||
|
|
2d204bcbfd | ||
|
|
3e609ee4c7 | ||
|
|
13327203e0 | ||
|
|
da0ac58ecc | ||
|
|
712f68c697 | ||
|
|
331bd7662e | ||
|
|
009fb2fae6 | ||
|
|
7fa6e95ce1 | ||
|
|
8bce70e038 | ||
|
|
b55153524a | ||
|
|
a9ce488cc5 | ||
|
|
8061a981b1 | ||
|
|
e64c950896 | ||
|
|
69b12d907e | ||
|
|
c0c4a1b2b5 | ||
|
|
18659f3485 | ||
|
|
94f49e208f | ||
|
|
3f63982593 | ||
|
|
7f77cad1b4 | ||
|
|
e7511abd86 | ||
|
|
b1b89f01b7 | ||
|
|
24740815f6 | ||
|
|
c7356c2d85 | ||
|
|
91ba76e1e0 | ||
|
|
3dcabd6d03 | ||
|
|
0f843b007a | ||
|
|
ff11ab6b66 | ||
|
|
096e36279f | ||
|
|
5eb3b8feb5 | ||
|
|
f601eeda57 | ||
|
|
2430c5b230 | ||
|
|
9b8930cc13 | ||
|
|
0f0b620c65 | ||
|
|
a7aab18dfe | ||
|
|
a9e171de52 | ||
|
|
ad2490c3fc | ||
|
|
380589d95d | ||
|
|
bb496bf456 | ||
|
|
b086d0bad0 | ||
|
|
a13b0bc854 | ||
|
|
bbdbf4586f | ||
|
|
af5010c96f | ||
|
|
90f6342fd1 | ||
|
|
84b187f627 | ||
|
|
499b926b74 | ||
|
|
61dda8ff62 | ||
|
|
6ce4e3ede8 | ||
|
|
287718cf8b | ||
|
|
78f54523d9 | ||
|
|
9faa95450b | ||
|
|
26d7a7494e | ||
|
|
d8249917c3 | ||
|
|
054cafa138 | ||
|
|
bafcc19b7a | ||
|
|
61c94c2f81 | ||
|
|
69a90dd7af | ||
|
|
fae2eeadce | ||
|
|
3ff524821c | ||
|
|
290b250141 | ||
|
|
b61d97eb9a | ||
|
|
0bced0a5e9 | ||
|
|
23c62c5032 | ||
|
|
2770ec81e2 | ||
|
|
c35c5af5d8 | ||
|
|
f6e7b7fbc5 | ||
|
|
96a5aa9e90 | ||
|
|
e998c35c53 | ||
|
|
4d7e7e28fd | ||
|
|
648eac936e | ||
|
|
26fb83c61f | ||
|
|
2fd9974e0e | ||
|
|
7ff82aa5e2 | ||
|
|
fd28e5f36c | ||
|
|
7f40eeab0a | ||
|
|
d67faa2bb5 | ||
|
|
24cdf78a93 | ||
|
|
d01dbbb284 | ||
|
|
c275c5158e | ||
|
|
adf7f33ea8 | ||
|
|
4d10f583e4 | ||
|
|
926bc6751e | ||
|
|
1c8c02f63b | ||
|
|
43a1756783 | ||
|
|
34528db096 | ||
|
|
c79b52da1d | ||
|
|
454dc6e1ec | ||
|
|
23460bc6a8 | ||
|
|
ba2807c6f7 | ||
|
|
3899a09dea | ||
|
|
b535714671 | ||
|
|
8535b3db4c | ||
|
|
77bce9f1c4 | ||
|
|
a2b85e0c12 | ||
|
|
786d2221e1 | ||
|
|
9a9f36fca7 | ||
|
|
00d4a06cc7 | ||
|
|
2aec478ea6 | ||
|
|
ae7f5ebdeb | ||
|
|
bea5e85f3e | ||
|
|
32ee39e44a | ||
|
|
8e7b869cd9 | ||
|
|
6bccedb319 | ||
|
|
b33a62af8c | ||
|
|
d729edaeda | ||
|
|
bc92e28b30 | ||
|
|
c5b0e1958a | ||
|
|
da43cc0959 | ||
|
|
506f617d5b | ||
|
|
e81e18dd14 | ||
|
|
569d00564b | ||
|
|
881106c487 | ||
|
|
2a44cb2ed8 | ||
|
|
19a124e806 | ||
|
|
d9106abfda | ||
|
|
bc0ea5ea71 | ||
|
|
ee03c4b857 | ||
|
|
6d7ff17901 | ||
|
|
7bad92c50b | ||
|
|
d3954901a9 | ||
|
|
cd594b85f4 | ||
|
|
933dd567de | ||
|
|
248d392c4d | ||
|
|
e1f80b9707 | ||
|
|
6b4e7d0f78 | ||
|
|
4b4a8be58b | ||
|
|
512b0fd32d | ||
|
|
586d22109b | ||
|
|
47953bd6ac | ||
|
|
11d3b01050 | ||
|
|
eddd8963e7 | ||
|
|
160f07baba | ||
|
|
822d764d27 | ||
|
|
6d00e75dc2 | ||
|
|
90772ad05b | ||
|
|
756b95748b | ||
|
|
8d31ad8a70 | ||
|
|
3480518a5c | ||
|
|
b48dfde3b2 | ||
|
|
f8366cd5c9 | ||
|
|
423105e371 | ||
|
|
5a7cdacf46 | ||
|
|
d909291b0c | ||
|
|
b30522463a | ||
|
|
5449d1e6a5 | ||
|
|
d7743b05f0 | ||
|
|
8089f5ad54 | ||
|
|
2579b105da | ||
|
|
09a004cad9 | ||
|
|
3162e73540 | ||
|
|
2c5045bfce | ||
|
|
53c5ace8c3 | ||
|
|
e0d00bc750 | ||
|
|
b72f3b10ba | ||
|
|
c9482bcd2b | ||
|
|
747ce3b5da | ||
|
|
10800ee410 | ||
|
|
b4299f4f4e | ||
|
|
c45df589fa | ||
|
|
44fd299921 | ||
|
|
40a0463250 | ||
|
|
187843d2da | ||
|
|
0f2dd8456f | ||
|
|
821fbf713d | ||
|
|
ebc2364742 | ||
|
|
15fadd700a | ||
|
|
78bfc9223a | ||
|
|
e8e9b8ad82 | ||
|
|
964771afc3 | ||
|
|
fe94999c1c | ||
|
|
56bf29409b | ||
|
|
fcbf85887b | ||
|
|
ac0f2c9485 | ||
|
|
0a1817e893 | ||
|
|
b18f1265ff | ||
|
|
2dd97a0352 | ||
|
|
ef4b0edd4e | ||
|
|
b47d111a3d | ||
|
|
d80ecf0209 | ||
|
|
ff4973458c | ||
|
|
f9ff902bbc | ||
|
|
95c966c3fc | ||
|
|
982e226c3f | ||
|
|
42ca89039a | ||
|
|
07b48024d1 | ||
|
|
1c4dd79b9b | ||
|
|
56fc8f6d30 | ||
|
|
ad1331527e | ||
|
|
1bbf07b27e | ||
|
|
b9deb883fa | ||
|
|
9c4ebed3ff | ||
|
|
e64e54d57f | ||
|
|
d4ee6a2b53 | ||
|
|
af062af490 | ||
|
|
4bdd6013b0 | ||
|
|
11f099e1da | ||
|
|
703cebaaac | ||
|
|
4710b94cfb | ||
|
|
5ca2fd887a | ||
|
|
d1e1438ca0 | ||
|
|
382ec84248 | ||
|
|
bc4240dda5 | ||
|
|
b97da1dfe4 | ||
|
|
e62a6964f7 | ||
|
|
fd70c25d21 | ||
|
|
227467adb9 | ||
|
|
afce41c754 | ||
|
|
36e22c99a1 | ||
|
|
dd25d807df | ||
|
|
fea5d7c612 | ||
|
|
c859fd40b6 | ||
|
|
890e12fc79 | ||
|
|
ab1a5c7abb | ||
|
|
079a679431 | ||
|
|
56d1214187 | ||
|
|
fb53ad9c3a | ||
|
|
5755ecdbfc | ||
|
|
bcaa1ef7f2 | ||
|
|
9bb9a747e2 | ||
|
|
e86180119e | ||
|
|
40053593a8 | ||
|
|
732cf88786 | ||
|
|
9fb0beca1d | ||
|
|
f091c34bac | ||
|
|
fd9f6e4619 | ||
|
|
4f9bebddec | ||
|
|
edf2d8d68f | ||
|
|
654d694e39 | ||
|
|
19a6120dc8 | ||
|
|
f4a33b868a | ||
|
|
cd3db5fcc4 | ||
|
|
ae5a4ecee2 | ||
|
|
fd4a5fc473 | ||
|
|
66e64dd2d2 | ||
|
|
a0119b83ca | ||
|
|
dba7a8a70a | ||
|
|
5c3a22dbd6 | ||
|
|
b70510f4be | ||
|
|
2d4bacf61d | ||
|
|
547de4a7bb | ||
|
|
845a5973c9 | ||
|
|
6e5195f650 | ||
|
|
f3624b1b87 | ||
|
|
1a2c9044d7 | ||
|
|
9a67d7958f | ||
|
|
23f73cb8b3 | ||
|
|
9f6962f3f1 | ||
|
|
958e3ec201 | ||
|
|
ce9cfdaa45 | ||
|
|
56a111afa3 | ||
|
|
38bbdf8fc3 | ||
|
|
a0e523cd4b | ||
|
|
7660849b8f | ||
|
|
4b814698bd | ||
|
|
96046f1e82 | ||
|
|
387be713c8 | ||
|
|
d9943120ed | ||
|
|
a1907d77f8 | ||
|
|
f25a3f8a36 | ||
|
|
9f1c3c8513 | ||
|
|
d1521c584d | ||
|
|
f52b6cf19f | ||
|
|
59040169ed | ||
|
|
8f6559828d | ||
|
|
619962ee18 | ||
|
|
7ebe44ac25 | ||
|
|
0cc2104257 | ||
|
|
9a6158cd94 | ||
|
|
7d3aad403d | ||
|
|
aa70f3d95e | ||
|
|
ec457dc33a | ||
|
|
31b978ca3e | ||
|
|
9a4586557b | ||
|
|
02c48dc8a4 | ||
|
|
384c9aaad3 | ||
|
|
0c249de9e5 | ||
|
|
abf4658ab9 | ||
|
|
ba25d0df1d | ||
|
|
e7fa43d600 | ||
|
|
49a84f9e8a | ||
|
|
6ee657b7d8 | ||
|
|
6866ea0d0e | ||
|
|
34d38fe1c6 | ||
|
|
b17309b652 | ||
|
|
107abd2654 | ||
|
|
f528ced22b | ||
|
|
71628ad0b8 | ||
|
|
481529e865 | ||
|
|
bc6645f753 | ||
|
|
c1ca578853 | ||
|
|
4ce2e146ea | ||
|
|
39ed865043 | ||
|
|
0de4700002 | ||
|
|
ea95ad24be | ||
|
|
415e55ff37 | ||
|
|
c20134c20d | ||
|
|
56308b3256 | ||
|
|
3d8cd65b1b | ||
|
|
2b6924ef6e | ||
|
|
01d8b0e15d | ||
|
|
16f17f3f1b | ||
|
|
09042f5499 | ||
|
|
3690d60b71 | ||
|
|
4dedb1c1b1 | ||
|
|
067ee1a6b1 | ||
|
|
0c1db4879e | ||
|
|
02efc760bf | ||
|
|
a91bc04e04 | ||
|
|
9a59cddcd4 | ||
|
|
6ab754676a | ||
|
|
9917a05f04 | ||
|
|
fcda76f684 | ||
|
|
639f37669a | ||
|
|
6d720bf7b2 | ||
|
|
f3b030c8e5 | ||
|
|
6b8b7c9d55 | ||
|
|
21ed79938e | ||
|
|
004af03ea5 | ||
|
|
b2c63c3d3c | ||
|
|
ae139021eb | ||
|
|
f6dedf3598 | ||
|
|
8003842e5c | ||
|
|
01477d3b81 | ||
|
|
ebf9279f95 | ||
|
|
304548ef82 | ||
|
|
dd6f129c3c | ||
|
|
c2f007afc5 | ||
|
|
8dc83951ee | ||
|
|
b7dc5abca7 | ||
|
|
8b784785ec | ||
|
|
750b51c343 | ||
|
|
e09ed765a1 | ||
|
|
70a765e387 | ||
|
|
c65fa25ce2 | ||
|
|
cbbfebbc7a | ||
|
|
9d499c769b | ||
|
|
dad2b5541e | ||
|
|
56960ce05e | ||
|
|
e247be69bf | ||
|
|
e209686835 | ||
|
|
047936c338 | ||
|
|
ca0571ea52 | ||
|
|
655cf9573f | ||
|
|
c457f744ef | ||
|
|
8f3ea23ece | ||
|
|
3225c71ecd | ||
|
|
5310a355ef | ||
|
|
d7875cdf4f | ||
|
|
dc05defb8a | ||
|
|
98c11d0a82 | ||
|
|
14f1652842 | ||
|
|
d4b97a08cd | ||
|
|
c934c1d71b | ||
|
|
a16315a65f | ||
|
|
d6beca5dcf | ||
|
|
9d7e62be1a | ||
|
|
5c008726f0 | ||
|
|
8c506d86af | ||
|
|
db7a49edc6 | ||
|
|
2428c5cbe6 | ||
|
|
01bc0148c0 | ||
|
|
a92511ceaf | ||
|
|
19517fc51e | ||
|
|
71c35d3ca2 | ||
|
|
38af812a82 | ||
|
|
622111613f | ||
|
|
21ef05058c | ||
|
|
abcdd6605c | ||
|
|
f2d89cb3bc | ||
|
|
2d05ce37c6 | ||
|
|
2bc5c1987c | ||
|
|
e39e2ddf52 | ||
|
|
ac61254581 | ||
|
|
9e182fde66 | ||
|
|
70d59ffe16 | ||
|
|
fb4bcd8cfd | ||
|
|
2288abcd49 | ||
|
|
42fde1cbc6 | ||
|
|
d675a549de | ||
|
|
6bab8d19c6 | ||
|
|
365058c48f | ||
|
|
5eb7145939 | ||
|
|
4dab491df2 | ||
|
|
9f92341c84 | ||
|
|
3357712928 | ||
|
|
0e59c12af4 | ||
|
|
aab0d43f47 | ||
|
|
9cc32c920b | ||
|
|
72ad00f9d0 | ||
|
|
89217f20af | ||
|
|
477a9b33b4 | ||
|
|
5c6fe50487 | ||
|
|
6c34ae5804 | ||
|
|
4409b275fc | ||
|
|
8848ac5a9b | ||
|
|
c055e629c7 | ||
|
|
e6f26464d7 | ||
|
|
a0aeeba075 | ||
|
|
c640a55b1c | ||
|
|
7d0b7e47c1 | ||
|
|
132ed5c8f0 | ||
|
|
bd88b8b5a6 | ||
|
|
0568f7a2b6 | ||
|
|
1a28b08694 | ||
|
|
3b3a6b12a7 | ||
|
|
50213eee81 | ||
|
|
7cd2a7da7c | ||
|
|
4f67f364bc | ||
|
|
7cf08b93ff | ||
|
|
474a1f0447 | ||
|
|
76d7fbd5ee | ||
|
|
8d87410c94 | ||
|
|
1961c052c8 | ||
|
|
843dbd56ef | ||
|
|
be3c54c670 | ||
|
|
01afcb243c | ||
|
|
b0eb73f7b3 | ||
|
|
1907174c5f | ||
|
|
4da604be5a | ||
|
|
43754bd11d | ||
|
|
acd9046093 | ||
|
|
2fd6181873 | ||
|
|
b15c5a7eaf | ||
|
|
1b1d60b9d7 | ||
|
|
9c70fdaef9 | ||
|
|
fcbe5aedbd | ||
|
|
6c6a3f6bd3 | ||
|
|
e873121372 | ||
|
|
ad52830fb8 | ||
|
|
c802f91f4e | ||
|
|
51913542f4 | ||
|
|
be7e000389 | ||
|
|
1d4411a474 | ||
|
|
76f1a4af4f | ||
|
|
bb1a0bd86c | ||
|
|
8b2b9654ab | ||
|
|
60ae71bf3a | ||
|
|
8625609c2d | ||
|
|
3c4a4b04ce | ||
|
|
b3faf353c9 | ||
|
|
f700b422be | ||
|
|
1b2a2e6737 | ||
|
|
12e5c2f07d | ||
|
|
5c07a747bb | ||
|
|
a9f7277b1b | ||
|
|
d13b6d6896 | ||
|
|
819066c5d5 | ||
|
|
a65982bffb | ||
|
|
6b8f446b52 | ||
|
|
2b97d6563d | ||
|
|
a0506a15ee | ||
|
|
68ca1732b8 | ||
|
|
75f4309c1f | ||
|
|
78767b583d | ||
|
|
a0703ab62d | ||
|
|
9d232cd8af | ||
|
|
03d296eb35 | ||
|
|
2b27df6733 | ||
|
|
f012d54a1d | ||
|
|
61dc2cab0b | ||
|
|
a2313f499c | ||
|
|
cbda89766f | ||
|
|
070ccf4a5b | ||
|
|
8e4b68917c | ||
|
|
0d0d011579 | ||
|
|
71daa1ef6b | ||
|
|
0ed62e84de | ||
|
|
0a31a9aa38 | ||
|
|
6747142cd7 | ||
|
|
6cf442e329 | ||
|
|
d26f16a175 | ||
|
|
8d7f8cda8c | ||
|
|
75a70d98d5 | ||
|
|
b3374ea1fb | ||
|
|
0905c6ae7e | ||
|
|
3eeedd7caf | ||
|
|
410dcee0a1 | ||
|
|
5b4d2350e6 | ||
|
|
cbeea859c2 | ||
|
|
422cd726fa | ||
|
|
9f43b4c758 | ||
|
|
dd429d9c00 | ||
|
|
b63c90bf6b | ||
|
|
fa26889d03 | ||
|
|
30011b8525 | ||
|
|
3ac5432e29 | ||
|
|
1d52548575 | ||
|
|
d5ce44820a | ||
|
|
cc2b4f712c | ||
|
|
98f038ad96 | ||
|
|
f8d2f552bd | ||
|
|
f2ae08ab19 | ||
|
|
325d774393 | ||
|
|
0856f53703 | ||
|
|
7f0bfdfeb2 | ||
|
|
51371e0ca5 | ||
|
|
3bd66b78c1 | ||
|
|
5ea6054a75 | ||
|
|
04738996fc | ||
|
|
07a9477213 | ||
|
|
a5b48f9a0d | ||
|
|
d141e849a3 | ||
|
|
da68ee19e7 | ||
|
|
8b2f7bd5a2 | ||
|
|
6119756347 | ||
|
|
06c80b6ccd | ||
|
|
7ce1f6d86d | ||
|
|
88087f2b2f | ||
|
|
16c4f5bbd0 | ||
|
|
e877c2406e | ||
|
|
b6a1583e8e | ||
|
|
48df800db3 | ||
|
|
ee05daab92 | ||
|
|
74f4c37d5f | ||
|
|
3f5ba950d6 | ||
|
|
0a52e92d4c | ||
|
|
7c57806c6f | ||
|
|
a2f8703df5 | ||
|
|
073251fdb1 | ||
|
|
5a0ee3c2f9 | ||
|
|
6bd5dce954 | ||
|
|
f25059c244 | ||
|
|
856f2c433e | ||
|
|
38c5a4465b | ||
|
|
f494bfcbb9 | ||
|
|
b856fc4664 | ||
|
|
faa96ead44 | ||
|
|
26444bf8df | ||
|
|
4eaade2938 | ||
|
|
662e8b2d20 | ||
|
|
4502295a34 | ||
|
|
25b0bf0ae8 | ||
|
|
f6b6bc47d6 | ||
|
|
a692b01c04 | ||
|
|
a197ccf12d | ||
|
|
67e5913edf | ||
|
|
e864107046 | ||
|
|
7984ea4eb6 | ||
|
|
f38bd5030d | ||
|
|
a2fea9928d | ||
|
|
c64f506933 | ||
|
|
445cd2a6c5 | ||
|
|
fb073ec88d | ||
|
|
c09e96f294 | ||
|
|
0b54785fe5 | ||
|
|
8835c0d486 | ||
|
|
0442eef95b | ||
|
|
6ae11071b3 | ||
|
|
3c177c1bb9 | ||
|
|
e0213b1a41 | ||
|
|
e70ff87c86 | ||
|
|
db10a421dc | ||
|
|
5725336149 | ||
|
|
b8ba27bbc0 | ||
|
|
e3f6638a76 | ||
|
|
f8553f6d3a | ||
|
|
a78da18aa4 | ||
|
|
d764d7094f | ||
|
|
2651554721 | ||
|
|
fa686457c2 | ||
|
|
a65f0ec80c | ||
|
|
e01e1d8ab5 | ||
|
|
58597b6d9b | ||
|
|
196e913681 | ||
|
|
620553b795 | ||
|
|
6df50790cd | ||
|
|
6cd98e32f7 | ||
|
|
f9baa4de71 | ||
|
|
1cd5005d06 | ||
|
|
f7a3b996fa | ||
|
|
ea874112d8 | ||
|
|
25d397e7b3 | ||
|
|
5111b20bf5 | ||
|
|
f571d6ba36 | ||
|
|
0e21baf611 | ||
|
|
1e78881a70 | ||
|
|
077d307b30 | ||
|
|
998992ddcb | ||
|
|
0ff9499583 | ||
|
|
eb1668ce81 | ||
|
|
54b97a6f03 | ||
|
|
5e48c36877 | ||
|
|
9e3fca4021 | ||
|
|
5130c35b85 | ||
|
|
e01651cde1 | ||
|
|
12cf1c9980 | ||
|
|
092711e412 | ||
|
|
0e6d693dc8 | ||
|
|
aac3126183 | ||
|
|
63cddceeaa | ||
|
|
486d4956ff | ||
|
|
7567a67cdd | ||
|
|
c4939c76a5 | ||
|
|
04e557fdaf | ||
|
|
7dcc8f1d7a | ||
|
|
343f97b3ac | ||
|
|
706f3e93f4 | ||
|
|
f47ef539db | ||
|
|
2148e857e5 | ||
|
|
afa4c6b9fc | ||
|
|
27127853db | ||
|
|
a81ba0215a | ||
|
|
3e0bd533db | ||
|
|
e8d20a8e4b | ||
|
|
6896d8df47 | ||
|
|
8455251c35 | ||
|
|
5cf351913e | ||
|
|
416386edcd | ||
|
|
497f126bb2 | ||
|
|
4687322398 | ||
|
|
99f0265d34 | ||
|
|
7b0b9a12ea | ||
|
|
7d483987ce | ||
|
|
f705a9674b | ||
|
|
3233e9cfe0 | ||
|
|
5a98a51173 | ||
|
|
2eaba21a4c | ||
|
|
9a227de3e7 | ||
|
|
3f57200e10 | ||
|
|
1486f32d42 | ||
|
|
e3edce4e7b | ||
|
|
0e559c5bbc | ||
|
|
edfbfbfd0a | ||
|
|
a4eae770ce | ||
|
|
72e5c15110 | ||
|
|
97c8140cea | ||
|
|
c5b03ca4ae | ||
|
|
c2f2c659d9 | ||
|
|
9364bd6c81 | ||
|
|
baa2be3217 | ||
|
|
12742586e5 | ||
|
|
194620c5f0 | ||
|
|
67d37adf98 | ||
|
|
3f0d2fd5ca | ||
|
|
5b07e5fd1f | ||
|
|
3cae32390d | ||
|
|
1be0285832 | ||
|
|
2867f1bbde | ||
|
|
c4d2bf59fb | ||
|
|
5527883c43 | ||
|
|
ade93ccf25 | ||
|
|
84b305f3f0 | ||
|
|
67b89459d5 | ||
|
|
6d916c6c4a | ||
|
|
87542eeaf1 | ||
|
|
29f2e3181a | ||
|
|
8255696b45 | ||
|
|
fc00e89499 | ||
|
|
55946c15e7 | ||
|
|
2e539e2c97 | ||
|
|
38c286c019 | ||
|
|
56d842258c | ||
|
|
8ed8ab69d5 | ||
|
|
4dcbd40c49 | ||
|
|
72645b160d | ||
|
|
dda1b167c9 | ||
|
|
074cf40409 | ||
|
|
6c09504040 | ||
|
|
4991b3bb1a | ||
|
|
075b7e75bc | ||
|
|
c00431134f | ||
|
|
51065ff24b | ||
|
|
4314feae11 | ||
|
|
410280b089 | ||
|
|
178dd9181f | ||
|
|
d30ca576b7 | ||
|
|
ed520c89bc | ||
|
|
cb44a2bd2c | ||
|
|
a0055f3640 | ||
|
|
b00c1d6110 | ||
|
|
594ef2225f | ||
|
|
9631e858f2 | ||
|
|
26d88ccbb1 | ||
|
|
413b9cb774 | ||
|
|
d3a8d81afb | ||
|
|
e16026eacd | ||
|
|
90f18af8bd | ||
|
|
011e8de480 | ||
|
|
4e8afb2877 | ||
|
|
c7ad5c8d86 | ||
|
|
0b1a766964 | ||
|
|
a7e11495bd | ||
|
|
b56db25a35 | ||
|
|
e3957ee5ee | ||
|
|
2a73b4a050 | ||
|
|
ef7c78910c | ||
|
|
772f1029e5 | ||
|
|
3251a216cd | ||
|
|
00b0316ab8 | ||
|
|
76d90617cc | ||
|
|
f516cddce7 | ||
|
|
60b826e5ee | ||
|
|
fc0fcdea10 | ||
|
|
1dd7b216a0 | ||
|
|
87bf46ffb6 | ||
|
|
a921bdadbf | ||
|
|
0271e4a187 | ||
|
|
076eb6f6af | ||
|
|
e484918ef2 |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -13,6 +13,9 @@ core
|
||||
.gdb_history
|
||||
.gdbinit
|
||||
|
||||
/src/nano
|
||||
/src/revision.h
|
||||
|
||||
/ABOUT-NLS
|
||||
/INSTALL
|
||||
/aclocal.m4
|
||||
@@ -35,7 +38,7 @@ core
|
||||
/mkinstalldirs
|
||||
/stamp-h1
|
||||
|
||||
# gettext m4 files.
|
||||
# Gettext m4 files:
|
||||
/m4/codeset.m4
|
||||
/m4/extern-inline.m4
|
||||
/m4/fcntl-o.m4
|
||||
@@ -69,13 +72,9 @@ core
|
||||
/m4/wint_t.m4
|
||||
/m4/xsize.m4
|
||||
|
||||
# gnulib entries
|
||||
# Gnulib stuff:
|
||||
/gnulib/
|
||||
/lib/
|
||||
/m4/.gitignore
|
||||
/m4/gnulib-cache.m4
|
||||
/snippet/
|
||||
|
||||
/nano.spec
|
||||
/src/nano
|
||||
/src/revision.h
|
||||
|
||||
1
AUTHORS
1
AUTHORS
@@ -69,6 +69,7 @@ Rishabh Dave <rishabhddave@gmail.com>
|
||||
|
||||
Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
|
||||
* Filtering text through an external command.
|
||||
* Placing anchors (bookmarks) and jumping to them.
|
||||
|
||||
Brand Huntsman <alpha@qzx.com>
|
||||
* The delayed parsing of syntax files.
|
||||
|
||||
853
ChangeLog
853
ChangeLog
@@ -1,3 +1,846 @@
|
||||
Changes between v4.9 and v5.0:
|
||||
------------------------------
|
||||
|
||||
Andreas K. Foerster (1):
|
||||
syntax: ada: new file -- coloring rules for Ada 2012 files
|
||||
|
||||
Benno Schulenberg (374):
|
||||
anchor: do not let a full justification transfer an anchor to the top
|
||||
anchor: do not let piping and spelling transfer an anchor to the top
|
||||
anchor: during full justification preserve anchors as during single ones
|
||||
backup: do not understand ^C as "Yes" when asking whether to continue
|
||||
backup: when rereading the original file fails, ask the user what to do
|
||||
bindings: add mistakenly removed M-J (Full Justify) back to the main menu
|
||||
bindings: add ^Z (Suspend) to the "Execute Command" menu
|
||||
bindings: allow toggling the help lines at several prompts and in browser
|
||||
bindings: allow typing digits on the numeric keypad by holding Shift
|
||||
bindings: make ^L (Refresh) work at all the prompts too
|
||||
bindings: make ^T invoke the "Execute Command" menu, and ^T^T the Speller
|
||||
bindings: remove the Full-Justify function from the Search menu
|
||||
bindings: stop <Alt+operator> on the keypad from entering spurious letter
|
||||
bindings: stop supporting <Esc> <Esc> <numeric slash> without NumLock
|
||||
build: allow compilation to succeed on curses without italic support
|
||||
build: do not let --disable-speller exclude also the formatter code
|
||||
build: fix compilation for --enable-tiny --enable-color --enable-nanorc
|
||||
build: fix compilation when configured with --disable-color
|
||||
build: fix compilation when configured with --disable-speller
|
||||
build: fix compilation when configured with --enable-tiny
|
||||
build: fix compilation when configured with --enable-tiny
|
||||
build: fix miscompilation for --enable-{tiny,color,nanorc}
|
||||
build: fix the Makefile after two header files were renamed
|
||||
build: make a deeper clone of gnulib (when building from git)
|
||||
build: make ./configure report which global nanorc file will be used
|
||||
build: replace the non-standard backslash escape "\e" with "\x1B"
|
||||
build: stop distributing a nano.spec file
|
||||
build: use a more dependable method for detecting a build from git
|
||||
bump version numbers and add a news item for the 5.0 release
|
||||
color: avoid allocating emptiness when there are no multiline regexes
|
||||
color: when syntax coloring is toggled back on, calculate multiline data
|
||||
colors: move purple one step away from magenta, and use a darker mauve
|
||||
copying: change the implementation, away from cutting plus copying back
|
||||
copying: do not forget to update the screen when M-6 is pressed
|
||||
copying: when using M-6, copy the final line in the buffer just once
|
||||
copying: with --nonewlines, don't add a final newline to the cutbuffer
|
||||
counting: count words and characters without partitioning the file
|
||||
counting: count words correctly also when --wordchars is used
|
||||
cutting: change the implementation of cutting to not use partitioning
|
||||
cutting: overhaul the pasting routine, to not make use of partitioning
|
||||
display: avoid an additional redrawing when redrawing the screen
|
||||
display: blank the status bar for a copy operation, like for cut & paste
|
||||
display: do not try to draw content when there is no open buffer yet
|
||||
display: reposition the cursor after an error message also in a help text
|
||||
docs: complete the renaming of 'tempfile' to 'saveonexit'
|
||||
docs: copy the 4.9.1 news item from the release branch
|
||||
docs: copy the 4.9.2 news item from the release branch
|
||||
docs: copy the 4.9.3 news item from the release branch
|
||||
docs: document the --indicator (-q) and 'set indicator' options
|
||||
docs: document the new -O/--bookstyle and 'set bookstyle' options
|
||||
docs: explain how anchors work, and document their bindable functions
|
||||
docs: improve some descriptions concerning the file browser
|
||||
docs: in the sample nanorc file, refer instead of duplicating
|
||||
docs: mention that doing a full-buffer operation wipes away all anchors
|
||||
docs: mention that M-X toggle is special, because available in most menus
|
||||
docs: mention that the dedicated cursor-moving keys are not rebindable
|
||||
docs: mention the nine new color names, and "bold" plus "italic"
|
||||
docs: note Marco as the original author of the bookmarking code
|
||||
docs: reduce the TODO file to a reference to the bug tracker on Savannah
|
||||
docs: stop mentioning that --wordchars overrides --wordbounds
|
||||
docs: use 'bold' and 'light' instead of 'bright' in the sample nanorc
|
||||
feedback: beep also at a prompt when receiving an unknown escape sequence
|
||||
feedback: do not list "." and ".." as possible <Tab><Tab> completions
|
||||
feedback: indicate an anchor with a "+" in the line-number margin
|
||||
feedback: show a message also when trying to copy an empty region
|
||||
feedback: show the cursor position also at startup in an empty buffer
|
||||
feedback: skip wiping the prompt bar when the shortcut printed a message
|
||||
files: also when creating a backup fails, ask the user whether to proceed
|
||||
files: ask the user whether to proceed every time a backup fails
|
||||
files: before prompting, show also the reason why the backup failed
|
||||
files: disallow tabbing when in restricted mode
|
||||
files: do not append but truncate when allowing insecure backups
|
||||
files: do not let a stray CR in a DOS file trigger Mac format
|
||||
files: do not make a failsafe backup when in restricted mode
|
||||
files: give a more precise warning when deleting an existing backup fails
|
||||
files: ignore errors when calling chmod() on a backup file
|
||||
files: ignore errors when calling chown() on a backup file
|
||||
files: ignore errors when calling futimens() on a backup file
|
||||
files: list possible completions after just one <Tab> instead of two
|
||||
files: make a backup only when requested, not an unrequested failsafe one
|
||||
files: make better use of the last row when there are many completions
|
||||
files: make filtering of the entire buffer into a new buffer work again
|
||||
files: never report a file as being of mixed format
|
||||
files: reinitialize the palette only when the syntax actually changed
|
||||
files: remove two superfluous calls for shielding temp files from others
|
||||
files: show a warning when writing a backup fails, before prompting
|
||||
files: show possible tab completions near the bottom of the edit window
|
||||
files: take into account that also closing a backup file can fail
|
||||
files: trigger the Easter egg only when "zzy" is typed at the prompt
|
||||
files: warn the root user when all the write bits are missing
|
||||
files: write out a marked region without partitioning the buffer
|
||||
general: make five tools accessible through the "Execute Command" menu
|
||||
general: rename "bookmark" to "anchor", to sound less permanent
|
||||
gnulib: update to its current upstream state
|
||||
help: describe what has been added to the "Execute Command" menu
|
||||
help: pair the items in the two bottom lines better in the tiny version
|
||||
help: put the two toggles first in the "Execute Command" menu
|
||||
history: don't send error messages to the screen; store them in the queue
|
||||
history: take into account that closing a file can fail
|
||||
history: take into account that statting a file can fail too
|
||||
indicator: recompute the extra rows also for cut/paste/split/join
|
||||
indicator: recompute the extra rows also when justifying and resizing
|
||||
indicator: rework how the "scrollbar" is computed when softwrapping
|
||||
input: interpret an escape sequence only when it starts with "[" or "O"
|
||||
input: reset the counters when a three-digit sequence is not completed
|
||||
input: stop recognizing the raw escape sequences for F13 to F16
|
||||
locking: ignore the insecure-backup flag when creating a lock file
|
||||
locking: prevent a symlink attack by not opening an existing lock file
|
||||
memory: plug a leak, by freeing the cutbuffer after a bracketed paste
|
||||
menus: remove unneeded words and shortenings from key labels
|
||||
new feature: a position-plus-portion indicator on the righthand side
|
||||
oops -- restore an accidentally changed file
|
||||
options: add --indicator and -q for switching on the scroll-bar thing
|
||||
options: add -O/--bookstyle to make leading whitespace mean new paragraph
|
||||
options: let --afterends affect also the deleting of words (Ctrl+Delete)
|
||||
options: make -S the short synonym of --softwrap
|
||||
options: rename --tempfile to --saveonexit, to be far clearer
|
||||
options: stop recognizing the obsolete --morespace and --smooth
|
||||
prompt: at Yes-No, do not treat a screen resize as an invalid keystroke
|
||||
rcfile: accept prefix "light" to make a color brighter without bolding it
|
||||
rcfile: add bindable function 'execute', for access to "Execute Command"
|
||||
rcfile: allow specifying a bright background color (with prefix "light")
|
||||
rcfile: complain when an essential key binding is missing
|
||||
rcfile: do not complain when "bright" is used with a background color
|
||||
rcfile: introduce nine new named colors, from "pink" to "latte"
|
||||
rcfile: introduce the modifier "bold", for specifying bolding separately
|
||||
rcfile: introduce the modifier 'italic', for slanted text
|
||||
rcfile: rename bindable function 'curpos' to 'location'
|
||||
rcfile: rename 'extcmd' to 'execute', to be more readable and fitting
|
||||
rcfile: report the first bad color element, not a later one that is okay
|
||||
rcfile: restore terminal settings when exiting upon excessive unbindings
|
||||
replacing: recalculate the multiline coloring info when needed
|
||||
scrolling: add a function and a key binding to center the cursor line
|
||||
speller: take into account that statting a file can fail [coverity]
|
||||
startup: allow presetting case-sensitive search also in the tiny version
|
||||
startup: check stdout instead of stdin when probing for a Linux console
|
||||
startup: enter curses mode before reading the nanorc files
|
||||
startup: initialize colors only when the terminal is capable of colors
|
||||
syntax: css: color multiline comments correctly
|
||||
syntax: default: colorize embedded control codes
|
||||
syntax: email: rename file and syntax, away from the mistaken 'mutt'
|
||||
syntax: markdown: do not colorize text between two bold words as italic
|
||||
syntax: markdown: new file -- coloring rules for Markdown files
|
||||
syntax: mgp: drop the almost-empty MagicPoint file and syntax
|
||||
syntax: move distro-specific files down to a subdirectory, syntax/extra/
|
||||
syntax: nanorc: colorize 'bright' anyway, so existing syntaxes look okay
|
||||
syntax: nanorc: colorize the new named colors too, from "mint" to "mauve"
|
||||
syntax: nanorc: stop colorizing 'bright', even though it's still accepted
|
||||
syntax: sql: condense some regexes, and reduce their number
|
||||
syntax: sql: rename the file to match the name of the syntax
|
||||
syntaxes: move the rules for Fortran and Povray files down to extra/
|
||||
syntaxes: remove some stuff that has been commented out for a long time
|
||||
syntaxes: remove some superfluous outer parentheses from regexes
|
||||
syntaxes: remove unneeded backslash escapes before quotes
|
||||
syntaxes: uniformize the initial comment
|
||||
tabbing: beep at the first listing, and when there are zero possibilities
|
||||
tabbing: properly terminate the answer when the sole match is a folder
|
||||
text: retain a bookmark when two lines are joined or something is cut
|
||||
tweaks: add a condition, so that two ifs can be elided
|
||||
tweaks: add a helpful message for when pkg.m4 is missing during a build
|
||||
tweaks: add a helping variable, in order to unwrap three lines
|
||||
tweaks: add a helping variable, to slightly condense the code
|
||||
tweaks: add a symbol, in order to condense three function calls
|
||||
tweaks: add four early returns for read/write errors of history files
|
||||
tweaks: add four more translator hints
|
||||
tweaks: add two comments, and improve another
|
||||
tweaks: adjust comments and indentation after the previous change
|
||||
tweaks: adjust the conditional help-item pairing for absence of speller
|
||||
tweaks: adjust the file format indicator in a quicker way
|
||||
tweaks: adjust the indentation after the previous change
|
||||
tweask: adjust the indentation after the previous change
|
||||
tweaks: avoid a compiler warning
|
||||
tweaks: avoid a function call when a simple boolean will do
|
||||
tweaks: avoid an unnecessary refresh for zero or just one completion
|
||||
tweaks: avoid a warning about an unused variable in the tiny version
|
||||
tweaks: avoid checking a variable three times for each pass in the loop
|
||||
tweaks: avoid unneeded calls of free() by reallocating the full name
|
||||
tweaks: call init_pair() just once for each pair number
|
||||
tweaks: call the spotlighting routines only for the relevant line
|
||||
tweaks: call use_default_colors() just once for each run
|
||||
tweaks: cascade the ifs properly: without increasing the indentation
|
||||
tweaks: change a helping variable, to make two blocks still more similar
|
||||
tweaks: change a 'switch' to 'if', to elide a dummy 'return'
|
||||
tweaks: close opened files when something goes wrong [coverity]
|
||||
tweaks: condense a bit of code, by reusing an existing variable
|
||||
tweaks: condense a comment, and express a condition in a different way
|
||||
tweaks: condense a comment, and reshuffle a few lines
|
||||
tweaks: condense a comment, and reshuffle some conditions
|
||||
tweaks: condense and improve some comments
|
||||
tweaks: condense some cases to a single line, for more clarity
|
||||
tweaks: condense the code a little further, by grouping things better
|
||||
tweaks: correct a comment, and avoid third repetition of some conditions
|
||||
tweaks: correct a comment, and drop a redundant (because nested) #ifdef
|
||||
tweaks: correct some comments, as VT100 and such have smaller keypads
|
||||
tweaks: correct two spelling mistakes [codespell]
|
||||
tweaks: delete a ChangeLog that is no longer updated and is incomplete
|
||||
tweaks: delete another pointless ChangeLog
|
||||
tweaks: delete a now-unused function
|
||||
tweaks: delete some unneeded code, and rename the function accordingly
|
||||
tweaks: delete the now-unused partitioning and unpartitioning routines
|
||||
tweaks: delete two functions that are never executed
|
||||
tweaks: do not use 'switch' when there are just two possibilities
|
||||
tweaks: do not use the string "stat()" in any of the comments
|
||||
tweaks: don't bother overwriting a CR -- decreasing the length is enough
|
||||
tweaks: don't bother statting the lock file before unlinking it
|
||||
tweaks: don't bother using the exclusive flag when creating a lock file
|
||||
tweaks: don't check for escape sequences that start with a lowercase "o"
|
||||
tweaks: don't use a symbol for other purposes
|
||||
tweaks: do the conversion of -1 to a specific color just once
|
||||
tweaks: do the saving of histories in a single place
|
||||
tweaks: drop an unneeded assignment, and reshuffle a few lines
|
||||
tweaks: drop a superfluous check for a non-zero length
|
||||
tweaks: drop obsolete 'nano.spec' from .gitignore file, and reshuffle
|
||||
tweaks: drop two redundant conditions, and improve three comments
|
||||
tweaks: drop two unneeded assignments
|
||||
tweaks: drop two unneeded wnoutrefresh() calls in the spotlight routines
|
||||
tweaks: elide a function that is called just once
|
||||
tweaks: elide a function that is too sparse
|
||||
tweaks: elide another parameter, relevant in just three menus
|
||||
tweaks: elide a now-unused parameter -- it is always FALSE
|
||||
tweaks: elide an unneeded call of strlen(), and copy NUL byte with string
|
||||
tweaks: elide an unneeded global variable
|
||||
tweaks: elide an unneeded parameter, and rename the other
|
||||
tweaks: elide an unneeded variable, as there is nothing beyond '*place'
|
||||
tweaks: elide an unused parameter, and rename the other and a variable
|
||||
tweaks: elide a parameter, by calling the relevant function beforehand
|
||||
tweaks: elide a parameter that is relevant for only one menu (Goto Dir)
|
||||
tweaks: elide a redundant intermediate function
|
||||
tweaks: elide a variable and be more direct, and rename another
|
||||
tweaks: elide a variable, and shortcircuit a return
|
||||
tweaks: elide a variable, by returning the result directly
|
||||
tweaks: elide a wrapper function, by checking a precondition earlier
|
||||
tweaks: elide three functions that are called just once
|
||||
tweaks: elide three parameters, as they are the same for both calls
|
||||
tweaks: elide two ifs for the most likely case, when defaults are allowed
|
||||
tweaks: elide two redundant calls of strchr()
|
||||
tweaks: exclude a bit of bracketed-paste code from the tiny version
|
||||
tweaks: exclude an unneeded fragment of code from the tiny version
|
||||
tweaks: exit from the writing loop as soon as the last line is reached
|
||||
tweaks: fix twenty typos, in old Changelogs and in some comments
|
||||
tweaks: fold translation of all modified keypad keystrokes together
|
||||
tweaks: fold two blocks into each other, to elide three overlapping cases
|
||||
tweaks: for each version, mention the changes to the PO files last
|
||||
tweaks: get rid of a bunch of annoying casts, and thus condense the code
|
||||
tweaks: group the exiting routines together, and condense the comments
|
||||
tweaks: handle the double escapes directly, instead of going round again
|
||||
tweaks: handle two similar things in the same way
|
||||
tweaks: implement the anchor routines in a different way
|
||||
tweaks: improve a comment, rename a function, and elide a parameter
|
||||
tweaks: improve a comment, reshuffle a scroll command, elide a variable
|
||||
tweaks: improve four comments
|
||||
tweaks: improve several comments, and rewrap two lines
|
||||
tweaks: improve some comments, and reshuffle an assignment
|
||||
tweaks: improve some comments and whitespace, and reshuffle a few lines
|
||||
tweaks: improve three comments, drop one, and unwrap a line
|
||||
tweaks: improve two comments, and reshuffle some lines for conciseness
|
||||
tweaks: invert a condition, to have two clauses in a more logical order
|
||||
tweaks: invert a condition, to see the similarity between the two modes
|
||||
tweaks: make an early return for zero matches, and rename a variable
|
||||
tweaks: make an error message more accurate and reduce it to its essence
|
||||
tweaks: make three hard-bindings of special keys more efficiently
|
||||
tweaks: move a copyright notice to a better place, and improve it
|
||||
tweaks: move a fragment of code to the one branch that needs it
|
||||
tweaks: move a function to a more logical place
|
||||
tweaks: move a function to before the one that calls it
|
||||
tweaks: move a function to before the one that calls it
|
||||
tweaks: move a function, to be in the order in which they are called
|
||||
tweaks: move a function to the file where it is used the most
|
||||
tweaks: move an 'if', to not call leftedge_for() when not softwrapping
|
||||
tweaks: move an initialization function to before the one that calls it
|
||||
tweaks: move two functions, to have them in a more logical order
|
||||
tweaks: normalize the indentation after the previous change
|
||||
tweaks: normalize the indentation after the previous change
|
||||
tweaks: normalize the indentation after the previous change
|
||||
tweaks: normalize the indentation after the previous change
|
||||
tweaks: normalize the indentation after the previous change
|
||||
tweaks: order three menu names in the documentation slightly better
|
||||
tweaks: plug a leak, by always freeing the full filename [valgrind]
|
||||
tweaks: rake a common statement to the end of the case
|
||||
tweaks: recalculate the multiline info just once when doing "Replace All"
|
||||
tweaks: reduce the indentation after the previous change
|
||||
tweaks: remove an incorrect mention of umask() from a comment
|
||||
tweaks: remove an unneeded call of wnoutrefresh()
|
||||
tweaks: remove an unneeded cursor movement, and rename a variable
|
||||
tweaks: remove an unneeded element from the openfilestruct
|
||||
tweaks: remove a redundant cursor movement, remove a redundant condition
|
||||
tweaks: remove a superfluous check on the length of the key buffer
|
||||
tweaks: remove a superfluous global variable
|
||||
tweaks: remove some superfluous conditions
|
||||
tweaks: remove three unneeded while loops from two input routines
|
||||
tweaks: remove two calls of umask() by specifying permissions directly
|
||||
tweaks: remove two redundant conditions, and make a more direct return
|
||||
tweaks: remove two superfluous assignments
|
||||
tweaks: remove unneeded variables after the previous change
|
||||
tweaks: rename a function, and move it to before the one that calls it
|
||||
tweaks: rename a function, and move it to before the one that calls it
|
||||
tweaks: rename a function, to be more correct
|
||||
tweaks: rename a function, to be more general and clearer
|
||||
tweaks: rename a function, to be more precise, and reshuffle it
|
||||
tweaks: rename a function, to be more precise, and reshuffle some things
|
||||
tweaks: rename a function, to better describe what it does
|
||||
tweaks: rename a function, to leave the old names behind
|
||||
tweaks: rename a function, to match with the boolean that guards it
|
||||
tweaks: rename a function, to not shadow a variable, and elide parameter
|
||||
tweaks: rename a parameter and a variable, to be more meaningful
|
||||
tweaks: rename a struct element, to be shorter and preciser
|
||||
tweaks: rename a symbol, and actually use it where it is needed
|
||||
tweaks: rename a symbol, away from a double abbreviation
|
||||
tweaks: rename a symbol, from a phrase to a noun
|
||||
tweaks: rename a symbol, to be more accurate, and reshuffle two lines
|
||||
tweaks: rename a symbol, to better suit its purpose, and reduce its scope
|
||||
tweaks: rename a variable, and condense a comment
|
||||
tweaks: rename a variable, and normalize the indentation
|
||||
tweaks: rename a variable, and reduce the scope of two others
|
||||
tweaks: rename a variable, for more contrast with the function name
|
||||
tweaks: rename a variable, for shortness and contrast
|
||||
tweaks: rename a variable, improve a comment, and reshuffle a few things
|
||||
tweaks: rename a variable, to avoid overrepetition of 'backup'
|
||||
tweaks: rename a variable, to better describe what it holds
|
||||
tweaks: rename a variable, to better fit related ones
|
||||
tweaks: rename a variable, to make more sense
|
||||
tweaks: rename a variable, to not refer to a row as a "line"
|
||||
tweaks: rename one of the flag symbols, to be clearer
|
||||
tweaks: rename two functions and a variable, and improve two comments
|
||||
tweaks: rename two functions, and rename and reshuffle a parameter
|
||||
tweaks: rename two functions, to better indicate what they do
|
||||
tweaks: rename two header files, to be distinct and not an abbreviation
|
||||
tweaks: rename two labels, for brevity
|
||||
tweaks: rename two parameters, away from abbreviations
|
||||
tweaks: rename two parameters, away from an abbreviation
|
||||
tweaks: rename two parameters, to be more fitting
|
||||
tweaks: rename two variables, and reduce the scope of a third
|
||||
tweaks: rename two variables, away from abbreviations
|
||||
tweaks: rename two variables, to avoid a repetitive prefix
|
||||
tweaks: rename two variables, to be shorter and without abbreviations
|
||||
tweaks: reshuffle a bit of code, to elide an #ifndef
|
||||
tweaks: reshuffle a condition, for symmetry
|
||||
tweaks: reshuffle a condition, to avoid a repetition of code
|
||||
tweaks: reshuffle a condition, to make a little more sense
|
||||
tweaks: reshuffle a declaration and six calls of free(), to avoid a leak
|
||||
tweaks: reshuffle a few lines, and remove a few unneeded comments
|
||||
tweaks: reshuffle a few lines, for conciseness
|
||||
tweaks: reshuffle a few lines, to elide an 'if' from the most common path
|
||||
tweaks: reshuffle a fragment of code, to elide a 'goto'
|
||||
tweaks: reshuffle an assignment, for conciseness, and rename a variable
|
||||
tweaks: reshuffle and trim a comment, and remove unneeded pair of braces
|
||||
tweaks: reshuffle a statement, to have major initialization in nano.c
|
||||
tweaks: reshuffle some code, to avoid needlessly calling a function
|
||||
tweaks: reshuffle some conditions, to straighten the logic
|
||||
tweaks: reshuffle some lines, for esthetics
|
||||
tweaks: reshuffle some lines, to better separate the three cases
|
||||
tweaks: rewrap a few lines in old news items, for more balanced lines
|
||||
tweaks: separate a symbol from its definition by two spaces
|
||||
tweaks: shorten an error message, to be appropriate in all situations
|
||||
tweaks: shorten the name of a symbol, to match its bindable function
|
||||
tweaks: simplify an error message, by mentioning just the main point
|
||||
tweaks: simplify the counting of characters in a section
|
||||
tweaks: skip the conversion to multibyte for plain ASCII codes
|
||||
tweaks: slightly improve a comment and the ordering of some lines
|
||||
tweaks: slightly improve the grouping of shortcuts in some help texts
|
||||
tweaks: three escapes is the same as either zero escapes or one escape
|
||||
tweaks: trim an ASCII case, as the function is called only for UTF-8
|
||||
tweaks: trim some oververbose comments -- they overshadow the code
|
||||
tweaks: uniformize some old translator credits
|
||||
tweaks: update a translator hint, and add another
|
||||
tweaks: update three translator hints, add two, and frob three strings
|
||||
tweaks: use a better symbol than 'ERR' to signify a valid hex digit
|
||||
tweaks: use knowledge of Unicode to skip the general multibyte conversion
|
||||
tweaks: use three switches instead of cascading ifs, for brevity
|
||||
undo: choose the proper x positions to place the cursor and rejoin lines
|
||||
undo: when undoing a line cut, place the cursor back where it was
|
||||
usage: unabbreviate option arguments where possible
|
||||
verbatim: show an error message when an invalid Unicode code is entered
|
||||
verbatim: turn bracketed-paste mode off while waiting for input
|
||||
|
||||
Marco Diego Aurélio Mesquita (4):
|
||||
bindings: hard-bind the bookmark functions to M-Ins and M-PgUp/M-PgDn
|
||||
display: support the position indicator also when --softwrap is used
|
||||
files: make the M-F (New Buffer) toggle non-persistent
|
||||
new feature: bindable functions for toggling and jumping to "bookmarks"
|
||||
|
||||
Michalis Kokologiannakis (3):
|
||||
files: improve the backup procedure to ensure no data is lost
|
||||
tweaks: adjust some indentation after the previous change
|
||||
tweaks: move the backup code to a separate function
|
||||
|
||||
Pedro Victor de Brito Cordeiro (1):
|
||||
tweaks: make parameter names in prototypes match those in the definitions
|
||||
|
||||
Ryan Westlund (2):
|
||||
syntax: go: highlight the chan keyword, and the special +build comment
|
||||
syntax: haskell: new file -- coloring rules for Haskell programs
|
||||
|
||||
|
||||
Changes between v4.8 and v4.9:
|
||||
------------------------------
|
||||
|
||||
Benno Schulenberg (209):
|
||||
bindings: remove the translation of ^H to Backspace on the BSDs
|
||||
build: fix compilation for --enable-tiny --enable-justify
|
||||
build: restore non-UTF8 fallbacks, to allow compiling with --disable-utf8
|
||||
build: update the conditional placement of the "Go To Line" menu item
|
||||
bump version numbers and add a news item for the 4.9 release
|
||||
chars: optimize a function for the most common blanks: space and tab
|
||||
copyright: update to the current year for significantly changed files
|
||||
cutting: let M-T cut a trailing empty line, but not nothing at all
|
||||
cutting: with --cutfromcursor, allow ^K to cut the penultimate empty line
|
||||
display: do not show a "[" double-width placeholder when softwrapping
|
||||
display: keep the help items aligned, by not writing too many characters
|
||||
docs: improve the descriptions of --softwrap and 'set softwrap'
|
||||
docs: mark bracketed pasting as done in the TODO list
|
||||
docs: mention that ^[ (Esc) is unbindable, and explain why
|
||||
docs: remove the note saying that nanorc files must be in Unix format
|
||||
docs: trim some TODO items, and condense several others
|
||||
docs: update the form of an option, --suspendable / 'set suspendable'
|
||||
docs: update the missed occurrences of --suspendable / 'set suspendable'
|
||||
feedback: give a clearer message when trying to justify an empty region
|
||||
feedback: make sure that a later message can overwrite a short warning
|
||||
files: be consistent in which code means "New File"
|
||||
files: don't check uninitialized memory when writing new file [valgrind]
|
||||
files: when piping, always pipe whatever was cut to the external command
|
||||
gnulib: update to its current upstream state
|
||||
help: do not break a line inside the 17-column keystrokes area
|
||||
help: increase the minimum help-text width from 32 to 40 columns
|
||||
input: accommodate silly emulators that have LF instead of CR in a paste
|
||||
input: after reallocating a string, do not write to its old address
|
||||
input: allocate sufficient bytes for entering a Unicode codepoint
|
||||
input: keep a multibyte character together during verbatim entry
|
||||
justify: do not copy too many bytes when trimming leading whitespace
|
||||
justify: do not crash when the user attempts to justify an empty region
|
||||
justify: do not take an empty line as template for first-line indentation
|
||||
justify: give the first line of a marked region its proper indentation
|
||||
justify: never break a line in leading whitespace
|
||||
justify: restore a region properly when it was marked backwards
|
||||
justify: skip over blanks after the region, to not skew the indentation
|
||||
justify: skip over in-line whitespace only, not over leading whitespace
|
||||
justify: trim prefixed whitespace when justifying a marked region
|
||||
justify: trim the leading blanks of a marked region at the right moment
|
||||
justify: when appropriate, move end point of marked region forward
|
||||
justify: when the cursor is at the left edge, keep it there
|
||||
locking: do not open an empty buffer when respecting the first lock file
|
||||
moving: do not put the cursor at end-of-line when in a help text
|
||||
options: rename --suspend to --suspendable, to make more sense
|
||||
prompt: insert a burst of bytes in one go instead of characterwise
|
||||
rcfile: allow alternate line endings in nanorc files
|
||||
rcfile: do not allow a regex for name, header, or magic to be empty
|
||||
rcfile: don't store a coloring rule before it is complete
|
||||
rcfile: rename bindable function 'suspendenable' to 'suspendable'
|
||||
rcfile: when a start= is not matched with an end=, abandon the whole rule
|
||||
rcfile: when finding a mistake, skip the rest of the line
|
||||
shutdown: don't refer to an open file when there aren't any
|
||||
softwrap: when typing goes beyond the bottom row, scroll just one row
|
||||
syntax: nanorc: colorize 'rawsequences', not the obsolete 'rebindkeypad'
|
||||
syntax: spec: add two missing % signs, and colorize also "%triggerprein"
|
||||
syntax: spec: colorize the date and author of changelog items differently
|
||||
syntax: spec: drop invalid parentheses after "Summary"
|
||||
tweaks: abort in three situations that should never occur
|
||||
tweaks: add a COUPLE_END undo item a bit later, instead of updating it
|
||||
tweaks: add a different helping variable
|
||||
tweaks: add a supporting variable, in order to condense some statements
|
||||
tweaks: add calls of die() for five theoretical programming mistakes
|
||||
tweaks: adjust some whitespace, reshuffle two ifs, and remove two braces
|
||||
tweaks: adjust the indentation after the previous change
|
||||
tweaks: always determine the second lead, to simplify the rewrap call
|
||||
tweaks: avoid a complaint about uninitialized memory [valgrind]
|
||||
tweaks: call add_undo() before the character is actually added
|
||||
tweaks: change a function to return the name of the lock file on success
|
||||
tweaks: change a function with two possible results to boolean
|
||||
tweaks: change an integer to a short, and reshuffle it for better packing
|
||||
tweaks: change another function with two possible results to boolean
|
||||
tweaks: check for a starting quote in one place instead of three
|
||||
tweaks: combine two ifs into one
|
||||
tweaks: condense a comment, reshuffle conditions, and remove unwanted one
|
||||
tweaks: condense a fragment of code
|
||||
tweaks: condense two fragments of code
|
||||
tweaks: convert integers to bytes in one place instead of two
|
||||
tweaks: copy and store a deleted character in a conciser manner
|
||||
tweaks: correct a typo, improve two indentations, and rewrap a line
|
||||
tweaks: correct two typos in a changelog, and drop a doubled word
|
||||
tweaks: create an undo item earlier, and discard it when needed
|
||||
tweaks: don't bother reallocating the line data when undoing a line join
|
||||
tweaks: do some text alignments properly: with spaces, not tabs
|
||||
tweaks: drop a check for something that will not occur
|
||||
tweaks: drop two comments that contain variable names
|
||||
tweaks: elide a function call, by copying a byte directly
|
||||
tweaks: elide an intermediate copy of a character during injection, twice
|
||||
tweaks: elide an intermediate copy of an added character
|
||||
tweaks: elide a parameter, and rename a variable
|
||||
tweaks: elide a supporting variable, to make four loops slightly faster
|
||||
tweaks: elide a variable and an unneeded iteration
|
||||
tweaks: elide one variable and three gotos
|
||||
tweaks: elide three unneeded #defines
|
||||
tweaks: elide two variables and their two assignments
|
||||
tweaks: exclude a function when compiled without spell-checking support
|
||||
tweaks: extend the undo data for deleting and backspacing more directly
|
||||
tweaks: factor out a three-line condition into a separate function
|
||||
tweaks: frob a statement, rewrap two lines, and remove a pair of braces
|
||||
tweaks: frob two statements, condense another, and add a comment
|
||||
tweaks: highlight keystrokes in the documentation more consistently
|
||||
tweaks: improve four comments, and condense two fragments of code
|
||||
tweaks: improve three comments, and reshuffle two declarations
|
||||
tweaks: improve two comments
|
||||
tweaks: improve two comments, and remove an unneeded one
|
||||
tweaks: inject the entire burst of bytes at once into the edit buffer
|
||||
tweaks: instead of swapping the end points later, assign them correctly
|
||||
tweaks: invert the logic of a symbol, to make more sense
|
||||
tweaks: make prompt-bar input more similar to edit-buffer input
|
||||
tweaks: make two conditions more direct, and thus elide two functions
|
||||
tweaks: mesh two bits of code together
|
||||
tweaks: move a function to after the one that it calls
|
||||
tweaks: move a function to before the one that calls it
|
||||
tweaks: move a function to before the one that calls it
|
||||
tweaks: move a function to its proper place in the order of things
|
||||
tweaks: move a function to where it is used
|
||||
tweaks: move another function to where it is used
|
||||
tweaks: move some definitions closer to where they are used
|
||||
tweaks: move two functions to before the ones that call them
|
||||
tweaks: normalize a translator hint, update one, and add another
|
||||
tweaks: normalize the indentation after the previous change
|
||||
tweaks: normalize the indentation after the previous change
|
||||
tweaks: normalize the indentation after the previous two changes
|
||||
tweaks: pull the NUL-terminating of a string into a function
|
||||
tweaks: rearrange a case item, so that PASTE is always after CUT
|
||||
tweaks: rearrange some conditions, for compactness
|
||||
tweaks: relocate a function to before its callers
|
||||
tweaks: relocate eleven functions to before they are called
|
||||
tweaks: remove a now-unused helper function
|
||||
tweaks: remove an unneeded indirection
|
||||
tweaks: remove a redundant assignment
|
||||
tweaks: remove a redundant statement, a spurious reference to 'cutbottom'
|
||||
tweaks: remove a superfluous assignment, and reshuffle a call
|
||||
tweaks: remove non-UTF-8 code from three more functions
|
||||
tweaks: remove some redundant filtering, and thus elide a parameter
|
||||
tweaks: remove some unneeded braces, not used elsewhere either
|
||||
tweaks: remove two redundant case labels
|
||||
tweaks: remove two superfluous checks
|
||||
tweaks: remove two superfluous conditions
|
||||
tweaks: rename a constant, and rename and relocate a function
|
||||
tweaks: rename a function, and condense a few comments
|
||||
tweaks: rename a function, and split a variable into two separate ones
|
||||
tweaks: rename a function, to be more fitting, and improve some comments
|
||||
tweaks: rename a function, to remove an obscuring abbreviation
|
||||
tweaks: rename another function, to remove the obscuring abbreviation
|
||||
tweaks: rename a parameter and a variable, and reword two comments
|
||||
tweaks: rename a symbol, to match the corresponding renamed option
|
||||
tweaks: rename a variable, and add a helping one
|
||||
tweaks: rename a variable, and reshuffle a declaration
|
||||
tweaks: rename a variable, away from a single letter
|
||||
tweaks: rename a variable, away from a single letter
|
||||
tweaks: rename a variable, for aptness
|
||||
tweaks: rename a variable, reshuffle an assignment, and change a code
|
||||
tweaks: rename a variable, to be a bit clearer
|
||||
tweaks: rename a variable, to get out of the way of a later rename
|
||||
tweaks: rename a variable, to not be a substring of a function name
|
||||
tweaks: rename four more functions, to get rid of an abbreviation
|
||||
tweaks: rename four parameters, to be more distinct and telling
|
||||
tweaks: rename four variables, to be a bit more telling
|
||||
tweaks: rename to the same name two variables that have the same role
|
||||
tweaks: rename two elements of an undo record, to be more telling
|
||||
tweaks: rename two functions, for shortness
|
||||
tweaks: rename two functions, to match the style of others
|
||||
tweaks: rename two more elements of an undo record, for symmetry
|
||||
tweaks: rename two more functions, to match the style of others
|
||||
tweaks: rename two more variables, to harmonize with two others
|
||||
tweaks: rename two parameters, to not overlap with other names
|
||||
tweaks: rename two symbols, to be more precise
|
||||
tweaks: rename two variables, and frob four comments
|
||||
tweaks: rename two variables, and reshuffle a few things
|
||||
tweaks: rename two variables, for distinctiveness
|
||||
tweaks: rename two variables, to be different or for more contrast
|
||||
tweaks: rename two variables, to harmonize with two others
|
||||
tweaks: rename two variables, to suit both the marked and unmarked case
|
||||
tweaks: reorder a case item, to have SPLIT_BEGIN always before SPLIT_END
|
||||
tweaks: reshuffle a condition, for compacter code
|
||||
tweaks: reshuffle a condition, for compactness
|
||||
tweaks: reshuffle a few declarations and assignments
|
||||
tweaks: reshuffle an assignment and a free()
|
||||
tweaks: reshuffle some code, in preparation for improving it
|
||||
tweaks: reshuffle some stuff, to have related things together
|
||||
tweaks: reshuffle the setting of the starting point of a cut
|
||||
tweaks: reshuffle the trimming of leading whitespace, for compactness
|
||||
tweaks: reshuffle two declarations plus a fragment of code
|
||||
tweaks: simplify the undoing and redoing of an <Enter>
|
||||
tweaks: strip a parameter that is equivalent to 'openfile' for both calls
|
||||
tweaks: strip a parameter that is TRUE for both calls
|
||||
tweaks: swap the use of 'head' and 'tail' for CUT and PASTE undo items
|
||||
tweaks: trim an unnecessary detail from an error message
|
||||
tweaks: unabbreviate the name of a variable
|
||||
tweaks: unwrap four lines, and use explicit codes where possible
|
||||
tweaks: update several comments after the previous changes
|
||||
tweaks: update some comments after the previous changes
|
||||
tweaks: use a symbol instead of a number, and drop two unneeded casts
|
||||
tweaks: use spaces when aligning things, not tabs
|
||||
tweaks: use the variable that suits 'END' better
|
||||
tweaks: weld two fragments together, twice, by eliding an unneeded 'if'
|
||||
tweaks: when appropriate, move starting point of justified region back
|
||||
tweaks: when extending the marked region, include also exotic blanks
|
||||
tweaks: when undoing an addition or redoing a deletion, do not reallocate
|
||||
undo: do not mark the buffer as modified when pasting back nothing
|
||||
undo: do not try to copy a cutbuffer that is NULL
|
||||
undo: do not try to paste back an empty cutbuffer
|
||||
undo: for an automatic hard-wrap, store the correct previous buffer size
|
||||
undo: store the cursor row, for redoing filtering & justification better
|
||||
undo: treat a cut-until-end-of-buffer like a backward marked region
|
||||
undo: use the correct original fusion point when unjoining two lines
|
||||
undo: when undoing a paste or an insertion, remove an added magic line
|
||||
usage: improve the description of --softwrap
|
||||
|
||||
Neal Gompa (1):
|
||||
syntax: spec: add some keywords that were added in RPM 4.15 and 4.13
|
||||
|
||||
Saagar Jha (1):
|
||||
rcfile: fix an out-of-bounds read on empty lines
|
||||
|
||||
|
||||
Changes between v4.7 and v4.8:
|
||||
------------------------------
|
||||
|
||||
Benno Schulenberg (166):
|
||||
bindings: allow to bind shifted Meta+letter combinations with Sh-M-X
|
||||
bindings: allow to rebind also ^`, although it is synonymous with ^Space
|
||||
bindings: do not show the Full-Justify keystroke when in View mode
|
||||
bindings: force the first letter in a key name to uppercase
|
||||
build: exclude bracketed pasting from the tiny version
|
||||
build: exclude option '-g' when configured without browser and help
|
||||
build: exclude the escape sequences for F13...F16 from the tiny version
|
||||
build: fix compilation for --enable-{tiny,help,multibuffer}
|
||||
build: restrict the use of --with-slang to together with --enable-tiny
|
||||
bump version numbers and add a news item for the 4.8 release
|
||||
copyright: update the years for significantly changed files
|
||||
copyright: update the years for the FSF
|
||||
display: adjust line and column count upon a resize also when using Slang
|
||||
display: clear the help lines before a briefly shown warning
|
||||
display: don't let a message write over the second help line
|
||||
display: ensure the guiding stripe can be shown when not softwrapping
|
||||
display: exclude a bit of feedback from the tiny version
|
||||
display: show the cursor during suspension also when built with Slang
|
||||
display: skip zero-width characters on a Linux console, to avoid a mess
|
||||
docs: add a FAQ item about a self-compiled nano not reading /etc/nanorc
|
||||
docs: document the new -f/--rcfile option
|
||||
docs: document the new Sh-M-X format for binding <Shift+Meta+letter>
|
||||
docs: for the alternative bindings, rebind ^C only in the main menu
|
||||
docs: improve the description of which rc-files are read during startup
|
||||
docs: mention in the FAQ that auto-indentation is suppressed when pasting
|
||||
docs: mention that -D/--boldtext gets overridden by some nanorc options
|
||||
docs: put the three new behaviors in a bulleted list, to catch the eye
|
||||
docs: stop saying that 'set fill' enables hard-wrapping -- it does not
|
||||
docs: use more generally available arrows in the cheatsheet
|
||||
feedback: ask a clearer question when a valid lock file is encountered
|
||||
feedback: report Ctrl+Alt keystrokes as unbindable
|
||||
feedback: restore a message that can occur in help viewer or file browser
|
||||
files: alert the user afterward when an overwritten file is being edited
|
||||
files: revert the previous commit, as the extra warning is annoying
|
||||
files: warn doubly when the user is about to overwrite an existing file
|
||||
files: write a lock file also for a new file and when the name changed
|
||||
gnulib: update to its current upstream state
|
||||
help: don't waste the last column in the help viewer on narrow terminals
|
||||
help: increase the minimum help-text width from 24 to 32 columns
|
||||
help: prevent double spaces from protruding across the right edge
|
||||
help: when a key description wraps, indent its wrapped part
|
||||
input: consume and ignore the raw escape sequences for F17 to F24
|
||||
input: correct the escape sequence for PageUp/PageDown on Eterm/Urxvt
|
||||
input: Ctrl+arrow is "Esc O x" on Eterm, as on rxvt -- not "Esc o x"
|
||||
input: discard partial sequences that Slang produces for F17 to F24
|
||||
input: do not auto-indent when something is pasted into nano from outside
|
||||
input: don't discard the first keystroke after a resize when using Slang
|
||||
input: filter out Ctrl+Meta keystrokes, as they can never be shortcuts
|
||||
input: ignore bracketed pastes in help viewer and file browser
|
||||
input: ignore modifiers on a VT while executing a macro or a string bind
|
||||
input: prevent unintentional marking of text for shifted Meta keystrokes
|
||||
input: read in an external paste in one go, to allow undoing with one M-U
|
||||
input: recognize the raw escape sequences for F13 to F16 on xterm too
|
||||
locking: accept a minimal amount of data, enough for PID plus username
|
||||
locking: avoid crashing when there is a problem writing the lock file
|
||||
locking: check two magic bytes, to verify that it is a lock file
|
||||
locking: do not write a lock file when in view mode
|
||||
locking: when a lock file is unreadable, open the file itself anyway
|
||||
locking: when finding a lock file at startup, quit when user cancels
|
||||
new feature: allow specifying a custom nanorc file on the command line
|
||||
pasting: retain the mark's position when it was set at the cursor
|
||||
prompt: for a Yes-No-All, accept the first character of an external paste
|
||||
rcfile: do set the meta flag for plain <Meta+ASCII> combinations
|
||||
rcfile: require "bright", "start=", and "end=" to be in lowercase too
|
||||
rcfile: unbind keys by their key code instead of by their key string
|
||||
softwrap: suppress the guiding stripe on unaffected chunks
|
||||
speller: avoid messing up the screen when an unknown locale is used
|
||||
suspension: put in an extra terminal-initialization call for Slang
|
||||
syntax: nanohelp, nanorc: colorize the Sh-M-X format as a valid key name
|
||||
syntax: nanorc: colorize all-lowercase Meta key binds as valid too
|
||||
tweaks: add a little change that was overlooked in the previous commit
|
||||
tweaks: add an error message for something that should never occur
|
||||
tweaks: adjust or reword a few items in the FAQ
|
||||
tweaks: adjust the indentation after the previous change
|
||||
tweaks: allocate the lock data only when ready to write them
|
||||
tweaks: avoid analyzing the key string when the target key code is known
|
||||
tweaks: avoid determining the key code from the key string twice
|
||||
tweaks: avoid fiddling with the keybuffer when it's not needed
|
||||
tweaks: comment fully, so that all handled escape sequences are findable
|
||||
tweaks: condense a fragment of code
|
||||
tweaks: condense five more fragments of repetitious code
|
||||
tweaks: condense three comments to one, and do the masking more directly
|
||||
tweaks: condense three fragments of repetitious code
|
||||
tweaks: condense two comments, and reshuffle an #endif
|
||||
tweaks: correct a comment
|
||||
tweaks: correct a couple of comments about escape sequences
|
||||
tweaks: correct the description of what nano writes into the lock file
|
||||
tweaks: delete some fragments of code that have become irrelevant
|
||||
tweaks: do not leak a file descriptor when fdopen() fails
|
||||
tweaks: don't bother including Haiku escape sequences in the tiny version
|
||||
tweaks: don't enable bracketed pasting when not handling such pastes
|
||||
tweaks: drop a message that will never be seen
|
||||
tweaks: drop an unneeded call of keypad() -- we never read from topwin
|
||||
tweaks: drop a pointless suffix from two function names
|
||||
tweaks: elide a function that has become too small for its two calls
|
||||
tweaks: elide a helper function, in preparation for an improvement
|
||||
tweaks: elide an 'if', by moving the relevant code to a better place
|
||||
tweaks: elide a small function, as it's in fact needed just once
|
||||
tweaks: elide a somewhat costly call by remembering some state
|
||||
tweaks: elide a variable, and rename its sister
|
||||
tweaks: elide three checks of a shortcut's meta flag
|
||||
tweaks: ensure that editor name and user name are NUL terminated
|
||||
tweaks: exclude an unneeded fragment of code from the tiny version
|
||||
tweaks: exclude two unneeded fragments of code from the tiny version
|
||||
tweaks: free two strings as soon as they are no longer needed
|
||||
tweaks: frob a couple of indentations and white lines
|
||||
tweaks: fuse two nearly identical functions into a single one
|
||||
tweaks: gather four calls that are always done together into a function
|
||||
tweaks: harmonize the amount of lock data that we read and write
|
||||
tweaks: improve a comment by indirectly referring to the ncurses docs
|
||||
tweaks: in comments, reword "titlebar" and "statusbar" to two words each
|
||||
tweaks: initialize three booleans straightaway, when they are declared
|
||||
tweaks: initialize three more booleans straightaway, at declaration
|
||||
tweaks: judge from the key code itself whether it is a Meta keystroke
|
||||
tweaks: make a couple of comments more precise
|
||||
tweaks: move a function to after the one that it calls
|
||||
tweaks: move a function to be before the ones that call it
|
||||
tweaks: move a function to before the one that calls it
|
||||
tweaks: move a function to related ones, and after one that it calls
|
||||
tweaks: move a function to right before the one that calls it
|
||||
tweaks: move another function to after the one that it calls
|
||||
tweaks: move another function to before the one that calls it
|
||||
tweaks: move another function, to group the deleting ones together
|
||||
tweaks: move three functions to the file where they are mainly used
|
||||
tweaks: rearrange a few global variables, to group things better
|
||||
tweaks: recompute the wrapping point just once
|
||||
tweaks: reduce the scope of a variable, and reshuffle a declaration
|
||||
tweaks: reduce the scope of two constants and of four variables
|
||||
tweaks: reformat a comment, and resuffle a line to match byte order
|
||||
tweaks: remove a feedback message that is never shown
|
||||
tweaks: remove a redundant call, as there is nothing to free there
|
||||
tweaks: remove a superfluous check
|
||||
tweaks: remove some superfluous conditions for rewriting a lock file
|
||||
tweaks: remove the now-unneeded code related to bracketed pasting
|
||||
tweaks: remove the now-unused meta flag from 'keystruct'
|
||||
tweaks: remove two superfluous assignments, and rename a variable
|
||||
tweaks: rename a function and its parameter, to be more fitting
|
||||
tweaks: rename a function, to be a bit more expressive
|
||||
tweaks: rename a function, to make it not contain the name of another
|
||||
tweaks: rename a parameter and invert its logic, and correct a comment
|
||||
tweaks: rename five variables, away from a single letter
|
||||
tweaks: rename two functions, to make more sense
|
||||
tweaks: rename two parameters, to be more general and to sound shorter
|
||||
tweaks: rename two variables, to make more sense
|
||||
tweaks: renumber some FAQ items in preparation for adding another
|
||||
tweaks: reorder two symbols
|
||||
tweaks: reshuffle some assignments for a return value
|
||||
tweaks: reshuffle some declarations
|
||||
tweaks: reshuffle some declarations, and expand a few variable names
|
||||
tweaks: reshuffle some lines, to avoid tallying the menus when not needed
|
||||
tweaks: reshuffle some lines, to group all ignored keystrokes together
|
||||
tweaks: reshuffle three lines, to make the grouping tighther
|
||||
tweaks: reshuffle two lines, to do the linking first, then the content
|
||||
tweaks: reword two comments, and rewrap another
|
||||
tweaks: rewrap a comment and a line, and reshuffle a fragment of code
|
||||
tweaks: rewrap two lines, for consistency with similar lines
|
||||
tweaks: rewrite the same file name into the lock file as the first time
|
||||
tweaks: slightly condense a function by conflating case
|
||||
tweaks: stop recognizing escape sequences for a key without meaning
|
||||
tweaks: suggest a few more alternative key bindings and unbindings
|
||||
tweaks: take just one shot at reading the lock file, and correct a type
|
||||
tweaks: trim some excessive error checking and key-name frobbing
|
||||
tweaks: tumble three conditions, for consistency in comparisons
|
||||
tweaks: unabbreviate "argument" in the documentation
|
||||
tweaks: use a simple subtraction instead of a function call
|
||||
usage: improve the description of --restricted and --quickblank
|
||||
|
||||
Brand Huntsman (2):
|
||||
input: beep when invalid key is pressed at yesno prompt or in linter menu
|
||||
input: recognize the start and stop sequences of a bracketed paste
|
||||
|
||||
|
||||
Changes between v4.6 and v4.7:
|
||||
------------------------------
|
||||
|
||||
Benno Schulenberg (39):
|
||||
build: add the uploading of PDF and cheatsheet to the release script
|
||||
build: avoid three compiler warnings when using gcc-9.2 or newer
|
||||
build: fix compilation for --enable-tiny --enable-wrapping
|
||||
build: fix compilation on macOS, where 'st_mtim' is unknown
|
||||
build: fix compilation when configured with --disable-justify
|
||||
bump version numbers and add a news item for the 4.7 release
|
||||
display: don't color the space that separates line numbers from text
|
||||
docs: add or improve the 'description' meta tag in the two HTML pages
|
||||
docs: add the 'lang' attribute in the right place to the two HTML pages
|
||||
docs: mention that all keywords in a nanorc file should be in lowercase
|
||||
docs: mention that a negative number after "+" counts from the end
|
||||
gnulib: update to its current upstream state
|
||||
input: make <Tab> indent only when mark and cursor are on different lines
|
||||
justify: distinguish between tabs and spaces when comparing indentation
|
||||
justify: treat consecutive indentations that look the same as the same
|
||||
linter: beep when trying to go beyond first or last message
|
||||
rcfile: accept also function names and menu names only in lowercase
|
||||
rcfile: accept only keywords in all lowercase, for speed of comparison
|
||||
rcfile: demand that function 'exit' is bound in the file browser
|
||||
syntax: nanohelp: colorize also ^/ as a possible keystroke
|
||||
syntax: sh: recognize shell rc files also in dedicated directories
|
||||
tweaks: avoid using strlen() where it is not needed
|
||||
tweaks: drop M-Space and ^Space from the browser's key list
|
||||
tweaks: improve two comments and the ordering of some operands
|
||||
tweaks: move three functions to the file where they are used
|
||||
tweaks: optimize the trimming of trailing whitespace
|
||||
tweaks: remove a stray space
|
||||
tweaks: rename a function, to get out of the way for another rename
|
||||
tweaks: rename a function, to get rid of a useless suffix
|
||||
tweaks: reshuffle a few lines, for brevity or speed or consistency
|
||||
tweaks: reshuffle a few lines, for symmetry with the preceding function
|
||||
tweaks: reshuffle a fragment of code, for efficiency
|
||||
tweaks: reshuffle and rename a few things, to elide duplication
|
||||
tweaks: reshuffle an item, to avoid a lone 'else'
|
||||
tweaks: reshuffle two declarations, for compactness
|
||||
tweaks: slightly streamline the search for a possible wrapping point
|
||||
tweaks: trim or adjust some whitespace in HTML, and add two keywords
|
||||
tweaks: unwrap a few lines, and move some strings to among their peers
|
||||
wrapping: never break in the quoting part nor in the indentation part
|
||||
|
||||
|
||||
Changes between v4.5 and v4.6:
|
||||
------------------------------
|
||||
|
||||
@@ -194,7 +1037,7 @@ Benno Schulenberg (60):
|
||||
tweaks: sort two keywords strictly alphabetically
|
||||
tweaks: speed up determining the width of plain ASCII characters
|
||||
tweaks: speed up the counting of the menu entries to be shown
|
||||
tweaks: use a more effecient way to skip storing an empty file name
|
||||
tweaks: use a more efficient way to skip storing an empty file name
|
||||
tweaks: use an early return when there is no tilde
|
||||
tweaks: use 'void' in prototypes of parameterless functions [coverity]
|
||||
usage: mark the -J/--guidestripe option plus argument as translatable
|
||||
@@ -960,7 +1803,7 @@ Benno Schulenberg (87):
|
||||
tweaks: remove a check that was made redundant by the previous commit
|
||||
tweaks: remove a now-unused parameter from four functions
|
||||
tweaks: remove an unneeded check for NULL, and rename a parameter
|
||||
tweaks: remove a stray file that was accidentally comitted
|
||||
tweaks: remove a stray file that was accidentally committed
|
||||
tweaks: remove some old debugging code
|
||||
tweaks: rename a bunch of variables, to make it clearer what they contain
|
||||
tweaks: rename a flag, to match the name of the option
|
||||
@@ -1475,7 +2318,7 @@ Benno Schulenberg (65):
|
||||
undo: when redoing, don't try to find a line number that might not exist
|
||||
|
||||
Brand Huntsman (1):
|
||||
color: remove unneeded bright comparision to prevent duplicate pairs
|
||||
color: remove unneeded bright comparison to prevent duplicate pairs
|
||||
|
||||
David Lawrence Ramsey (3):
|
||||
docs: mention that errorcolor does have default colors
|
||||
@@ -1699,7 +2542,7 @@ Benno Schulenberg (103):
|
||||
docs: mention that macros work correctly only on terminal emulators
|
||||
docs: remove another remark about indenting lacking undo capability
|
||||
docs: update references to the nanorc files for the XDG changes
|
||||
files: avoid an abortion when excuting a command in a new buffer
|
||||
files: avoid an abortion when executing a command in a new buffer
|
||||
gnulib: update to its current upstream state
|
||||
help: don't fall back to other syntaxes if there is no nanohelp one
|
||||
history: after loading the lists, mark them as unchanged
|
||||
@@ -1795,7 +2638,7 @@ Brand Huntsman (3):
|
||||
David Lawrence Ramsey (18):
|
||||
build: add history.c to the list of files with translatable strings
|
||||
display: don't cut off zero-width characters at the end of a chunk
|
||||
docs: decribe the bindable functions 'recordmacro' and 'runmacro'
|
||||
docs: describe the bindable functions 'recordmacro' and 'runmacro'
|
||||
docs: document the more everyday names of three bindable functions
|
||||
docs: remove man page reference to indent/unindent lacking undo/redo
|
||||
files: don't change file format when inserting into an existing buffer
|
||||
|
||||
@@ -3007,7 +3007,7 @@ GNU nano 1.3.5 - 2004.11.22
|
||||
- Don't change the file format when we insert another file into
|
||||
the current one. (DLR)
|
||||
do_insertfile()
|
||||
- Simplify by reusing variables whereever possible, and add a
|
||||
- Simplify by reusing variables wherever possible, and add a
|
||||
parameter execute to indicate whether or not to be in "Execute
|
||||
Command" mode. (DLR)
|
||||
- Rework so that goto is no longer needed, using do_writeout()
|
||||
@@ -5035,7 +5035,7 @@ GNU nano 1.1.99pre2 - 2003.02.03
|
||||
- Fix the mouse code to work with lines longer than COLS and
|
||||
with the proper positioning, including special characters.
|
||||
(David Benbennick)
|
||||
do_preserve_msg():
|
||||
do_preserve_msg()
|
||||
- Unsplit error message into a single fprintf call. (Jordi)
|
||||
main()
|
||||
- Call load_file with arg 0 for insert, as we aren't really
|
||||
@@ -5143,7 +5143,7 @@ GNU nano 1.1.99pre1 - 2003.01.17
|
||||
- Added --enable-all option to compile in all the extra stuff
|
||||
we'd normally need extra flags for.
|
||||
- color.c:
|
||||
update_color():
|
||||
update_color()
|
||||
- Remove an unneeded edit_refresh() call after do_colorinit().
|
||||
(David Benbennick)
|
||||
- cut.c:
|
||||
@@ -5778,7 +5778,7 @@ GNU nano 1.1.10 - 2002.07.25
|
||||
Also, pass current_x_find to strstrwrapper() so we know whether
|
||||
we're at the beginning of a string or not (see changes to
|
||||
strstrwrapper() below), and reset it between lines. (DLR)
|
||||
do_gotoline():
|
||||
do_gotoline()
|
||||
- Make sure placewewant is zero after we go to a line. (David
|
||||
Benbennick)
|
||||
do_gotopos()
|
||||
@@ -6036,7 +6036,7 @@ GNU nano 1.1.8 - 2002.03.30
|
||||
- Catalan and Spanish translation updates. (Jordi)
|
||||
- Typo. (DLR)
|
||||
- po/fr.po:
|
||||
- French translation updates (Jean-Philippe Guérard).
|
||||
- French translation updates. (Jean-Philippe Guérard)
|
||||
- po/gl.po:
|
||||
- Galician translation updates. (Jacobo Tarrio)
|
||||
- po/uk.po, po/ru.po:
|
||||
@@ -6156,10 +6156,9 @@ GNU nano 1.1.7 - 2002.03.05
|
||||
- po/it.po:
|
||||
- Italian translation updates. (Marco Colombo)
|
||||
- po/cs.po:
|
||||
- Partial Czech translation updates. (Vaclav Haisman)
|
||||
- Partial Czech translation updates. (Václav Haisman)
|
||||
- po/hu.po:
|
||||
- Hungarian translation updates, or to be precise, rewrite.
|
||||
(Gergely Nagy)
|
||||
- Hungarian translation updates, or to be precise, rewrite. (Gergely Nagy)
|
||||
- po/uk.po, po/ru.po:
|
||||
- Russian and Ukrainian translation updates. (Sergey A. Ribalchenko)
|
||||
- po/da.po:
|
||||
@@ -6268,7 +6267,7 @@ nano-1.1.6 - 2002.01.25
|
||||
- po/nn.po:
|
||||
- Norwegian nynorsk translation updates. (Kjetil Torgrim Homme)
|
||||
- po/nb.po:
|
||||
- New Norwegian bokmål translation. (Stig E Sandoe <stig@ii.uib.no>)
|
||||
- New Norwegian bokmål translation, by Stig E Sandoe <stig@ii.uib.no>.
|
||||
- po/da.po:
|
||||
- Danish translation update. (Keld Simonsen)
|
||||
|
||||
@@ -6380,8 +6379,10 @@ nano-1.1.4 - 2001.12.11
|
||||
do_wrap()
|
||||
- Many fixes. (David Lawrence Ramsey)
|
||||
do_spell()
|
||||
- Dont prompt for replace if we don't change the word in
|
||||
- Don't prompt for replace if we don't change the word in
|
||||
question. (Rocco Corsi)
|
||||
- m4/gettext.m4:
|
||||
- diff against mutt 1.2.5's gettext.m4.
|
||||
- po/de.po:
|
||||
- German translation updates. (Karl Eichwalder)
|
||||
- po/ru.po:
|
||||
@@ -6394,8 +6395,6 @@ nano-1.1.4 - 2001.12.11
|
||||
- Spanish translation updates. (Jordi)
|
||||
- po/fr.po:
|
||||
- French translation updates. (Michel Robitaille)
|
||||
- m4/gettext.m4:
|
||||
- diff against mutt 1.2.5's gettext.m4.
|
||||
|
||||
nano-1.1.3 - 2001.10.26
|
||||
- General
|
||||
@@ -6770,7 +6769,7 @@ nano-1.1.0 - 2001.07.15
|
||||
- po/es.po, po/ca.po:
|
||||
- Updated. (Jordi)
|
||||
- po/gl.po:
|
||||
- Galician translation by Jacobo Tarrío.
|
||||
- New Galician translation, by Jacobo Tarrío <jtarrio@trasno.net>.
|
||||
- po/uk.po, po/ru.po:
|
||||
- New Ukrainian and Russian translations by Sergey A. Ribalchenko
|
||||
<fisher@obu.ck.ua>, thanks!
|
||||
@@ -6779,9 +6778,9 @@ nano-1.1.0 - 2001.07.15
|
||||
- po/it.po
|
||||
- Updated Italian translation by Marco Colombo.
|
||||
- po/no.po:
|
||||
- New Norwegian translation by Eivind Kjørstad <ekj@vestdata.no>.
|
||||
- New Norwegian translation, by Eivind Kjørstad <ekj@vestdata.no>.
|
||||
- po/sv.po:
|
||||
- New Swedish translation by Christian Rose <menthos@menthos.com>.
|
||||
- New Swedish translation, by Christian Rose <menthos@menthos.com>.
|
||||
|
||||
nano 1.0.1 - 2001.04.06
|
||||
- General:
|
||||
@@ -6825,15 +6824,15 @@ nano-1.0.0 - 2001.03.22
|
||||
the "new" C++ reserved word, even though there is likely no way
|
||||
nano will EVER be compilable with a C++ compiler. (suggested by
|
||||
Rocco Corsi).
|
||||
- ca.po, es.po:
|
||||
- Final tweaks for Nano 1.0.
|
||||
- cs.po:
|
||||
- Czech translation from Vaclav Haisman.
|
||||
- nano.info:
|
||||
- Added dir entry. (Albert Chin)
|
||||
- winio.c:
|
||||
statusq()
|
||||
- Added NANO_BACK_KEY and NANO_FORWARD_KEY cases for left and right.
|
||||
- ca.po, es.po:
|
||||
- Final tweaks for Nano 1.0.
|
||||
- cs.po:
|
||||
- New Czech translation, by Václav Haisman <V.Haisman@sh.cvut.cz>.
|
||||
|
||||
1.0-test prerelease - 2001.03.17
|
||||
- nano.c:
|
||||
@@ -6847,7 +6846,7 @@ nano-1.0.0 - 2001.03.22
|
||||
edit update. Fixes bug #57.
|
||||
- search.c:
|
||||
print_replaced()
|
||||
- s/occurence/occurrence typos. (Jordi)
|
||||
- Fix typos in "occurrence". (Jordi)
|
||||
search_init()
|
||||
- If using Pico mode and regex and same answer is entered, use
|
||||
last_search string instead of answer. Fixes bug #56.
|
||||
@@ -6888,13 +6887,13 @@ nano-0.9.99pre3 - 2001.02.19
|
||||
- fi.po:
|
||||
- Translation updates by Pauli Virtanen.
|
||||
- hu.po:
|
||||
- Hungarian translation by Horvath Szabolcs.
|
||||
- New Hungarian translation, by Horvath Szabolcs <horvaths@penguinpowered.com>.
|
||||
- id.po:
|
||||
- Translation updates by Tedi Heriyanto.
|
||||
- es.po:
|
||||
- Translation updates and grammatical/typo fixes. (Jordi)
|
||||
- ca.po:
|
||||
- Catalan translation by Jordi Mallach :)
|
||||
- Catalan translation by Jordi Mallach. :)
|
||||
- Miquel Vidal <miquel@sindominio.net> went over it and corrected
|
||||
many typos and completed bits that remained untranslated by error.
|
||||
|
||||
@@ -6998,7 +6997,6 @@ General
|
||||
repeated string defs and globals.
|
||||
do_justify()
|
||||
- Small fix for totsize calculation. (Rob)
|
||||
|
||||
- fi.po:
|
||||
- Update by Pauli Virtanen.
|
||||
|
||||
@@ -7395,7 +7393,7 @@ nano 0.9.18 - 2000.09.18
|
||||
- es.po:
|
||||
- Translated new strings and minor updates. (Jordi)
|
||||
- de.po
|
||||
- Revised translations by <floki@bigfoot.com>.
|
||||
- Revised translations by Florian König.
|
||||
|
||||
nano-0.9.17 - 2000.09.04
|
||||
- General
|
||||
@@ -7426,7 +7424,7 @@ nano-0.9.17 - 2000.09.04
|
||||
do_toggle()
|
||||
- Added checks for no help and no wrap mode, and print opposite
|
||||
enable/disable message.
|
||||
do_suspend(), do_cont():
|
||||
do_suspend(), do_cont()
|
||||
- New functions, handle suspend signal in a Pico-like manner and
|
||||
work with Meta-Z.
|
||||
- winio.c:
|
||||
@@ -7447,7 +7445,7 @@ nano-0.9.17 - 2000.09.04
|
||||
search_abort()
|
||||
- Now calls edit_refresh_clearok when MARK_ISSET to handle screen
|
||||
ugliness bug (reported by Ken Tyler).
|
||||
findnextstr():
|
||||
findnextstr()
|
||||
- Added reset for placewewant. (Ben Roberts)
|
||||
- Fixed check for string that only occurs on the same line failing
|
||||
(bug discovered by Ken Tyler).
|
||||
@@ -7532,10 +7530,10 @@ nano-0.9.14 - 2000.07.27
|
||||
- Changed check for filename to filename[0]. Added some code,
|
||||
overall fixes bug #30 =-)
|
||||
- nano.c:
|
||||
do_justify() & do_wrap():
|
||||
do_justify(), do_wrap()
|
||||
- totsize-related fixes. (Rob)
|
||||
- de.po
|
||||
- Revised translations by floki@bigfoot.com
|
||||
- Revised translations by Florian König.
|
||||
|
||||
nano-0.9.13 - 2000.07.23
|
||||
- Implemented Pico's -k mode. New flag CUT_TO_END, option (-k, --cut),
|
||||
@@ -7548,32 +7546,32 @@ nano-0.9.13 - 2000.07.23
|
||||
- Don't edit_refresh() if the bottom of the file is in the edit
|
||||
buffer. (Adam)
|
||||
- nano.c:
|
||||
main():
|
||||
main()
|
||||
- TABSIZE now set before first call to edit_refresh. (Bill Soudan)
|
||||
- Different ^C kill code (patch by Christian Weisgerber).
|
||||
die():
|
||||
die()
|
||||
- More intelligent emergency-save filename selection. (Rob)
|
||||
do_spell():
|
||||
do_spell()
|
||||
- Changed exit semantics a bit so that aspell wouldn't get
|
||||
all screwy (bug discovered by Joshua Jensen).
|
||||
- files.c:
|
||||
read_file():
|
||||
read_file()
|
||||
- Added init of buf variable, hopefully this will stop the
|
||||
"bleeding" of text seen with mutt and using i18n.
|
||||
write_file():
|
||||
write_file()
|
||||
- Added code to check to see if using -l and the file is not
|
||||
in fact a link. This should fix the behavior where a file
|
||||
that does not have write permission but could be removed and
|
||||
rewritten is saved without error. Please test this feature
|
||||
and give feedback.
|
||||
- search.c:
|
||||
search_init():
|
||||
search_init()
|
||||
- Added " (to replace)" statement to end of search string if
|
||||
we are doing a replace. Manually converted all the translations
|
||||
from '%s' to '%s%s' to ensure they still work with the new code.
|
||||
Also put in the translation for " (replace)" in the .po's. Hope
|
||||
I didn't step on your toes doing this Jordi. (Chris)
|
||||
do_search(), do_replace():
|
||||
do_search(), do_replace()
|
||||
- Removed call to search_abort()/replace_abort() before call to
|
||||
the opposite function.
|
||||
- Fixed bug #28.
|
||||
@@ -7612,52 +7610,47 @@ nano-0.9.12 - 2000.07.07
|
||||
- Corrected FIXME in do_enter with explanation. (Rob)
|
||||
- Fixed FIXME in do_justify, resulted in creation of
|
||||
fix_editbot [also fixed in do_enter] (winio.c). (Rob)
|
||||
help_init():
|
||||
help_init()
|
||||
- Moved newline out of if statement. (Rocco Corsi)
|
||||
do_char():
|
||||
do_char()
|
||||
- Magic Line related code in do_char. (Rob)
|
||||
do_backspace(), do_delete():
|
||||
do_backspace(), do_delete()
|
||||
- Added magic line code here too.
|
||||
|
||||
- de.po:
|
||||
- Revised translations by floki@bigfoot.com.
|
||||
- fi.po:
|
||||
- Finnish translation by pauli.virtanen@saunalahti.fi.
|
||||
- utils.c:
|
||||
- Added new_magicline()
|
||||
- winio.c:
|
||||
- Added stdlib.h to includes, found by OpenBSD gcc.
|
||||
- lots of new commenting around display functions
|
||||
do_yesno(), nanogetstr():
|
||||
do_yesno(), nanogetstr()
|
||||
- Removed now unnecessary raw/cbreak combos.
|
||||
- Removed gettext calls from "Y(es)", "N(o)", "A(ll)" and "^C", till
|
||||
we decide if those keybindings should be translated. (Jordi)
|
||||
clear_bottomwin():
|
||||
clear_bottomwin()
|
||||
- Removed wrefresh(edit) call.
|
||||
edit_update_top():
|
||||
edit_update_top()
|
||||
- Fixed a bug that caused nano to not update when
|
||||
current->next == NULL (e.g. paging down to the very bottom of
|
||||
ABOUT NLS wouldn't work).
|
||||
fix_editbot:
|
||||
fix_editbot()
|
||||
- Added (should rebuild editbot from a valid edittop). (Rob)
|
||||
edit_add:
|
||||
edit_add()
|
||||
- removal of redundant call to mvwaddnstr.
|
||||
- de.po:
|
||||
- Revised translations by Florian König.
|
||||
- fi.po:
|
||||
- New Finnish translation, by Pauli Virtanen <pauli.virtanen@saunalahti.fi>.
|
||||
|
||||
nano-0.9.11 - 2000.06.20
|
||||
- New flag "-T" or "--tabsize" to specify how to display tab widths.
|
||||
Affects main() in nano.c, strlenpt(), xpt() and actual_x() (et al) in
|
||||
winio.c, and nano.h. Many hardcoded "8"s have been changed to the
|
||||
TABSIZE int. Added changes to nano.1 and nano.1.html.
|
||||
- id.po:
|
||||
- Indonesian translation by Tedi Heriyanto.
|
||||
- es.po:
|
||||
- Updated translation. (Jordi Mallach)
|
||||
- winio.c
|
||||
- Rewrite of display functions to correct the display problems
|
||||
we had been seeing. Affects: add_marked_sameline, edit_add,
|
||||
and many others. (Rob Siemborski)
|
||||
- totsize fixes. (Rob Siemborski)
|
||||
total_refresh():
|
||||
total_refresh()
|
||||
- Cut display_main_list call, as this function is only supposed to
|
||||
refresh what's already on the screen, not go through the process
|
||||
of adding the text again.
|
||||
@@ -7669,12 +7662,12 @@ nano-0.9.11 - 2000.06.20
|
||||
Changed all calls to editwinrows - 1 in nano.c and move.c.
|
||||
- Removed all functions that were split into other files.
|
||||
Affects LOTS of funcs.
|
||||
do_enter():
|
||||
do_enter()
|
||||
- Added reset of placewewant to end.
|
||||
do_insertfile():
|
||||
do_insertfile()
|
||||
- Fix display problem when using Ctrl-R to load a file
|
||||
into the buffer. (Rob Siemborski)
|
||||
handle_sigwinch():
|
||||
handle_sigwinch()
|
||||
- Added titlebar(), edit_refresh() and display_main_list() calls
|
||||
because a resize wasn't picking up on possible different width
|
||||
correctly.
|
||||
@@ -7689,17 +7682,21 @@ nano-0.9.11 - 2000.06.20
|
||||
- search.c:
|
||||
- Contains all our searching and related functions, (do_search(),
|
||||
findnextstr(), do_replace(), do_gotoline()).
|
||||
- id.po:
|
||||
- New Indonesian translation, by Tedi Heriyanto <tedi_h@gmx.net>.
|
||||
- es.po:
|
||||
- Updated translation. (Jordi Mallach)
|
||||
|
||||
nano-0.9.10 - 2000.06.04
|
||||
- es.po:
|
||||
- Translation updates. (Jordi)
|
||||
- AUTHORS, nano.1.html, TODO, README:
|
||||
- Documentation and email address updates. (Jordi)
|
||||
- nano.c:
|
||||
main():
|
||||
main()
|
||||
- Moved Adam's termio code down to after getopt() and before initscr()
|
||||
to stop people losing their SIGINT character when using args that
|
||||
exit nano before it runs (--version, --help, etc).
|
||||
- es.po:
|
||||
- Translation updates. (Jordi)
|
||||
|
||||
nano-0.9.9 - 2000.05.31
|
||||
- Makefile.am:
|
||||
@@ -7708,8 +7705,6 @@ nano-0.9.9 - 2000.05.31
|
||||
- Spelling fixes. (Jordi Mallach)
|
||||
- Removed CFLAGS changes for gcc, reduces portability according to
|
||||
some, and it certainly doesn't seem to decrease exe size.
|
||||
- es.po:
|
||||
- Spanish translation updates. (Jordi Mallach)
|
||||
- POTFILES.in:
|
||||
- Added global.c file, was screwing up translations (i.e. they
|
||||
weren't getting done).
|
||||
@@ -7747,6 +7742,8 @@ nano-0.9.9 - 2000.05.31
|
||||
- winio.c:
|
||||
total_refresh():
|
||||
- Completely rewrote function, not quite so brain-damaged now.
|
||||
- es.po:
|
||||
- Spanish translation updates. (Jordi Mallach)
|
||||
|
||||
nano-0.9.8 - 2000.05.18
|
||||
- nano.c:
|
||||
@@ -7768,7 +7765,7 @@ nano-0.9.8 - 2000.05.18
|
||||
should now only be called once, at the bottom of the main()
|
||||
loop.
|
||||
- global.c:
|
||||
shortcut_init():
|
||||
shortcut_init():
|
||||
- Removed suspend sc_init call and suspend message because suspend
|
||||
is no longer needed in the shortcut list to work properly.
|
||||
|
||||
@@ -7787,7 +7784,6 @@ nano-0.9.7 - 2000.05.14
|
||||
display update (bug discovered by Ken Tyler).
|
||||
|
||||
nano-0.9.6 - 2000.05.08
|
||||
- New Italian translation (it.po), by Daniele Medri.
|
||||
- nano.c:
|
||||
page_up(), page_down():
|
||||
- Added reset of placewewant to 0, as it should be.
|
||||
@@ -7806,6 +7802,12 @@ nano-0.9.6 - 2000.05.08
|
||||
- Removed yucky code that didn't work, this function now just
|
||||
computes edittop and editbot and calls edit_refresh() to do the
|
||||
rest, which removes a lot of duplicate code...
|
||||
- it.po:
|
||||
- New Italian translation, by Daniele Medri <madrid@linux.it>.
|
||||
- fr.po:
|
||||
- New French translation, by Pierre Tane <tanep@bigfoot.com>.
|
||||
- de.po:
|
||||
- New German translation, by Florian König <floki@bigfoot.com>.
|
||||
|
||||
nano-0.9.5 - 2000.05.01
|
||||
- Removed bytes from file struct because it was computationally wasteful.
|
||||
@@ -7831,25 +7833,23 @@ nano-0.9.5 - 2000.05.01
|
||||
- Removed inefficient call to edit_refresh() after every keystroke.
|
||||
It is now up each function to leave the screen in a good state.
|
||||
- winio.c:
|
||||
do_cursorpos()
|
||||
do_cursorpos():
|
||||
- Rewritten to not use bytes from filestruct by an incremental sum.
|
||||
update_line(), reset_cursor():
|
||||
- Optimized calls to xplustabs() through a single variable.
|
||||
- update_line() now takes a new arg, an index into the string
|
||||
for where to update the line from. Needed for new update
|
||||
code.
|
||||
for where to update the line from. Needed for new update code.
|
||||
- configure.in:
|
||||
- Better checks for slang, allows argument to --with-slang.
|
||||
(Albert Chin-A-Young)
|
||||
- Removed -Iintl from CFLAGS in gcc check.
|
||||
- Makefile.am:
|
||||
- Addition of -Iintl for gettext (Albert Chin-A-Young)
|
||||
- Addition of -Iintl for gettext. (Albert Chin-A-Young)
|
||||
|
||||
nano-0.9.4 - 2000.04.25
|
||||
- Fixed calls to no_help and changed them to the more consistent
|
||||
ISSET(NO_HELP). Fixed return val of no_help to be what it should (2,
|
||||
not 1. Code to temporarily disable NO_HELP when in the
|
||||
help system. (Adam Rogoyski)
|
||||
- Fixed calls to no_help and changed them to the more consistent ISSET(NO_HELP).
|
||||
Fixed return val of no_help to be what it should (2, not 1). Code to
|
||||
temporarily disable NO_HELP when in the help system. (Adam Rogoyski)
|
||||
- cut.c:
|
||||
do_marked_cut(), do_cut(), do_uncut():
|
||||
- Commented out unnecessary bits when NANO_SMALL is being used.
|
||||
@@ -7985,23 +7985,26 @@ nano-0.8.8 - 2000.03.12
|
||||
support i18n.
|
||||
- nano.c:
|
||||
includes: Added sys/param.h and limits.h. (Adam Rogoyski).
|
||||
statics: Changed some things that were not necessarily static
|
||||
(Adam Rogoyski).
|
||||
nrealloc(): New function, similar to nmalloc(). Changed calls from
|
||||
statics: Changed some things that were not necessarily static.
|
||||
(Adam Rogoyski)
|
||||
nrealloc():
|
||||
New function, similar to nmalloc(). Changed calls from
|
||||
realloc() to nrealloc. (Adam Rogoyski)
|
||||
empty_line(), no_spaces(), justify_format(), do_justify():
|
||||
New functions for justify function. (Adam Rogoyski)
|
||||
- winio.c:
|
||||
blank_edit(): Added wrefresh call to edit so that screen updates (like
|
||||
on ^L) actually work.
|
||||
xplustabs(), xpt(), strlenpt(): Fixed off-by-one buglets. (Adam Rogoyski)
|
||||
blank_edit():
|
||||
Added wrefresh call to edit so that screen updates (like on ^L)
|
||||
actually work.
|
||||
xplustabs(), xpt(), strlenpt():
|
||||
Fixed off-by-one buglets. (Adam Rogoyski)
|
||||
|
||||
nano-0.8.7 - 2000.03.01
|
||||
- main.c:
|
||||
do_wrap(): Better fix for segfaults, and fix for lines being wrapped
|
||||
to a single character on one line when no good place to
|
||||
break the line exists, and for wrapping lines longer than
|
||||
COLS.
|
||||
do_wrap():
|
||||
Better fix for segfaults, and fix for lines being wrapped
|
||||
to a single character on one line when no good place to break
|
||||
the line exists, and for wrapping lines longer than COLS.
|
||||
- nano.1.html:
|
||||
Html version of man page, now included in dist. For
|
||||
the benefit of nano packages in Linux distributions.
|
||||
@@ -8024,7 +8027,8 @@ nano-0.8.6 - 2000.02.24
|
||||
|
||||
nano-0.8.5 - 2000.02.18
|
||||
- nano.c:
|
||||
main(): Finally fixed tilde being input on page up/down keys in
|
||||
main():
|
||||
Finally fixed tilde being input on page up/down keys in
|
||||
certain terminal types. Fix was input 26->91->5[34] check
|
||||
for 126, if so make the kbinput PAGE UP/DOWN, else unget
|
||||
the keystroke and continue. Added #include <ioctl.h> for
|
||||
@@ -8038,7 +8042,7 @@ nano-0.8.5 - 2000.02.18
|
||||
edit_refresh() is now unmanageably complex, and must be
|
||||
revamped.
|
||||
check_statblank():
|
||||
Added check for constupdate, makes things less choppy
|
||||
Added check for constupdate, makes things less choppy.
|
||||
(Adam Rogoyski)
|
||||
|
||||
nano-0.8.4 - 2000.02.11
|
||||
@@ -8049,7 +8053,8 @@ nano-0.8.4 - 2000.02.11
|
||||
Removed redundant NANO_CONTROL_H from backspace shortcut,
|
||||
added char 127 which should have been there.
|
||||
- nano.c:
|
||||
main(): Fix for loops looping until MAIN_LEN, added -1 to stop
|
||||
main():
|
||||
Fix for loops looping until MAIN_LEN, added -1 to stop
|
||||
segfaults. (Adam Rogoyski)
|
||||
- Makefile.am: Added all source filenames. (Adam Rogoyski)
|
||||
- nano.1: Fixed mail addressed and added mailing list address.
|
||||
@@ -8057,13 +8062,15 @@ nano-0.8.4 - 2000.02.11
|
||||
|
||||
nano-0.8.3 - 2000.02.08
|
||||
- New Pico mode (-p, --pico), toggles (more) compatibility with the
|
||||
Pico messages displayed in the shortcut list. Note that there are still
|
||||
small differences in this mode.
|
||||
- nano.h: New shortcut struct format, for the benefit of i18n and
|
||||
Pico messages displayed in the shortcut list. Note that there are
|
||||
still small differences in this mode.
|
||||
- nano.h:
|
||||
New shortcut struct format, for the benefit of i18n and
|
||||
our help menu. Removed shortcut message macros, they are
|
||||
now all in shortcut_init in global.c.
|
||||
- nano.c:
|
||||
do_wrap(): Removed resetting of current_x when we are in fact
|
||||
do_wrap():
|
||||
Removed resetting of current_x when we are in fact
|
||||
wrapping to the next line, fixes a bug in -i mode.
|
||||
do_enter():
|
||||
Rewrote the autoindent mode code to be a lot less pretty,
|
||||
@@ -8116,7 +8123,8 @@ nano-0.8.1 - 2000.01.28
|
||||
global variable fill, affects check_wrap(), do_wrap(), main(), usage(),
|
||||
global.c and proto.h.
|
||||
- nano.c:
|
||||
write_file(): Added (incredibly) necessary check for EPERM when
|
||||
write_file():
|
||||
Added (incredibly) necessary check for EPERM when
|
||||
link() fails. This allows us to actually save
|
||||
files via rename() on filesystems that don't
|
||||
support hard links (AIEEEEEE).
|
||||
@@ -8136,7 +8144,7 @@ nano-0.8.0 - 2000.01.25
|
||||
- View flag (-v, --view) implemented. Global variable view_mode, affects
|
||||
main loop of nano.c and new_file(). (Chris)
|
||||
- nano.c:
|
||||
split checks for TERMIOS_H and TERMIO_H up so we
|
||||
Split checks for TERMIOS_H and TERMIO_H up so we
|
||||
can (theoretically) include them both, which is good.
|
||||
handle_sigwinch():
|
||||
Added check for ncurses.h. (Andy Kahn)
|
||||
@@ -8254,7 +8262,6 @@ nano 0.7.6 - 2000.01.15
|
||||
than one huge buffer, and replaced the strcat at the end
|
||||
with an index variable. Added call to read_bytes().
|
||||
do_next_word(): New function, binding is Ctrl-Space (0). (Chris)
|
||||
|
||||
- winio.c:
|
||||
bottombars(): Fixed non-expanding shortcut keys at bottom of screen.
|
||||
(formula is extra space needed = COLS / 6 - 13).
|
||||
|
||||
@@ -330,7 +330,7 @@ GNU nano 2.5.2 - 2016.02.12
|
||||
|
||||
2016-02-09 Benno Schulenberg <bensberg@justemail.net>
|
||||
* src/files.c (stat_with_alloc, open_buffer, write_file): Check the
|
||||
result of a stat() to avoid referencing unitialized data. Original
|
||||
result of a stat() to avoid referencing uninitialized data. Original
|
||||
patch was by Kamil Dudka.
|
||||
* doc/man/{nano.1,rnano.1,nanorc.5}: Adjust version for release.
|
||||
|
||||
@@ -661,7 +661,7 @@ GNU nano 2.5.0 - 2015.12.05
|
||||
This addresses Debian bug #805288.
|
||||
|
||||
2015-12-01 Benno Schulenberg <bensberg@justemail.net>
|
||||
* src/files.c (do_insertfile): Mark the buffer as mofified only when
|
||||
* src/files.c (do_insertfile): Mark the buffer as modified only when
|
||||
actually something was inserted. This fixes Savannah bug #45409.
|
||||
* src/files.c (do_insertfile): Rename two variables for clarity.
|
||||
* src/text.c (redo_cut): Delete two redundant assignments.
|
||||
@@ -1305,7 +1305,7 @@ GNU nano 2.4.2 - 2015.07.05
|
||||
* src/text.c (do_alt_speller, do_linter, do_formatter): Distinguish
|
||||
a failure to launch the linter from receiving zero parsable lines;
|
||||
add a new function to glue together the invocation-error string.
|
||||
* src/global.c (shortcut_init): In the Help Viewer and File Browswer,
|
||||
* src/global.c (shortcut_init): In the Help Viewer and File Browser,
|
||||
bind the unbound Home and End keys to goto_top and goto_bottom, to
|
||||
mimic the behaviour of these keys in file viewers and web browsers.
|
||||
Also show ^Y and ^V in the WhereisFile menu instead of M-\ and M-/,
|
||||
@@ -2005,7 +2005,7 @@ GNU nano 2.3.4 - 2014.06.02
|
||||
|
||||
2014-06-02 Chris Allegretta <chrisa@asty.org>
|
||||
* doc/syntax/default.nanorc: Can't do trailing spaces in the
|
||||
default syntax or it will hilight the spaces as you type them
|
||||
default syntax or it will highlight the spaces as you type them
|
||||
into a new file, which for non-programming is infuriating.
|
||||
|
||||
2014-05-29 Mark Majeres <mark@engine12.com>
|
||||
@@ -3448,14 +3448,14 @@ GNU nano 2.1.8 - 2009.02.07
|
||||
2009-01-25 Chris Allegretta <chrisa@asty.org>
|
||||
* files.c (open_file), nanorc.c (parse_include): Don't get_full_path on included
|
||||
rc files, due to it potentially impacting the ability to read files in nano's
|
||||
cwd(). Fixes Savnanah bug #25297 reported by Mike Frysinger.
|
||||
cwd(). Fixes Savannah bug #25297 reported by Mike Frysinger.
|
||||
|
||||
2009-01-24 Chris Allegretta <chrisa@asty.org>
|
||||
* First pass at some caching of caching color info. Right now it's only for
|
||||
* First pass at some caching of color info. Right now it's only for
|
||||
multi-line regexes but this may not be enough to increase performance.
|
||||
* Add interruptability to search functions. New functions enable_nodelay and
|
||||
disable_nodelay and changes to the routines to handle checking for pending
|
||||
searches. Fixes Savnnah bug #24946: Need interrrupt for search.
|
||||
searches. Fixes Savannah bug #24946: Need interrupt for search.
|
||||
|
||||
2009-01-19 Chris Allegretta <chrisa@asty.org>
|
||||
* Change function definitions to shorts instead of (void *)s. New mapping function
|
||||
@@ -3494,7 +3494,7 @@ GNU nano 2.1.6 - 2008.10.03
|
||||
* ocaml.nanorc: Sample OCaml syntax highlighting file.
|
||||
|
||||
2008-09-30 Dave Geering <dgeering@toshiba-tap.com>
|
||||
* objc.nanorc: Sample Objective-C syntax hightlighting file.
|
||||
* objc.nanorc: Sample Objective-C syntax highlighting file.
|
||||
|
||||
2008-09-30 Chris Allegretta <chrisa@asty.org>
|
||||
* configure.ac: Change extra, multibuffer, color and rcfile configure options
|
||||
@@ -3648,7 +3648,7 @@ GNU nano 2.1.1 - 2008.04.01
|
||||
* gentoo.nanorc: Gentoo syntax highlighting config.
|
||||
|
||||
2008-03-17 Benno Schulenberg <bensberg@justemail.net>
|
||||
* global.c: Fix incorrect first line jump messsage, fix
|
||||
* global.c: Fix incorrect first line jump message, fix
|
||||
more comments to assist translators.
|
||||
* winio.c: Fix shortcut labels not being translated.
|
||||
|
||||
|
||||
103
IMPROVEMENTS
103
IMPROVEMENTS
@@ -1,7 +1,18 @@
|
||||
Improvements in GNU nano
|
||||
========================
|
||||
|
||||
Since 5.0:
|
||||
- With --indicator a "scrollbar" is shown, indicating position+portion.
|
||||
- M-Ins places an anchor, M-PgUp/M-PgDn jump to the nearest anchor.
|
||||
- Toggling help lines (M-X) and Refresh (^L) work nearly everywhere.
|
||||
- Colors can be modified with the attributes "bold," and/or "italic,".
|
||||
- Nine new color names: from pink and purple to orange and latte.
|
||||
|
||||
Since 4.0:
|
||||
- Pasting from outside into nano suppresses auto-indentation.
|
||||
- Such an external paste can be undone with a single M-U.
|
||||
- Shift+Meta+letter key combos can be bound with 'bind Sh-M-letter ...'.
|
||||
- A custom nanorc file may be specified with -f / --rcfile.
|
||||
- What the <Tab> key produces can be specified per syntax with 'tabgives'.
|
||||
- The ability to perform a search at startup with +/string or +?string.
|
||||
- Comment characters are copied when automatic hard-wrapping occurs.
|
||||
@@ -24,7 +35,7 @@ Since 2.9.0:
|
||||
- Option 'set afterends' for making Ctrl+Right stop at word ends.
|
||||
- A crash handler that saves changed buffers in case of a crash.
|
||||
- Addition of the color name "normal", meaning the default color.
|
||||
- A key can be bound to a string -- any mix of text and commands.
|
||||
- A key can be bound to a string -- any mix of text and control codes.
|
||||
- Error messages are shown by default in bright white on red.
|
||||
- <Tab> and <Shift+Tab> can be used to indent/unindent a marked region.
|
||||
- Can snip trailing whitespace while typing, with 'set trimblanks'.
|
||||
@@ -88,25 +99,19 @@ Since 2.3.0:
|
||||
- The option 'positionlog' for saving/restoring the cursor position.
|
||||
- The ability to read and write vim-style lock files.
|
||||
|
||||
Visible changes since 2.0
|
||||
-------------------------
|
||||
* Editor Features
|
||||
- The ability to rebind (reassign) keys using the nanorc.
|
||||
Since 2.0.0:
|
||||
- The ability to rebind keys, via a nanorc file.
|
||||
- The ability to read standard input like a pager ("nano -").
|
||||
- Color syntax highlighting can be set by the first line of a file.
|
||||
- The ability to silence nanorc error messages (-q).
|
||||
- Undo/redo operations (-u).
|
||||
- Undo/redo operations (M-U/M-E, enabled with -u).
|
||||
- Soft wrapping of text (-$).
|
||||
|
||||
* File Handling
|
||||
- Better handling of backup files: if nano can't write a backup file,
|
||||
it won't try to write the original file afterward.
|
||||
- Emergency savefiles retain ownerships and permissions when possible.
|
||||
- Performance improvements in color syntax highlighting.
|
||||
|
||||
Visible changes since 1.2
|
||||
-------------------------
|
||||
* Editor Features
|
||||
Since 1.2.0:
|
||||
- Support for UTF-8.
|
||||
- Moving to a specified line and column of a file, instead of just a
|
||||
line (+LINE,COLUMN).
|
||||
@@ -115,7 +120,7 @@ Visible changes since 1.2
|
||||
- Insertion of spaces instead of a tab when Tab is pressed (-E).
|
||||
- The long option for -K is now --rebindkeypad.
|
||||
- Regular expression searching can now be toggled when nano is built
|
||||
with --enable-tiny, so -R now means something else (see below).
|
||||
with --enable-tiny, so -R now means something else (see next item).
|
||||
- Restricted mode that provides more security than -o (-R).
|
||||
- Blanking of the statusbar after 1 keystroke instead of 25 (-U).
|
||||
- Word searches can optionally skip over punctuation (-W).
|
||||
@@ -123,70 +128,58 @@ Visible changes since 1.2
|
||||
- Many more options are supported in the nanorc.
|
||||
- Improvements to color syntax highlighting support: case insensitive
|
||||
matching, the ability to include color syntaxes in separate files,
|
||||
the ability to specify background colors without foreground colors,
|
||||
etc.
|
||||
the ability to specify background colors without foreground colors...
|
||||
- Insertion of single-byte characters via Esc Esc <000-255>.
|
||||
- Insertion of all characters via "Verbatim Input" mode.
|
||||
- Insertion of any character via Meta-V, "Verbatim Input".
|
||||
- Workaround for the "NumLock glitch".
|
||||
- Meta-W now repeats the last search. Wrapping is now toggled via
|
||||
Meta-L.
|
||||
- Meta-W now repeats the last search. Wrapping is toggled via Meta-L.
|
||||
- Replacing and spell checking only selected text.
|
||||
- Indenting lines with one keystroke.
|
||||
- Copying text into the cutbuffer without cutting it.
|
||||
- Scrolling the text up and down single lines without moving the
|
||||
cursor.
|
||||
- Scrolling the text up and down single lines without moving the cursor.
|
||||
- PageUp and PageDown work more smoothly when using -S.
|
||||
- Scrolling the help text up and down single lines.
|
||||
- Cutting all text from the current position to the end of the file
|
||||
with one keystroke.
|
||||
- Justifying the entire file with one keystroke.
|
||||
with one keystroke (Meta-T).
|
||||
- Justifying the entire file with one keystroke (Meta-J).
|
||||
- Justifying without removing spaces from the ends of lines.
|
||||
- Unjustifying after justifying and immediately resizing.
|
||||
- Going to the first or last line of the current paragraph.
|
||||
- Going to the first or last line of the file without having to go to
|
||||
the "Search" prompt.
|
||||
- Searching for filenames in the file browser.
|
||||
- Displaying spaces and tabs differently to make it easier to tell
|
||||
them apart.
|
||||
- Many more functions available at the statusbar prompt: moving to the
|
||||
next or previous word, searching for matching brackets, "Verbatim
|
||||
Input" mode, etc.
|
||||
- The glibc 2.2.3 crashes involving extended regular expressions are
|
||||
no longer worked around, as they can break anything using extended
|
||||
regular expressions, and glibc 2.2.3 is old. You should upgrade to
|
||||
at least glibc 2.2.4.
|
||||
|
||||
* File Handling
|
||||
- Spaces and tabs are shown differently to make it easier to tell them apart.
|
||||
- Many more functions are available at the prompt: moving to the next or
|
||||
previous word, searching for matching brackets, "Verbatim Input"...
|
||||
- "To Line" (^W^T) and "Read from Command" (^R^X) return to their parent
|
||||
menu when their keystroke is entered again (^W^T^T and ^R^X^X).
|
||||
- Automatic adding of newlines to the ends of files without them can
|
||||
now be disabled (-L).
|
||||
- Converting from and to DOS/Mac file format is now toggled only at
|
||||
the "Write File" prompt, via Meta-D and Meta-M, and the default file
|
||||
format to save in is now set depending on what format the file was
|
||||
originally in. -D now makes nano use bold text instead of reverse
|
||||
video text, and Meta-D at the edit window now does a
|
||||
word/line/character count. -O now makes the unused second line of
|
||||
the screen part of the edit window, and Meta-O at the edit window
|
||||
now toggles this behavior.
|
||||
- Converting from and to DOS/Mac file format is now toggled only at the
|
||||
"Write File" prompt, via Meta-D and Meta-M, and the default file format
|
||||
to save in is now set depending on what format the file was originally
|
||||
in. -D now makes nano use bold text instead of reverse video text,
|
||||
and Meta-D at the edit window now does a word/line/character count.
|
||||
-O now makes the unused second line of the screen part of the edit
|
||||
window, and Meta-O now toggles this behavior while editing.
|
||||
- Converting files that contain a mix of DOS and Mac format lines.
|
||||
- Automatic switching on of -N with binary files has been removed, as
|
||||
it causes problems with UTF-8 support.
|
||||
|
||||
Visible changes since 1.0
|
||||
-------------------------
|
||||
* Editor Features
|
||||
- Complete Pico compatibility (--pico has been removed, and -p means
|
||||
something else, see below).
|
||||
- nanorc support (see nanorc.sample included in sources).
|
||||
Since 1.0
|
||||
- Complete Pico compatibility (option --pico has been removed,
|
||||
and -p now means something else, see below).
|
||||
- Support for nanorc files.
|
||||
- Smooth scrolling (-S).
|
||||
- Support for searching for matching braces, brackets, etc.
|
||||
- Jumping to the matching brace, bracket, etc.
|
||||
- Help for all editor features.
|
||||
- Color syntax highlighting support.
|
||||
- Quote string support, useful for mail agents, etc. (-Q).
|
||||
- Insertion of output of external commands.
|
||||
- Optional enabling of XON and XOFF control characters (-p).
|
||||
- Tons of bugfixes/enhancements for already existing features.
|
||||
|
||||
* File Handling
|
||||
- Option -o (--operatingdir) implements a chroot of sorts.
|
||||
- Mouse support (-m) also allows clicking on shortcuts.
|
||||
- Option -r allows a negative argument.
|
||||
- Overwriting and appending or prepending to files.
|
||||
- Writing marked text to separate files.
|
||||
- Multiple file buffers (-F).
|
||||
@@ -195,4 +188,12 @@ Visible changes since 1.0
|
||||
- Creation of backup files (-B).
|
||||
- Search/replace history (-H).
|
||||
|
||||
See the nano manual for detailed information on each feature.
|
||||
Available in 1.0:
|
||||
- Spell checking (^T).
|
||||
- Justification (^J) and unjustification (^U).
|
||||
- Internationalization (more translations are welcome).
|
||||
- Help texts (^G).
|
||||
- Resizing in X.
|
||||
- On PageUp/Down, the cursor is put on the first screen line (like Pico).
|
||||
- Tab completion at the prompt (for filenames and ~user).
|
||||
- Cut-to-end-of-line option (-k).
|
||||
|
||||
@@ -7,6 +7,12 @@ SUBDIRS += syntax
|
||||
endif
|
||||
|
||||
EXTRA_DIST = ChangeLog.1999-2006 ChangeLog.2007-2015 \
|
||||
IMPROVEMENTS README.GIT nano.spec
|
||||
IMPROVEMENTS README.GIT
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
showinfo:
|
||||
@ echo
|
||||
@ echo " The global nanorc file is: @sysconfdir@/nanorc"
|
||||
@ echo " Syntaxes get installed in: @PKGDATADIR@/"
|
||||
@ echo
|
||||
|
||||
135
NEWS
135
NEWS
@@ -1,3 +1,90 @@
|
||||
2020.07.29 - GNU nano 5.0 "Among the fields of barley"
|
||||
• With --indicator (or -q or 'set indicator') nano will show a kind
|
||||
of scrollbar on the righthand side of the screen to indicate where
|
||||
in the buffer the viewport is located and how much it covers.
|
||||
• With <Alt+Insert> any line can be "tagged" with an anchor, and
|
||||
<Alt+PageUp> and <Alt+PageDown> will jump to the nearest anchor.
|
||||
When using line numbers, an anchor is shown as "+" in the margin.
|
||||
• The Execute Command prompt is now directly accessible from the
|
||||
main menu (with ^T, replacing the Spell Checker). The Linter,
|
||||
Formatter, Spell Checker, Full Justification, Suspension, and
|
||||
Cut-Till-End functions are available in this menu too.
|
||||
• On terminals that support at least 256 colors, nine new color
|
||||
names are available: pink, purple, mauve, lagoon, mint, lime,
|
||||
peach, orange, and latte. These do not have lighter versions.
|
||||
• For the color names red, green, blue, yellow, cyan, magenta,
|
||||
white, and black, the prefix 'light' gives a brighter color.
|
||||
Prefix 'bright' is deprecated, as it means both bold AND light.
|
||||
• All color names can be preceded with "bold," and/or "italic,"
|
||||
(in that order) to get a bold and/or italic typeface.
|
||||
• With --bookstyle (or -O or 'set bookstyle') nano considers any
|
||||
line that begins with whitespace as the start of a paragraph.
|
||||
• Refreshing the screen with ^L now works in every menu.
|
||||
• In the main menu, ^L also centers the line with the cursor.
|
||||
• Toggling the help lines with M-X now works in all menus except
|
||||
in the help viewer and the linter.
|
||||
• At a filename prompt, the first <Tab> lists the possibilities,
|
||||
and these are listed near the bottom instead of near the top.
|
||||
• Bindable function 'curpos' has been renamed to 'location'.
|
||||
• Long option --tempfile has been renamed to --saveonexit.
|
||||
• Short option -S is now a synonym of --softwrap.
|
||||
• The New Buffer toggle (M-F) has become non-persistent. Options
|
||||
--multibuffer and 'set multibuffer' still make it default to on.
|
||||
• Backup files will retain their group ownership (when possible).
|
||||
• Data is synced to disk before "... lines written" is shown.
|
||||
• The raw escape sequences for F13 to F16 are no longer recognized.
|
||||
• Distro-specific syntaxes, and syntaxes of less common languages,
|
||||
have been moved down to subdirectory syntax/extra/. The affected
|
||||
distros and others may wish to move wanted syntaxes one level up.
|
||||
• Syntaxes for Markdown, Haskell, and Ada were added.
|
||||
|
||||
|
||||
2020.05.23 - GNU nano 4.9.3 "Almendras"
|
||||
• One more bug introduced in version 4.9 is fixed: a crash when
|
||||
the terminal screen is resized while at a lock-file prompt.
|
||||
|
||||
2020.04.07 - GNU nano 4.9.2 "Mali Lošinj"
|
||||
• Another bug introduced in version 4.9 is fixed: a likely crash
|
||||
after undoing an <Enter> at the end of leading whitespace.
|
||||
|
||||
2020.03.31 - GNU nano 4.9.1 "Sapperdeflap"
|
||||
• Two bugs introduced in version 4.9 are fixed: the cursor
|
||||
getting misplaced when undoing line cuts, and filtering
|
||||
of the whole buffer to a new buffer not working.
|
||||
|
||||
2020.03.24 - GNU nano 4.9 "die fetten Jahre sind vorbei"
|
||||
• When justifying a selection, the new paragraph and the
|
||||
succeeding one get the appropriate first-line indent.
|
||||
• Trying to justify an empty selection does not crash.
|
||||
• Redoing the insertion of an empty file does not crash.
|
||||
• On the BSDs and macOS, ^H has become rebindable again
|
||||
(in most terminal emulators, not on the console).
|
||||
• DOS line endings in nanorc files are accepted.
|
||||
• Option --suspend / 'set suspend' has been renamed to
|
||||
the more logical --suspendable / 'set suspendable'.
|
||||
|
||||
2020.02.07 - GNU nano 4.8 "Jaška"
|
||||
• When something is pasted into nano, auto-indentation is suppressed,
|
||||
and the paste can be undone as a whole with a single M-U.
|
||||
• When a lock file is encountered during startup, pressing ^C/Cancel
|
||||
quits nano. (Pressing 'No' just skips the file and continues.)
|
||||
• Shift+Meta+letter key combos can be bound with 'bind Sh-M-letter'.
|
||||
Making any such binding dismisses the default behavior of ignoring
|
||||
Shift for all Meta+letter keystrokes.
|
||||
• The configuration option --with-slang (to be avoided when possible)
|
||||
can now be used only together with --enable-tiny.
|
||||
• A custom nanorc file can be specified on the command line, with
|
||||
-f filename or --rcfile=filename.
|
||||
|
||||
2019.12.23 - GNU nano 4.7 "Havikskruid"
|
||||
• A <Tab> will indent a marked region only when mark and cursor are
|
||||
on different lines.
|
||||
• Two indentations (any mix of tabs and spaces) are considered the
|
||||
same when they look the same (that is: indent to the same level).
|
||||
• When using --breaklonglines or ^J, a line will never be broken in
|
||||
its leading whitespace or quoting.
|
||||
• The keywords in nanorc files must be in lowercase.
|
||||
|
||||
2019.11.29 - GNU nano 4.6 "And don't you eat that yellow snow"
|
||||
• The 'formatter' command has returned, bound by default to M-F.
|
||||
It allows running a syntax-specific command on the contents of
|
||||
@@ -1529,9 +1616,9 @@
|
||||
some compatibility issues with older ncurses libraries
|
||||
have also been fixed. All in all, a lot to see.
|
||||
|
||||
2001.01.31 - Nano 0.9.99pre2 is released. Not surprisingly, all that is
|
||||
new is bugfixes, bugfixes, bugfixes. There were a few
|
||||
cleanups in unneeded global variables and duplicate
|
||||
2001.01.31 - Nano 0.9.99pre2 is released. Not surprisingly, all that
|
||||
is new is bugfixes, bugfixes, bugfixes. There were a
|
||||
few cleanups in unneeded global variables and duplicate
|
||||
functions, but most is just fixing. Specifically, there
|
||||
is now a preliminary (read: needs testing) fix for
|
||||
resizing the editor in any mode other than normal edit
|
||||
@@ -1575,9 +1662,9 @@
|
||||
main reason for this release is the less-than-optimal
|
||||
fix for the security issue in nano with following
|
||||
symbolic links. Hopefully this will fix the problem
|
||||
permanently. The --nofollow option also works again for
|
||||
those who are real security nuts. There are also some
|
||||
display and search fixes, and the --disable-spell
|
||||
permanently. The --nofollow option also works again
|
||||
for those who are real security nuts. There are also
|
||||
some display and search fixes, and the --disable-spell
|
||||
function was renamed to --disable-speller to be in line
|
||||
with nano and Pico's "speller" term.
|
||||
|
||||
@@ -1701,12 +1788,11 @@
|
||||
(id).
|
||||
|
||||
2000.06.06 - Nano 0.9.10 is primarily a bugfix for the loss of SIGINT
|
||||
when using "run and terminate" flags (for example,
|
||||
--help). There are also some minor documentation
|
||||
updates. This version of nano is the most stable in
|
||||
quite some time, and is likely to be the most stable for
|
||||
awhile. Users are encouraged to upgrade to this
|
||||
version.
|
||||
when using "run and terminate" flags (for example, --help).
|
||||
There are also some minor documentation updates. This
|
||||
version of nano is the most stable in quite some time,
|
||||
and is likely to be the most stable for awhile. Users
|
||||
are encouraged to upgrade to this version.
|
||||
|
||||
2000.05.31 - Nano 0.9.9 introduces much better working i18n support,
|
||||
more portability, and a ton of bugfixes. While nano is
|
||||
@@ -1721,10 +1807,10 @@
|
||||
are also the obligatory display fixes and speedups.
|
||||
Have fun with it.
|
||||
|
||||
2000.05.14 - Nano 0.9.7 (the Mother's Day release) continues in the long
|
||||
line of display fixes, and also fixes the broken symlink
|
||||
behavior (i.e. symlinks weren't being followed by
|
||||
default). Hopefully all major bugs can be worked out
|
||||
2000.05.14 - Nano 0.9.7 (the Mother's Day release) continues in the
|
||||
long line of display fixes, and also fixes the broken
|
||||
symlink behavior (i.e. symlinks weren't being followed
|
||||
by default). Hopefully all major bugs can be worked out
|
||||
soon and we can have a 1.0 release before the end of the
|
||||
year, but who knows.
|
||||
|
||||
@@ -1735,15 +1821,14 @@
|
||||
most stable versions of nano to date, but this one may
|
||||
not be too bad =-)
|
||||
|
||||
2000.05.01 - Nano 0.9.5 attempts to speed up the display of text
|
||||
to be at least somewhat reasonable. Much code profiling
|
||||
has been done to reduce the ridiculous number of
|
||||
redundant display updates. This will probably expose a
|
||||
lot of bugs that can then be fixed, so this release is
|
||||
probably not for the faint of heart. For anyone
|
||||
curious, I would call nano 0.9.2 the most stable version
|
||||
recently, so use that if you're not particularly
|
||||
concerned with being on the bleeding edge.
|
||||
2000.05.01 - Nano 0.9.5 attempts to speed up the display of text to be
|
||||
at least somewhat reasonable. Much code profiling has been
|
||||
done to reduce the ridiculous number of redundant display
|
||||
updates. This will probably expose a lot of bugs that can
|
||||
then be fixed, so this release is probably not for the faint
|
||||
of heart. For anyone curious, I would call nano 0.9.2 the
|
||||
most stable version recently, so use that if you're not
|
||||
particularly concerned with being on the bleeding edge.
|
||||
|
||||
2000.04.25 - Nano 0.9.4 fixes some problems in 0.9.3 with the last
|
||||
line code and related segfaults. It now also has much
|
||||
|
||||
83
TODO
83
TODO
@@ -1,84 +1,5 @@
|
||||
A list of desired features
|
||||
--------------------------
|
||||
|
||||
Somewhat urgent:
|
||||
- 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.
|
||||
For a list of open bugs and requested features see:
|
||||
|
||||
Vague musings:
|
||||
- Add support for right-to-left text (RTL), through FriBidi?
|
||||
- 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?
|
||||
- Make matching bracket searches sophisticated enough to skip over
|
||||
brackets inside comments?
|
||||
https://savannah.gnu.org/bugs/?group=nano
|
||||
|
||||
For version 4.0:
|
||||
- Make undo/redo work also for justifying. [DONE]
|
||||
|
||||
For version 2.9:
|
||||
- Allow piping (marked) text to an external command and replacing it with
|
||||
the command's output. That is: implement filtering. [DONE]
|
||||
- Allow to record and replay a macro: a stored series of keystrokes. [DONE]
|
||||
- Make undo/redo work also for indenting. [DONE]
|
||||
|
||||
For version 2.8:
|
||||
- Allow text searches in the help viewer. [DONE]
|
||||
|
||||
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 (reading from stdin). [DONE]
|
||||
- Select a color syntax based on more than just the filename extension. [DONE]
|
||||
- Allow soft wrapping as well as hard wrapping? [DONE]
|
||||
|
||||
For version 2.0:
|
||||
- UTF-8 support. [DONE]
|
||||
- Support for paragraph searches. [DONE]
|
||||
- Support for justifying the entire file at once. [DONE]
|
||||
- Support for filename searches in the file browser. [DONE]
|
||||
- Keystroke to implement "Add next sequence as raw" like vi's ^V. [DONE]
|
||||
- Spell check selected text only. [DONE]
|
||||
- Make "To Line" (^W^T) and "Read from Command" (^R^X) reenter their
|
||||
parent menu when their keystroke is entered a second time (^W^T^T and
|
||||
(^R^X^X) (requires figuring out when to keep cursor position and when
|
||||
not to). [DONE]
|
||||
- Fix resetstatuspos global which we shouldn't have. [DONE]
|
||||
|
||||
For version 1.2:
|
||||
- Single-line scroll up/down? [DONE]
|
||||
- Color syntax highlighting? (There seems to be a demand for it.) [DONE]
|
||||
- Support for a .nanorc file. [DONE]
|
||||
- Backup making (filename~)? [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 (--operatingdir, a 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]
|
||||
- Internationalization [In progress, translators welcome!]
|
||||
- Allow nano to be resized in X. [DONE]
|
||||
- On PageUp/Down, put the cursor on the first line (like Pico), not the
|
||||
center line. [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]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Generate configure & friends for GIT users.
|
||||
|
||||
gnulib_url="git://git.sv.gnu.org/gnulib.git"
|
||||
gnulib_hash="378d2e5e5fe4b892ac3503ab5313126b1b63341e"
|
||||
gnulib_hash="ac34618e85013bfec4650f02e8e79c5de6d80fb3"
|
||||
|
||||
modules="
|
||||
futimens
|
||||
@@ -30,7 +30,7 @@ modules="
|
||||
|
||||
# Make sure the local gnulib git repo is up-to-date.
|
||||
if [ ! -d "gnulib" ]; then
|
||||
git clone --depth=123 ${gnulib_url}
|
||||
git clone --depth=1111 ${gnulib_url}
|
||||
fi
|
||||
cd gnulib >/dev/null || exit 1
|
||||
curr_hash=$(git log -1 --format=%H)
|
||||
|
||||
21
configure.ac
21
configure.ac
@@ -1,6 +1,6 @@
|
||||
# Configuration for GNU nano - a small and user-friendly text editor
|
||||
#
|
||||
# Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2011, 2013-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2014, 2017 Mike Frysinger
|
||||
#
|
||||
# GNU nano is free software: you can redistribute it and/or modify
|
||||
@@ -16,7 +16,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
AC_INIT([GNU nano], [4.6], [nano-devel@gnu.org], [nano])
|
||||
AC_INIT([GNU nano], [5.0], [nano-devel@gnu.org], [nano])
|
||||
AC_CONFIG_SRCDIR([src/nano.c])
|
||||
AC_CANONICAL_HOST
|
||||
AM_INIT_AUTOMAKE([1.14])
|
||||
@@ -59,7 +59,7 @@ AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.])
|
||||
dnl Whether this is a git repository.
|
||||
|
||||
AC_MSG_CHECKING([whether building from git])
|
||||
if test -d .git ; then
|
||||
if test -f roll-a-release.sh ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
from_git=yes
|
||||
else
|
||||
@@ -74,7 +74,8 @@ if test x$from_git = xyes; then
|
||||
if test ! -f $(aclocal --print-ac-dir)/pkg.m4; then
|
||||
AC_MSG_ERROR([
|
||||
*** The pkg.m4 macros are missing. ***
|
||||
*** The pkg-config package needs to be installed when building from git. ***])
|
||||
*** The pkg-config package needs to be installed when building from git. ***
|
||||
*** After fixing this problem, rerun ./autogen.sh. ***])
|
||||
fi
|
||||
if test "$ac_cv_path_MSGFMT" = ":"; then
|
||||
AC_MSG_ERROR([
|
||||
@@ -89,6 +90,12 @@ AC_CHECK_HEADERS(libintl.h limits.h pwd.h termios.h sys/param.h)
|
||||
|
||||
dnl Checks for options.
|
||||
|
||||
if test "x$with_slang" = xyes; then
|
||||
if test "x$enable_tiny" != xyes; then
|
||||
AC_MSG_ERROR([--with-slang is supported only together with --enable-tiny])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(browser,
|
||||
AS_HELP_STRING([--disable-browser], [Disable the built-in file browser]))
|
||||
if test "x$enable_tiny" = xyes; then
|
||||
@@ -516,7 +523,6 @@ int main(void)
|
||||
;;
|
||||
esac], [AC_MSG_RESULT(no)])
|
||||
|
||||
|
||||
dnl Checks for functions.
|
||||
|
||||
if test "x$enable_utf8" != xno; then
|
||||
@@ -591,7 +597,7 @@ if eval "test x$CURSES_LIB_NAME = x"; then
|
||||
*** from libncursesw5-dev (Debian), ncurses-devel (Fedora), or similar.
|
||||
*** (Or install ncurses from https://ftp.gnu.org/gnu/ncurses/.)])
|
||||
else
|
||||
AC_MSG_RESULT([Using $CURSES_LIB_NAME as the curses library])
|
||||
AC_MSG_RESULT([ The curses library to be used is: $CURSES_LIB_NAME])
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], [use_default_colors],
|
||||
@@ -733,7 +739,8 @@ m4/Makefile
|
||||
po/Makefile.in
|
||||
src/Makefile
|
||||
syntax/Makefile
|
||||
nano.spec
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
make showinfo
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Cheatsheet for nano</title>
|
||||
<meta name="description" content="nano">
|
||||
<meta name="keywords" content="cheatsheet, nano, editor, shortcuts, keystrokes, functions">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="description" content="A concise overview of the command shortcuts of the GNU nano editor, grouped by category.">
|
||||
<meta name="keywords" content="cheatsheet, nano, editor, shortcuts, keystrokes, functions, operations, commands">
|
||||
<meta name="author" content="Benno Schulenberg">
|
||||
</head>
|
||||
|
||||
<body lang="en">
|
||||
<body>
|
||||
|
||||
<br>
|
||||
<h1 align="center">Overview of nano's shortcuts </h1>
|
||||
@@ -21,9 +22,9 @@
|
||||
<b>File handling</b>
|
||||
<table><tbody>
|
||||
<tr><td>Ctrl+S </td><td>Save current file</td></tr>
|
||||
<tr><td>Ctrl+O </td><td> Offer to write file ("Save as")</td></tr>
|
||||
<tr><td>Ctrl+R </td><td> Insert a file into current one</td></tr>
|
||||
<tr><td>Ctrl+X </td><td> Close buffer, exit from nano</td></tr>
|
||||
<tr><td>Ctrl+O</td><td>Offer to write file ("Save as")</td></tr>
|
||||
<tr><td>Ctrl+R</td><td>Insert a file into current one</td></tr>
|
||||
<tr><td>Ctrl+X</td><td>Close buffer, exit from nano</td></tr>
|
||||
</tbody></table>
|
||||
<br>
|
||||
|
||||
@@ -78,14 +79,14 @@
|
||||
<table><tbody>
|
||||
<tr><td>Ctrl+B </td><td>One character backward</td></tr>
|
||||
<tr><td>Ctrl+F</td><td>One character forward</td></tr>
|
||||
<tr><td>Ctrl+⯇</td><td>One word backward</td></tr>
|
||||
<tr><td>Ctrl+⯈</td><td>One word forward</td></tr>
|
||||
<tr><td>Ctrl+<b>←</b></td><td>One word backward</td></tr>
|
||||
<tr><td>Ctrl+<b>→</b></td><td>One word forward</td></tr>
|
||||
<tr><td>Ctrl+A</td><td>To start of line</td></tr>
|
||||
<tr><td>Ctrl+E</td><td>To end of line</td></tr>
|
||||
<tr><td>Ctrl+P</td><td>One line up</td></tr>
|
||||
<tr><td>Ctrl+N</td><td>One line down</td></tr>
|
||||
<tr><td>Ctrl+⯅</td><td>To previous block</td></tr>
|
||||
<tr><td>Ctrl+⯆</td><td>To next block</td></tr>
|
||||
<tr><td>Ctrl+<b>↑</b></td><td>To previous block</td></tr>
|
||||
<tr><td>Ctrl+<b>↓</b></td><td>To next block</td></tr>
|
||||
<tr><td>Ctrl+Y</td><td>One page up</td></tr>
|
||||
<tr><td>Ctrl+V</td><td>One page down</td></tr>
|
||||
<tr><td>Alt+\</td><td>To top of buffer</td></tr>
|
||||
@@ -95,10 +96,10 @@
|
||||
|
||||
<b>Special movement</b>
|
||||
<table><tbody>
|
||||
<tr><td>Alt+G </td><td>Go to specified line</td></tr>
|
||||
<tr><td>Alt+G </td><td>Go to specified line</td></tr>
|
||||
<tr><td>Alt+]</td><td>Go to complementary bracket</td></tr>
|
||||
<tr><td>Alt+⯅</td><td>Scroll viewport up</td></tr>
|
||||
<tr><td>Alt+⯆</td><td>Scroll viewport down</td></tr>
|
||||
<tr><td>Alt+<b>↑</b></td><td>Scroll viewport up</td></tr>
|
||||
<tr><td>Alt+<b>↓</b></td><td>Scroll viewport down</td></tr>
|
||||
<tr><td>Alt+<</td><td>Switch to preceding buffer</td></tr>
|
||||
<tr><td>Alt+></td><td>Switch to succeeding buffer</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
58
doc/faq.html
58
doc/faq.html
@@ -1,9 +1,12 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>The GNU nano editor FAQ</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="description" content="The genesis story of the nano editor, plus the solution to some common problems.">
|
||||
</head>
|
||||
|
||||
<body text="#330000" bgcolor="#ffffff" link="#0000ef" vlink="#51188e" alink="#ff0000">
|
||||
|
||||
<h1>The GNU nano editor FAQ</h1>
|
||||
@@ -28,11 +31,12 @@
|
||||
<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>
|
||||
<a href="#3.3">3.3. Why does everything go into /usr/local?</a><br>
|
||||
<a href="#3.5">3.5. nano should automatically run strip on the binary when installing it!</a><br>
|
||||
<a href="#3.6">3.6. How can I make the executable smaller? This is too bloated!</a><br>
|
||||
<a href="#3.7">3.7. Tell me more about this multibuffer stuff!</a><br>
|
||||
<a href="#3.8">3.8. Tell me more about this verbatim input stuff!</a><br>
|
||||
<a href="#3.9">3.9. How do I make a .nanorc file that nano will read when I start it?</a><br>
|
||||
<a href="#3.4">3.4. nano should automatically run strip on the binary when installing it!</a><br>
|
||||
<a href="#3.5">3.5. How can I make the executable smaller? This is too bloated!</a><br>
|
||||
<a href="#3.6">3.6. Tell me more about this multibuffer stuff!</a><br>
|
||||
<a href="#3.7">3.7. Tell me more about this verbatim input stuff!</a><br>
|
||||
<a href="#3.8">3.8. How do I make a .nanorc file that nano will read when I start it?</a><br>
|
||||
<a href="#3.9">3.9. Why does my self-compiled nano not read /etc/nanorc?</a><br>
|
||||
</p></blockquote>
|
||||
<h3><a href="#4">4. Running</a></h3>
|
||||
<blockquote><p>
|
||||
@@ -85,7 +89,7 @@
|
||||
<h3><a name="1.3"></a>1.3. Why the name change from TIP?</h3>
|
||||
<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>
|
||||
<h3><a name="1.4"></a>1.4. What is the current version of nano?</h3>
|
||||
<blockquote><p>The current version of nano <i>should</i> be <b>4.6</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>
|
||||
<blockquote><p>The current version of nano <i>should</i> be <b>5.0</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>
|
||||
<h3><a name="1.5"></a>1.5. I want to read the man page without having to download the program!</h3>
|
||||
<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%">
|
||||
@@ -94,8 +98,8 @@
|
||||
<h3><a name="2.1"></a>2.1. Web sites that carry nano.</h3>
|
||||
<blockquote><p>The nano source tarballs can be downloaded from the following web sites:</p>
|
||||
<ul>
|
||||
<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>
|
||||
<li><a href="https://nano-editor.org/dist/latest/">https://nano-editor.org/dist/latest/</a></li>
|
||||
<li><a href="https://ftpmirror.gnu.org/gnu/nano/">https://ftpmirror.gnu.org/gnu/nano/</a></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<h3><a name="2.2"></a>2.2. RPM packages (RedHat, OpenSuse, and derivatives).</h3>
|
||||
@@ -133,10 +137,10 @@
|
||||
<h3><a name="3.3"></a>3.3. Why does everything go into /usr/local?</h3>
|
||||
<blockquote><p>Well, that's what the <b>configure</b> script defaults to. If you wish to change this, simply do this:</p>
|
||||
<p><b>./configure --prefix=/usr</b></p>
|
||||
<p>to put nano into /usr/bin when you run <b>make install</b>.</p></blockquote>
|
||||
<h3><a name="3.5"></a>3.5. nano should automatically run strip on the binary when installing it!</h3>
|
||||
<blockquote><p>Actually, it does, but you have to use <b>make install-strip</b>. The default make install does not, and will not, run strip automatically.</p></blockquote>
|
||||
<h3><a name="3.6"></a>3.6. How can I make the executable smaller? This is too bloated!</h3>
|
||||
<p>This will put nano into /usr/bin when you run <b>make install</b>.</p></blockquote>
|
||||
<h3><a name="3.4"></a>3.4. nano should automatically run strip on the binary when installing it!</h3>
|
||||
<blockquote><p>It does when you use <b>make install-strip</b>. The default <b>make install</b> does not, and will not, run strip automatically.</p></blockquote>
|
||||
<h3><a name="3.5"></a>3.5. How can I make the executable smaller? This is too bloated!</h3>
|
||||
<blockquote><p>Actually, there are several parts of the editor that can be disabled. You can pass arguments to the <b>configure</b> script that disable certain features. Here's a brief list:</p>
|
||||
<pre>
|
||||
<b>--disable-browser</b> Disable the built-in file browser
|
||||
@@ -156,26 +160,28 @@
|
||||
<b>--disable-tabcomp</b> Disable the 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 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>There's also the <b>--enable-tiny</b> option which disables everything above, as well as some larger chunks of the program (like the undo/redo code and the code for selecting text). Also, if you know you don't need other languages, you can use <b>--disable-nls</b> to disable internationalization and save a few kilobytes. And finally, there's always good old <b>strip</b> to remove all unneeded symbols.</p>
|
||||
</blockquote>
|
||||
<h3><a name="3.7"></a>3.7. Tell me more about this multibuffer stuff!</h3>
|
||||
<h3><a name="3.6"></a>3.6. Tell me more about this multibuffer stuff!</h3>
|
||||
<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> after typing <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>-F</b> or <b>--multibuffer</b> flag when you invoke nano, or add <b>set multibuffer</b> to your .nanorc file.</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 buffer open, the ^X shortcut will say "Close", instead of "Exit".</p></blockquote>
|
||||
<h3><a name="3.8"></a>3.8. Tell me more about this verbatim input stuff!</h3>
|
||||
<h3><a name="3.7"></a>3.7. Tell me more about this verbatim input stuff!</h3>
|
||||
<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 status bar), then press the key(s) that generate the character you want.</p>
|
||||
<p>Alternatively, if Unicode support is enabled (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 status bar will change to "Unicode Input: ......" when you do this.</p></blockquote>
|
||||
<h3><a name="3.9"></a>3.9. How do I make a .nanorc file that will be read when I start nano?</h3>
|
||||
<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>
|
||||
<h3><a name="3.8"></a>3.8. How do I make a .nanorc file that will be read when I start nano?</h3>
|
||||
<blockquote><p>It's not hard at all! Simply copy the <b>sample.nanorc</b> from the doc/ directory in the nano source package (or from /usr/doc/nano on your system) to <b>.nanorc</b> in your home directory, and then edit it. If you didn't get a sample nanorc, the syntax of the file is simple: features are turned on and off by using the words <b>set</b> and <b>unset</b> followed by the long option name of the feature (see <b>man nanorc</b> for the full list of options). For example, "set quickblank" or "set smarthome". Of course, for this to work, your nano must <b>not</b> have been compiled with <b>--disable-nanorc</b>.</p></blockquote>
|
||||
<h3><a name="3.9"></a>3.9. Why does my self-compiled nano not read /etc/nanorc?</h3>
|
||||
<blockquote><p>By default (see <a href="#3.3">3.3</a>), nano gets installed into /usr/local. This also means that, at startup, nano will read <b>/usr/local/etc/nanorc</b> instead of <b>/etc/nanorc</b>. You can make a symlink from the former to the latter if you want your self-compiled nano to read the same nanorc as the system-installed nano. Or you can configure your nano to overwrite the system nano (again, see <a href="#3.3">3.3</a>).</p></blockquote>
|
||||
<hr width="100%">
|
||||
|
||||
<h1><a name="4"></a>4. Running</h1>
|
||||
<h3><a name="4.1"></a>4.1. How do I open a file with a name beginning with '+' from the command line?</h3>
|
||||
<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>
|
||||
<p>To open '+filename.txt' starting on line 1: <b>nano +filename.txt</b><br>
|
||||
<blockquote><p>If a command-line argument that begins with '+' is followed by another argument, the former is always treated as a starting line (plus column number), and the latter always as a filename. If a command-line argument that begins with '+' isn't followed by another argument, it's treated as a filename. Examples:</p>
|
||||
<p>To open '+filename.txt': <b>nano +filename.txt</b><br>
|
||||
To open '+filename.txt' starting on line 10: <b>nano +10 +filename.txt</b><br>
|
||||
To open '+filename.txt' starting on line 1, column 20: <b>nano +,20 +filename.txt</b><br>
|
||||
To open '+filename.txt' starting on line 10, column 20: <b>nano +10,20 +filename.txt</b><br>
|
||||
To open '+filename.txt' starting on line 1 and 'filename.txt' starting on line 40 (if nano has been compiled with multibuffer support): <b>nano +1 +filename.txt +40 filename.txt</b></p></blockquote>
|
||||
To open '+filename.txt' starting on line 1 and 'filename.txt' starting on line 40: <b>nano +1 +filename.txt +40 filename.txt</b></p></blockquote>
|
||||
<h3><a name="4.2"></a>4.2. Ack! My Backspace/Delete/Enter/Meta/double bucky key doesn't seem to work! What can I do?</h3>
|
||||
<blockquote><p>Try setting your $TERM variable to 'vt100'. nano doesn't yet support every term entry under the sun.</p>
|
||||
<p>Bourne shell users (bash and sh): <b>export TERM=vt100</b><br>
|
||||
@@ -187,9 +193,11 @@
|
||||
<h3><a name="4.5"></a>4.5. How do I select text for or paste text from the clipboard when nano's mouse support is turned on?</h3>
|
||||
<blockquote><p>Try holding down the Shift key and selecting or pasting the text as you normally would.</p></blockquote>
|
||||
<h3><a name="4.6"></a>4.6. When I paste text into a document, each line gets indented further than the last. Why? And how can I stop this?</h3>
|
||||
<blockquote><p>You have the <i>autoindent</i> feature turned on. Hit <b>Meta-I</b> to turn it off, paste your text, and then hit <b>Meta-I</b> again to turn it back on.</p></blockquote>
|
||||
<blockquote><p>You have the <i>autoindent</i> feature turned on. Hit <b>Meta-I</b> to turn it off, paste your text, and then hit <b>Meta-I</b> again to turn it back on.</p>
|
||||
<p><i>Update:</i> Since version 4.8, nano will suppress auto-indentation during a paste, so you no longer need to toggle it off and on manually.</p></blockquote>
|
||||
<h3><a name="4.7"></a>4.7. When I paste from Windows into a remote nano, nano rewraps the lines. What gives?</h3>
|
||||
<blockquote><p>When pasting from Windows, in some situations linefeeds are sent instead of carriage returns (Enters). And linefeeds are <b>^J</b>s, which make nano justify (rewrap) the current paragraph. To prevent these linefeeds from causing these unwanted justifications, add this line to your .nanorc on the remote Linux box: <b>unbind ^J main</b> or <b>bind ^J enter main</b>, depending on whether the paste contains CR + LF or only LF.</p></blockquote>
|
||||
<blockquote><p>When pasting from Windows, in some situations linefeeds are sent instead of carriage returns (Enters). And linefeeds are <b>^J</b>s, which make nano justify (rewrap) the current paragraph. To prevent these linefeeds from causing these unwanted justifications, add this line to your .nanorc on the remote Linux box: <b>unbind ^J main</b> or <b>bind ^J enter main</b>, depending on whether the paste contains CR + LF or only LF.</p>
|
||||
<p><i>Update:</i> Since version 4.8, nano will ignore linefeed characters in a paste, so you no longer need the above workaround.</p></blockquote>
|
||||
<h3><a name="4.8"></a>4.8. I've compiled nano with color support, but I don't see any color when I run it!</h3>
|
||||
<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>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.9">3.9</a>.</p></blockquote>
|
||||
<h3><a name="4.9"></a>4.9. How do I make nano my default editor (in Pine, mutt, etc.)?</h3>
|
||||
|
||||
82
doc/nano.1
82
doc/nano.1
@@ -1,4 +1,4 @@
|
||||
.\" Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
|
||||
.\" Copyright (C) 1999-2011, 2013-2020 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:
|
||||
@@ -16,7 +16,7 @@
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <https://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH NANO 1 "version 4.6" "November 2019"
|
||||
.TH NANO 1 "version 5.0" "July 2020"
|
||||
|
||||
.SH NAME
|
||||
nano \- Nano's ANOther editor, inspired by Pico
|
||||
@@ -28,12 +28,18 @@ nano \- Nano's ANOther editor, inspired by Pico
|
||||
.BR nano " [" \fIoptions "] [[" + [ crCR ]( / | ? ) \fIstring "] " \fIfile ]...
|
||||
|
||||
.SH NOTICE
|
||||
Starting with version 4.0, \fBnano\fR no longer hard-wraps an overlong
|
||||
line by default. It further uses smooth scrolling by default, and by
|
||||
default includes the line below the title bar into the editing area.
|
||||
Since version 4.0, \fBnano\fR by default:
|
||||
.sp
|
||||
.RS 4
|
||||
\(bu does not automatically hard-wrap lines that become overlong,
|
||||
.br
|
||||
\(bu includes the line below the title bar in the editing area,
|
||||
.br
|
||||
\(bu does linewise (smooth) scrolling.
|
||||
.RE
|
||||
.sp
|
||||
If you want the old, Pico behavior back, you can use \fB\-\-breaklonglines\fR,
|
||||
\fB\-\-jumpyscrolling\fR, and \fB\-\-emptyline\fR (or \fB\-bje\fR for short).
|
||||
\fB\-\-emptyline\fR, and \fB\-\-jumpyscrolling\fR (or \fB\-bej\fR for short).
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBnano\fP is a small and friendly editor. It copies the look and feel
|
||||
@@ -44,6 +50,7 @@ syntax coloring, line numbering, and soft-wrapping overlong lines.
|
||||
When giving a filename on the command line, 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.
|
||||
(Negative numbers count from the end of the file or line.)
|
||||
The cursor can be put on the first or last occurrence of a specific string
|
||||
by specifying that string after \fB+/\fR or \fB+?\fR before the filename.
|
||||
The string can be made case sensitive and/or caused to be interpreted as a
|
||||
@@ -105,7 +112,10 @@ numbered one every time a file is saved -- when backups are enabled (\fB\-B\fR).
|
||||
The uniquely numbered files are stored in the specified \fIdirectory\fR.
|
||||
.TP
|
||||
.BR \-D ", " \-\-boldtext
|
||||
Use bold text instead of reverse video text.
|
||||
For the interface, use bold instead of reverse video. This will be overridden
|
||||
by setting the options \fBtitlecolor\fP, \fBstatuscolor\fP, \fBkeycolor\fP,
|
||||
\fBfunctioncolor\fP, \fBnumbercolor\fP, and/or \fBselectedcolor\fP in your
|
||||
nanorc file. See \fBnanorc\fR(5).
|
||||
.TP
|
||||
.BR \-E ", " \-\-tabstospaces
|
||||
Convert typed tabs to spaces.
|
||||
@@ -145,10 +155,9 @@ hard-wrapping occurs or when text is justified.
|
||||
.BR \-N ", " \-\-noconvert
|
||||
Disable automatic conversion of files from DOS/Mac format.
|
||||
.TP
|
||||
.BR \-O ", " \-\-morespace
|
||||
Obsolete and ignored option, since the line below the title bar is included
|
||||
into the editing space by default. If you prefer to keep this line blank,
|
||||
use \fB\-e\fR or \fB\-\-emptyline\fR.
|
||||
.BR \-O ", " \-\-bookstyle
|
||||
When justifying, treat any line that starts with whitespace as the
|
||||
beginning of a paragraph (unless auto-indenting is on).
|
||||
.TP
|
||||
.BR \-P ", " \-\-positionlog
|
||||
For the 200 most recent files, log the last position of the cursor,
|
||||
@@ -170,10 +179,11 @@ different name if it already has one; and don't make backup files.
|
||||
Restricted mode can also be activated by invoking \fBnano\fP
|
||||
with any name beginning with 'r' (e.g. "rnano").
|
||||
.TP
|
||||
.BR \-S ", " \-\-smooth
|
||||
Obsolete and ignored option, since smooth scrolling has become the default.
|
||||
If you prefer the chunk-by-chunk scrolling behavior,
|
||||
use \fB\-j\fR or \fB\-\-jumpyscrolling\fR.
|
||||
.BR \-S ", " \-\-softwrap
|
||||
Display over multiple screen rows lines that exceed the screen's width.
|
||||
(You can make this soft-wrapping occur at whitespace instead of rudely at
|
||||
the screen's edge, by using also \fB\-\-atblanks\fR.)
|
||||
(The old short option, \fB\-$\fR, is deprecated.)
|
||||
.TP
|
||||
.BR \-T\ \fInumber ", " \-\-tabsize= \fInumber
|
||||
Set the size (width) of a tab to \fInumber\fP columns. The value of
|
||||
@@ -193,8 +203,8 @@ 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).
|
||||
should be considered as part of a word. When using this option, you
|
||||
probably want to omit \fB\-W\fR (\fB\-\-wordbounds\fR).
|
||||
.TP
|
||||
.BR \-Y\ \fIname ", " \-\-syntax= \fIname
|
||||
Specify the name of the syntax highlighting to use from among the ones
|
||||
@@ -225,6 +235,10 @@ system either Backspace acts like Delete or Delete acts like Backspace.
|
||||
.BR \-e ", " \-\-emptyline
|
||||
Do not use the line below the title bar, leaving it entirely blank.
|
||||
.TP
|
||||
.BR \-f\ \fIfile ", " \-\-rcfile= \fIfile
|
||||
Read only this \fIfile\fR for setting nano's options, instead of reading
|
||||
both the system-wide and the user's nanorc files.
|
||||
.TP
|
||||
.BR \-g ", " \-\-showcursor
|
||||
Make the cursor visible in the file browser (putting it on the
|
||||
highlighted item) and in the help viewer. Useful for braille users
|
||||
@@ -267,8 +281,13 @@ Set the operating directory. This makes \fBnano\fP set up something
|
||||
similar to a chroot.
|
||||
.TP
|
||||
.BR \-p ", " \-\-preserve
|
||||
Preserve the XON and XOFF sequences (^Q and ^S) so they will be caught
|
||||
by the terminal.
|
||||
Preserve the XON and XOFF sequences (\fB^Q\fR and \fB^S\fR) so they
|
||||
will be caught by the terminal.
|
||||
.TP
|
||||
.BR \-q ", " \-\-indicator
|
||||
Display a "scrollbar" on the righthand side of the edit window.
|
||||
It shows the position of the viewport in the buffer
|
||||
and how much of the buffer is covered by the viewport.
|
||||
.TP
|
||||
.BR \-r\ \fInumber ", " \-\-fill= \fInumber
|
||||
Set the target width for justifying and automatic hard-wrapping at this
|
||||
@@ -277,12 +296,13 @@ at the width of the screen minus \fInumber\fR columns, allowing the wrap
|
||||
point to vary along with the width of the screen if the screen is resized.
|
||||
The default value is \-8.
|
||||
.TP
|
||||
.B "\-s ""\fIprogram\fR [\fIarg\fR...]\fB""\fR, \fB\-\-speller=""\fIprogram\fR [\fIarg\fR...]\fB"""
|
||||
.B "\-s ""\fIprogram\fR [\fIargument \fR...]\fB""\fR, \fB\-\-speller=""\fIprogram\fR [\fIargument \fR...]\fB"""
|
||||
Use this command to perform spell checking and correcting, instead of
|
||||
using the built-in corrector that calls \fBhunspell\fR or GNU \fBspell\fR.
|
||||
.TP
|
||||
.BR \-t ", " \-\-tempfile
|
||||
.BR \-t ", " \-\-saveonexit
|
||||
Save a changed buffer without prompting (when exiting with \fB^X\fR).
|
||||
(The old form of the long option, \fB\-\-tempfile\fR, is deprecated.)
|
||||
.TP
|
||||
.BR \-u ", " \-\-unix
|
||||
Save a file by default in Unix format. This overrides nano's
|
||||
@@ -304,18 +324,10 @@ This is the default. (This option is the opposite of \fB\-b\fR
|
||||
Don't show the two help lines at the bottom of the screen.
|
||||
.TP
|
||||
.BR \-y ", " \-\-afterends
|
||||
Make Ctrl+Right stop at word ends instead of beginnings.
|
||||
Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
|
||||
.TP
|
||||
.BR \-z ", " \-\-suspend
|
||||
Enable the suspend ability.
|
||||
.TP
|
||||
.BR \-$ ", " \-\-softwrap
|
||||
Enable 'soft wrapping'. This will make \fBnano\fP attempt to display the
|
||||
entire contents of any line, even if it is longer than the screen width, by
|
||||
continuing it over multiple screen lines. Since
|
||||
\&'$' normally refers to a variable in the Unix shell, you should specify
|
||||
this option last when using other options (e.g.\& 'nano \-wS$') or pass it
|
||||
separately (e.g.\& 'nano \-wS \-$').
|
||||
.BR \-z ", " \-\-suspendable
|
||||
Allow the user to suspend the editor (with \fB^Z\fR by default).
|
||||
|
||||
.SH TOGGLES
|
||||
Several of the above options can be switched on and off also while
|
||||
@@ -324,8 +336,14 @@ hard-wrapping of long lines, \fBM\-S\fR toggles soft-wrapping,
|
||||
\fBM\-N\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.
|
||||
.sp
|
||||
The \fBM\-X\fR toggle is special: it works in all menus except
|
||||
the help viewer and the linter. All other toggles work in
|
||||
the main menu only.
|
||||
|
||||
.SH FILES
|
||||
When \fB\-\-rcfile\fR is given, \fBnano\fR will read just the specified file
|
||||
for setting its options and syntaxes and key bindings. Without that option,
|
||||
\fBnano\fR will read two configuration files: first the system's
|
||||
\fInanorc\fR (if it exists), and then the user's \fInanorc\fR (if it
|
||||
exists), either \fI~/.nanorc\fR or \fI$XDG_CONFIG_HOME/nano/nanorc\fR
|
||||
|
||||
306
doc/nano.texi
306
doc/nano.texi
@@ -8,8 +8,8 @@
|
||||
|
||||
@smallbook
|
||||
@set EDITION 0.5
|
||||
@set VERSION 4.6
|
||||
@set UPDATED November 2019
|
||||
@set VERSION 5.0
|
||||
@set UPDATED July 2020
|
||||
|
||||
@dircategory Editors
|
||||
@direntry
|
||||
@@ -23,7 +23,7 @@
|
||||
@titlepage
|
||||
@title GNU @command{nano}
|
||||
@subtitle a small and friendly text editor
|
||||
@subtitle version 4.6
|
||||
@subtitle version 5.0
|
||||
|
||||
@author Chris Allegretta
|
||||
@page
|
||||
@@ -33,7 +33,7 @@ This manual documents the GNU @command{nano} editor.
|
||||
This manual is part of the GNU @command{nano} distribution.@*
|
||||
|
||||
@sp 4
|
||||
Copyright @copyright{} 1999-2009, 2014-2019 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1999-2009, 2014-2020 Free Software Foundation, Inc.
|
||||
|
||||
@sp 1
|
||||
This document is dual-licensed. You may distribute and/or modify it
|
||||
@@ -63,7 +63,7 @@ e-mail: @email{chrisa@@asty.org}@*
|
||||
@node Top
|
||||
@top
|
||||
|
||||
This manual documents the GNU @command{nano} editor, version 4.6.
|
||||
This manual documents the GNU @command{nano} editor, version 5.0.
|
||||
|
||||
@menu
|
||||
* Introduction::
|
||||
@@ -97,7 +97,7 @@ as is reasonable while offering a superset of Pico's functionality.
|
||||
Pico differ.
|
||||
|
||||
Starting with version 4.0, @command{nano} no longer hard-wraps an overlong
|
||||
line by default. It further uses smooth scrolling by default, and by
|
||||
line by default. It further uses linewise scrolling by default, and by
|
||||
default includes the line below the title bar into the editing area.
|
||||
|
||||
If you want the old, Pico behavior back, you can use the
|
||||
@@ -128,6 +128,7 @@ 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.
|
||||
(Negative numbers count from the end of the file or line.)
|
||||
The cursor can also be put on the first or last occurrence of a specific string
|
||||
by specifying that string after @code{+/} or @code{+?} before the filename.
|
||||
The string can be made case sensitive and/or caused to be interpreted as a
|
||||
@@ -185,7 +186,10 @@ The uniquely numbered files are stored in the specified directory.
|
||||
|
||||
@item -D
|
||||
@itemx --boldtext
|
||||
Use bold text instead of reverse video text.
|
||||
For the interface, use bold instead of reverse video. This will be overridden
|
||||
by setting the options @code{titlecolor}, @code{statuscolor}, @code{keycolor},
|
||||
@code{functioncolor}, @code{numbercolor}, and/or @code{selectedcolor} in your
|
||||
nanorc file. @xref{@code{set functioncolor}} for details.
|
||||
|
||||
@item -E
|
||||
@itemx --tabstospaces
|
||||
@@ -236,10 +240,9 @@ hard-wrapping occurs or when text is justified.
|
||||
Disable automatic conversion of files from DOS/Mac format.
|
||||
|
||||
@item -O
|
||||
@itemx --morespace
|
||||
Obsolete and ignored option, since the line below the title bar is included
|
||||
into the editing space by default. If you prefer to keep this line blank,
|
||||
use @option{-e} or @option{--emptyline}.
|
||||
@itemx --bookstyle
|
||||
When justifying, treat any line that starts with whitespace as the
|
||||
beginning of a paragraph (unless auto-indenting is on).
|
||||
|
||||
@item -P
|
||||
@itemx --positionlog
|
||||
@@ -265,10 +268,11 @@ Restricted mode can also be activated by invoking @command{nano} with
|
||||
any name beginning with @code{r} (e.g.@: @command{rnano}).
|
||||
|
||||
@item -S
|
||||
@itemx --smooth
|
||||
Obsolete and ignored option, since smooth scrolling has become the default.
|
||||
If you prefer the chunk-by-chunk scrolling behavior,
|
||||
use @option{-j} or @option{--jumpyscrolling}.
|
||||
@itemx --softwrap
|
||||
Display over multiple screen rows lines that exceed the screen's width.
|
||||
(You can make this soft-wrapping occur at whitespace instead of rudely at
|
||||
the screen's edge, by using also @code{--atblanks}.)
|
||||
(The old short option, @code{-$}, is deprecated.)
|
||||
|
||||
@item -T @var{number}
|
||||
@itemx --tabsize=@var{number}
|
||||
@@ -293,8 +297,8 @@ 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}).
|
||||
should be considered as parts of words. When using this option, you
|
||||
probably want to omit @option{-W} (@option{--wordbounds}).
|
||||
|
||||
@item -Y @var{name}
|
||||
@itemx --syntax=@var{name}
|
||||
@@ -333,6 +337,11 @@ system either Backspace acts like Delete or Delete acts like Backspace.
|
||||
@itemx --emptyline
|
||||
Do not use the line below the title bar, leaving it entirely blank.
|
||||
|
||||
@item -f @var{file}
|
||||
@itemx --rcfile=@var{file}
|
||||
Read only this @var{file} for setting nano's options, instead of reading
|
||||
both the system-wide and the user's nanorc files.
|
||||
|
||||
@item -g
|
||||
@itemx --showcursor
|
||||
Make the cursor visible in the file browser (putting it on the
|
||||
@@ -388,6 +397,12 @@ similar to a chroot.
|
||||
Preserve the @kbd{^Q} (XON) and @kbd{^S} (XOFF) sequences so data being
|
||||
sent to the editor can be stopped and started.
|
||||
|
||||
@item -q
|
||||
@itemx --indicator
|
||||
Display a "scrollbar" on the righthand side of the edit window.
|
||||
It shows the position of the viewport in the buffer
|
||||
and how much of the buffer is covered by the viewport.
|
||||
|
||||
@item -r @var{number}
|
||||
@itemx --fill=@var{number}
|
||||
Set the target width for justifying and automatic hard-wrapping at this
|
||||
@@ -397,8 +412,8 @@ point to vary along with the width of the screen if the screen is resized.
|
||||
The default value is @t{-8}.
|
||||
|
||||
@anchor{@option{--speller}}
|
||||
@item -s "@var{program} [@var{arg} @dots{}]"
|
||||
@itemx --speller="@var{program} [@var{arg} @dots{}]"
|
||||
@item -s "@var{program} [@var{argument} @dots{}]"
|
||||
@itemx --speller="@var{program} [@var{argument} @dots{}]"
|
||||
Use the given program to do spell checking and correcting. By default,
|
||||
@command{nano} uses the command specified in the @env{SPELL} environment
|
||||
variable. If @env{SPELL} is not set, and @option{--speller} is
|
||||
@@ -407,10 +422,11 @@ corrector, which requires either @command{hunspell} or GNU @command{spell}
|
||||
to be installed.
|
||||
|
||||
@item -t
|
||||
@itemx --tempfile
|
||||
Don't ask whether to save a modified buffer when exiting with @kbd{^X}, but
|
||||
assume yes. This option is useful when @command{nano} is used as the
|
||||
composer of a mailer program.
|
||||
@itemx --saveonexit
|
||||
Save a changed buffer without prompting (when exiting with @kbd{^X}).
|
||||
This can be handy when @command{nano} is used as the composer of an
|
||||
email program.
|
||||
(The old form of the long option, @code{--tempfile}, is deprecated.)
|
||||
|
||||
@item -u
|
||||
@item --unix
|
||||
@@ -433,7 +449,6 @@ This is the default. (This option is the opposite of @option{-b}
|
||||
(@option{--breaklonglines}) --- the last one given takes effect.)
|
||||
|
||||
|
||||
@anchor{Expert Mode}
|
||||
@item -x
|
||||
@itemx --nohelp
|
||||
Expert Mode: don't show the Shortcut List at the bottom of the screen.
|
||||
@@ -445,22 +460,13 @@ disabled to display the help-system navigation keys.
|
||||
|
||||
@item -y
|
||||
@itemx --afterends
|
||||
Make Ctrl+Right stop at word ends instead of beginnings.
|
||||
Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
|
||||
|
||||
@item -z
|
||||
@itemx --suspend
|
||||
@itemx --suspendable
|
||||
Enable the ability to suspend @command{nano} using the system's suspend
|
||||
keystroke (usually @kbd{^Z}).
|
||||
|
||||
@item -$
|
||||
@itemx --softwrap
|
||||
Enable 'soft wrapping'. This will make @command{nano} attempt to display the
|
||||
entire contents of any line, even if it is longer than the screen width, by
|
||||
continuing it over multiple screen lines. Since
|
||||
@code{$} normally refers to a variable in the Unix shell, you should specify
|
||||
this option last when using other options (e.g.@: @code{nano -wS$}) or pass it
|
||||
separately (e.g.@: @code{nano -wS -$}).
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@@ -475,6 +481,7 @@ separately (e.g.@: @code{nano -wS -$}).
|
||||
* Screen Layout::
|
||||
* Search and Replace::
|
||||
* Using the Mouse::
|
||||
* Anchors::
|
||||
* Limitations::
|
||||
@end menu
|
||||
|
||||
@@ -609,6 +616,20 @@ Shift key during those actions.
|
||||
The mouse will work in the X Window System, and on the console when gpm
|
||||
is running.
|
||||
|
||||
@node Anchors
|
||||
@section Anchors
|
||||
|
||||
With @kbd{M-Ins} you can place an anchor (a kind of temporary bookmark)
|
||||
at the current line. With @kbd{M-PgUp} and @kbd{M-PgDn} you can jump
|
||||
to an anchor in the backward/forward direction. This jumping wraps
|
||||
around at the top and bottom.
|
||||
|
||||
When a line with an anchor is removed, the line where the cursor ends up
|
||||
inherits the anchor. After performing an operation on the entire buffer
|
||||
(like formatting it, piping it through a command, or doing an external
|
||||
spell check on it), any anchors that were present are gone. And when
|
||||
you close the buffer, all its anchors simply disappear; they are not saved.
|
||||
|
||||
@node Limitations
|
||||
@section Limitations
|
||||
|
||||
@@ -664,7 +685,7 @@ The following global toggles are available:
|
||||
@kbd{Meta-P} toggles the displaying of whitespace (@pxref{Whitespace}).
|
||||
|
||||
@item Soft Wrapping
|
||||
@kbd{Meta-S} toggles the @option{-$} (@option{--softwrap}) command-line option.
|
||||
@kbd{Meta-S} toggles the @option{-S} (@option{--softwrap}) command-line option.
|
||||
|
||||
@item Expert/No Help
|
||||
@kbd{Meta-X} toggles the @option{-x} (@option{--nohelp}) command-line option.
|
||||
@@ -674,7 +695,7 @@ The following global toggles are available:
|
||||
--- @pxref{Syntax Highlighting}).
|
||||
|
||||
@item Suspension
|
||||
@kbd{Meta-Z} toggles the @option{-z} (@option{--suspend}) command-line option.
|
||||
@kbd{Meta-Z} toggles the @option{-z} (@option{--suspendable}) command-line option.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -682,18 +703,21 @@ The following global toggles are available:
|
||||
@node Nanorc Files
|
||||
@chapter Nanorc Files
|
||||
|
||||
The nanorc files contain the default settings for @command{nano}. They
|
||||
should be in Unix format, not in DOS or Mac format. During startup,
|
||||
@command{nano} will first read the system-wide settings, from /etc/nanorc
|
||||
(the exact path might be different), and then the user-specific settings,
|
||||
The nanorc files contain the default settings for @command{nano}. During
|
||||
startup, if @option{--rcfile} is not given, @command{nano} will read two files:
|
||||
first the system-wide settings, from @file{/etc/nanorc} (the exact path
|
||||
might be different on your system), and then the user-specific settings,
|
||||
either from @file{~/.nanorc} or from @file{$XDG_CONFIG_HOME/nano/nanorc}
|
||||
or from @file{.config/nano/nanorc}, whichever exists first.
|
||||
If @option{--rcfile} is given, @command{nano} will read just the
|
||||
specified settings file.
|
||||
|
||||
A nanorc file accepts a series of "set" and "unset" commands, which can
|
||||
be used to configure @command{nano} on startup without using command-line
|
||||
options. Additionally, there are some commands to define syntax highlighting
|
||||
and to rebind keys --- @pxref{Syntax Highlighting} and @ref{Rebinding Keys}.
|
||||
@command{nano} will read one command per line.
|
||||
All commands and keywords should be written in lowercase.
|
||||
|
||||
Options in nanorc files take precedence over @command{nano}'s defaults, and
|
||||
command-line options override nanorc settings. Also, options that do not
|
||||
@@ -718,7 +742,7 @@ The supported settings in a nanorc file are:
|
||||
@table @code
|
||||
|
||||
@item set afterends
|
||||
Make Ctrl+Right stop at word ends instead of beginnings.
|
||||
Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
|
||||
|
||||
@item set allow_insecure_backup
|
||||
When backing up files, allow the backup to succeed even if its
|
||||
@@ -746,9 +770,13 @@ The uniquely numbered files are stored in the specified directory.
|
||||
|
||||
@item set boldtext
|
||||
Use bold instead of reverse video for the title bar, status bar, key combos,
|
||||
function tags, line numbers, and selected text. This can be overridden by
|
||||
function tags, line numbers, and selected text. This is overridden by
|
||||
setting the options @code{titlecolor}, @code{statuscolor}, @code{keycolor},
|
||||
@code{functioncolor}, @code{numbercolor}, and @code{selectedcolor}.
|
||||
@code{functioncolor}, @code{numbercolor}, and/or @code{selectedcolor}.
|
||||
|
||||
@item set bookstyle
|
||||
When justifying, treat any line that starts with whitespace as the
|
||||
beginning of a paragraph (unless auto-indenting is on).
|
||||
|
||||
@item set brackets "@var{characters}"
|
||||
Set the characters treated as closing brackets when justifying
|
||||
@@ -773,7 +801,7 @@ Use cut-from-cursor-to-end-of-line by default, instead of cutting the whole line
|
||||
@item set emptyline
|
||||
Do not use the line below the title bar, leaving it entirely blank.
|
||||
|
||||
@item set errorcolor @var{fgcolor},@var{bgcolor}
|
||||
@item set errorcolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for the status bar when an error message is displayed.
|
||||
The default value is @t{brightwhite,red}.
|
||||
@xref{@code{set functioncolor}} for valid color names.
|
||||
@@ -786,15 +814,26 @@ point to vary along with the width of the screen if the screen is resized.
|
||||
The default value is @t{-8}.
|
||||
|
||||
@anchor{@code{set functioncolor}}
|
||||
@item set functioncolor @var{fgcolor},@var{bgcolor}
|
||||
@item set functioncolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for the concise function descriptions
|
||||
in the two help lines at the bottom of the screen.
|
||||
Valid names for foreground and background color are:
|
||||
@code{white}, @code{black}, @code{blue}, @code{green},
|
||||
@code{red}, @code{cyan}, @code{yellow}, @code{magenta}, and @code{normal}
|
||||
Valid names for the foreground and background colors are:
|
||||
@code{red}, @code{green}, @code{blue},
|
||||
@code{magenta}, @code{yellow}, @code{cyan},
|
||||
@code{white}, and @code{black}.
|
||||
Each of these eight names may be prefixed with the word
|
||||
@code{light} to get a brighter version of that color.
|
||||
|
||||
On terminal emulators that can do at least 256 colors,
|
||||
other valid (but unprefixable) color names are:
|
||||
@code{pink}, @code{purple}, @code{mauve},
|
||||
@code{lagoon}, @code{mint}, @code{lime},
|
||||
@code{peach}, @code{orange}, @code{latte}, and @code{normal}
|
||||
--- where @code{normal} means the default foreground or background color.
|
||||
The name of the foreground color may be prefixed with @code{bright}.
|
||||
And either @var{fgcolor} or ,@var{bgcolor} may be left out.
|
||||
Either @var{fgcolor} or ,@var{bgcolor} may be left out,
|
||||
and the pair may be preceded by @code{bold} and/or @code{italic}
|
||||
(separated by commas) to get a bold and/or slanting typeface,
|
||||
if your terminal can do those.
|
||||
|
||||
@item set guidestripe @var{number}
|
||||
Draw a vertical stripe at the given column, to help judge the width of the
|
||||
@@ -807,7 +846,7 @@ executed commands, so they can be easily reused in later sessions.
|
||||
@item set jumpyscrolling
|
||||
Scroll the buffer contents per half-screen instead of per line.
|
||||
|
||||
@item set keycolor @var{fgcolor},@var{bgcolor}
|
||||
@item set keycolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for the shortcut key combos
|
||||
in the two help lines at the bottom of the screen.
|
||||
@xref{@code{set functioncolor}} for valid color names.
|
||||
@@ -852,7 +891,7 @@ Obsolete option. Ignored.
|
||||
Deprecated option since it has become the default setting.
|
||||
When needed, use @code{unset breaklonglines} instead.
|
||||
|
||||
@item set numbercolor @var{fgcolor},@var{bgcolor}
|
||||
@item set numbercolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for line numbers.
|
||||
@xref{@code{set functioncolor}} for valid color names.
|
||||
|
||||
@@ -869,6 +908,11 @@ The cursor position is remembered for the 200 most-recently edited files.
|
||||
@item set preserve
|
||||
Preserve the XON and XOFF keys (@kbd{^Q} and @kbd{^S}).
|
||||
|
||||
@item set indicator
|
||||
Display a "scrollbar" on the righthand side of the edit window.
|
||||
It shows the position of the viewport in the buffer
|
||||
and how much of the buffer is covered by the viewport.
|
||||
|
||||
@item set punct "@var{characters}"
|
||||
Set the characters treated as closing punctuation when justifying
|
||||
paragraphs. This may not include blank characters. Only the
|
||||
@@ -902,7 +946,11 @@ system either Backspace acts like Delete or Delete acts like Backspace.
|
||||
Do regular-expression searches by default.
|
||||
Regular expressions in @command{nano} are of the extended type (ERE).
|
||||
|
||||
@item set selectedcolor @var{fgcolor},@var{bgcolor}
|
||||
@item set saveonexit
|
||||
Save a changed buffer automatically on exit (@kbd{^X}); don't prompt.
|
||||
(The old form of this option, @code{set tempfile}, is deprecated.)
|
||||
|
||||
@item set selectedcolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for selected text.
|
||||
@xref{@code{set functioncolor}} for valid color names.
|
||||
|
||||
@@ -923,22 +971,24 @@ Deprecated option since it has become the default setting.
|
||||
When needed, use @code{unset jumpyscrolling} instead.
|
||||
|
||||
@item set softwrap
|
||||
Enable soft line wrapping for easier viewing of very long lines.
|
||||
Display lines that exceed the screen's width over multiple screen lines.
|
||||
(You can make this soft-wrapping occur at whitespace instead of rudely at
|
||||
the screen's edge, by using also @code{set atblanks}.)
|
||||
|
||||
@item set speller "@var{program} [@var{arg} @dots{}]"
|
||||
@item set speller "@var{program} [@var{argument} @dots{}]"
|
||||
Use the given program to do spell checking and correcting.
|
||||
@xref{@option{--speller}} for details.
|
||||
|
||||
@item set statuscolor @var{fgcolor},@var{bgcolor}
|
||||
@item set statuscolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for the status bar.
|
||||
@xref{@code{set functioncolor}} for valid color names.
|
||||
|
||||
@item set stripecolor @var{fgcolor},@var{bgcolor}
|
||||
@item set stripecolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for the vertical guiding stripe.
|
||||
@xref{@code{set functioncolor}} for valid color names.
|
||||
|
||||
@item set suspend
|
||||
Allow @command{nano} to be suspended.
|
||||
@item set suspendable
|
||||
Allow @command{nano} to be suspended (with @kbd{^Z} by default).
|
||||
|
||||
@item set tabsize @var{number}
|
||||
Use a tab size of @var{number} columns. The value of @var{number} must be
|
||||
@@ -947,10 +997,7 @@ greater than 0. The default value is @t{8}.
|
||||
@item set tabstospaces
|
||||
Convert typed tabs to spaces.
|
||||
|
||||
@item set tempfile
|
||||
Save automatically on exit, don't prompt.
|
||||
|
||||
@item set titlecolor @var{fgcolor},@var{bgcolor}
|
||||
@item set titlecolor [bold,][italic,]@var{fgcolor},@var{bgcolor}
|
||||
Use this color combination for the title bar.
|
||||
@xref{@code{set functioncolor}} for valid color names.
|
||||
|
||||
@@ -980,8 +1027,8 @@ characters as part of a word.
|
||||
|
||||
@item set wordchars "@var{characters}"
|
||||
Specify which other characters (besides the normal alphanumeric ones)
|
||||
should be considered as parts of words. This overrides the option
|
||||
@code{wordbounds}.
|
||||
should be considered as parts of words. When using this option, you
|
||||
probably want to unset @code{wordbounds}.
|
||||
|
||||
@item set zap
|
||||
Let an unmodified @key{Backspace} or @key{Delete} erase the marked region
|
||||
@@ -1048,13 +1095,13 @@ file, to determine whether this syntax should be used for it.
|
||||
(This functionality only works when @code{libmagic} is installed
|
||||
on the system and will be silently ignored otherwise.)
|
||||
|
||||
@item formatter @var{program} [@var{arg} @dots{}]
|
||||
@item formatter @var{program} [@var{argument} @dots{}]
|
||||
Run the given @var{program} on the full contents of the current buffer.
|
||||
(The current buffer is written out to a temporary file, the program is
|
||||
run on it, and then the temporary file is read back in, replacing the
|
||||
contents of the buffer.)
|
||||
|
||||
@item linter @var{program} [@var{arg} @dots{}]
|
||||
@item linter @var{program} [@var{argument} @dots{}]
|
||||
Use the given @var{program} to do a syntax check on the current buffer.
|
||||
|
||||
@item comment "@var{string}"
|
||||
@@ -1073,25 +1120,33 @@ Make the <Tab> key produce the given @var{string}. Useful for languages like
|
||||
Python that want to see only spaces for indentation.
|
||||
This overrides the setting of the @code{tabstospaces} option.
|
||||
|
||||
@item color @var{fgcolor},@var{bgcolor} "@var{regex}" @dots{}
|
||||
@item color [bold,][italic,]@var{fgcolor},@var{bgcolor} "@var{regex}" @dots{}
|
||||
Paint all pieces of text that match the extended regular expression "regex"
|
||||
with the given foreground and background colors, at least one of which must
|
||||
be specified. Valid color names are:
|
||||
@code{white}, @code{black}, @code{blue}, @code{green},
|
||||
@code{red}, @code{cyan}, @code{yellow}, @code{magenta}, and @code{normal}
|
||||
@code{red}, @code{green}, @code{blue},
|
||||
@code{magenta}, @code{yellow}, @code{cyan},
|
||||
@code{white}, and @code{black}.
|
||||
Each of these eight names may be prefixed with the word
|
||||
@code{light} to get a brighter version of that color.
|
||||
|
||||
On terminal emulators that can do at least 256 colors,
|
||||
other valid (but unprefixable) color names are:
|
||||
@code{pink}, @code{purple}, @code{mauve},
|
||||
@code{lagoon}, @code{mint}, @code{lime},
|
||||
@code{peach}, @code{orange}, @code{latte}, and @code{normal}
|
||||
--- where @code{normal} means the default foreground or background color.
|
||||
You may use the prefix @code{bright} for the foreground color to get a
|
||||
stronger highlight.
|
||||
If your terminal supports transparency, not specifying a "bgcolor"
|
||||
tells @command{nano} to attempt to use a transparent background.
|
||||
The color pair may be preceded by @code{bold} and/or @code{italic}
|
||||
(separated by commas) to get a bold and/or slanting typeface,
|
||||
if your terminal can do those.
|
||||
|
||||
All coloring commands are applied in the order in which they are specified,
|
||||
which means that later commands can recolor stuff that was colored earlier.
|
||||
|
||||
@item icolor @var{fgcolor},@var{bgcolor} "@var{regex}" @dots{}
|
||||
@item icolor [bold,][italic,]@var{fgcolor},@var{bgcolor} "@var{regex}" @dots{}
|
||||
Same as above, except that the matching is case insensitive.
|
||||
|
||||
@item color @var{fgcolor},@var{bgcolor} start="@var{fromrx}" end="@var{torx}"
|
||||
@item color [bold,][italic,]@var{fgcolor},@var{bgcolor} start="@var{fromrx}" end="@var{torx}"
|
||||
Paint all pieces of text whose start matches extended regular expression
|
||||
"fromrx" and whose end matches extended regular expression "torx" with
|
||||
the given foreground and background colors, at least one of
|
||||
@@ -1099,7 +1154,7 @@ which must be specified. This means that, after an initial instance of
|
||||
"fromrx", all text until the first instance of "torx" will be colored.
|
||||
This allows syntax highlighting to span multiple lines.
|
||||
|
||||
@item icolor @var{fgcolor},@var{bgcolor} start="@var{fromrx}" end="@var{torx}"
|
||||
@item icolor [bold,][italic,]@var{fgcolor},@var{bgcolor} start="@var{fromrx}" end="@var{torx}"
|
||||
Same as above, except that the matching is case insensitive.
|
||||
|
||||
@item include "@var{syntaxfile}"
|
||||
@@ -1107,10 +1162,11 @@ Read in self-contained color syntaxes from "syntaxfile". Note that
|
||||
"syntaxfile" may contain only the above commands, from @code{syntax}
|
||||
to @code{icolor}.
|
||||
|
||||
@item extendsyntax @var{name} @var{command} [@var{arg} @dots{}]
|
||||
@item extendsyntax @var{name} @var{command} @var{argument} @dots{}
|
||||
Extend the syntax previously defined as "@var{name}" with another @var{command}.
|
||||
This allows you to add a new @code{color}, @code{icolor}, @code{header},
|
||||
@code{magic}, @code{comment}, @code{linter}, or @code{formatter} command to an already
|
||||
@code{magic}, @code{formatter}, @code{linter}, @code{comment},
|
||||
or @code{tabgives} command to an already
|
||||
defined syntax --- useful when you want to slightly improve a syntax defined
|
||||
in one of the system-installed files (which normally are not writable).
|
||||
|
||||
@@ -1153,7 +1209,14 @@ Example: @code{^C}.
|
||||
@item
|
||||
@code{M-@var{X}} ------ where @var{X} is any ASCII character except [,
|
||||
or the word "Space".
|
||||
Example: @code{M-C}.
|
||||
Example: @code{M-8}.
|
||||
|
||||
@item
|
||||
@code{Sh-M-@var{X}} ------ where @var{X} is a Latin letter.
|
||||
Example: @code{Sh-M-U}.
|
||||
By default, each Meta+letter keystroke does the same as the corresponding
|
||||
Shift+Meta+letter. But when any Shift+Meta bind is made, that will
|
||||
no longer be the case, for all letters.
|
||||
|
||||
@item
|
||||
@code{F@var{n}} ------ where @var{n} is a numeric value from 1 to 24.
|
||||
@@ -1166,6 +1229,10 @@ with Shift.)
|
||||
@end itemize
|
||||
|
||||
Rebinding @code{^M} (Enter) or @code{^I} (Tab) is probably not a good idea.
|
||||
Rebinding @code{^[} (Esc) is not possible, because its keycode
|
||||
is the starter byte of Meta keystrokes and escape sequences.
|
||||
Rebinding any of the dedicated cursor-moving keys (the arrows, Home, End,
|
||||
PageUp and PageDown) is not possible.
|
||||
On some terminals it's not possible to rebind @code{^H} (unless @code{--raw}
|
||||
is used) because its keycode is identical to that of the Backspace key.
|
||||
|
||||
@@ -1181,7 +1248,7 @@ Invokes the help viewer.
|
||||
Cancels the current command.
|
||||
|
||||
@item exit
|
||||
Exits from the program (or from the help viewer or the file browser).
|
||||
Exits from the program (or from the help viewer or file browser).
|
||||
|
||||
@item writeout
|
||||
Writes the current buffer to disk, asking for a name.
|
||||
@@ -1228,7 +1295,7 @@ Throws away the current line (or the marked region).
|
||||
Deletes from the cursor position to the beginning of the preceding word.
|
||||
(This function is bound by default to <Shift+Ctrl+Delete>. If your terminal
|
||||
produces @code{^H} for <Ctrl+Backspace>, you can make <Ctrl+Backspace> delete
|
||||
the word to the left of the cursor by rebinding ^H to this function.)
|
||||
the word to the left of the cursor by rebinding @kbd{^H} to this function.)
|
||||
|
||||
@item chopwordright
|
||||
Deletes from the cursor position to the beginning of the next word.
|
||||
@@ -1241,12 +1308,18 @@ Cuts all text from the cursor position till the end of the buffer.
|
||||
Sets the mark at the current position, to start selecting text.
|
||||
Or, when it is set, unsets the mark.
|
||||
|
||||
@item curpos
|
||||
Shows the current cursor position: the line, column, and character positions.
|
||||
@item location
|
||||
Reports the current position of the cursor in the buffer:
|
||||
the line, column, and character positions.
|
||||
(The old name of this function, 'curpos', is deprecated.)
|
||||
|
||||
@item wordcount
|
||||
Counts the number of words, lines and characters in the current buffer.
|
||||
|
||||
@item execute
|
||||
Prompts for a program to execute. The program's output will be inserted
|
||||
into the current buffer (or into a new buffer when @kbd{M-F} is toggled).
|
||||
|
||||
@item speller
|
||||
Invokes a spell-checking program, either the default @command{hunspell}
|
||||
or GNU @command{spell}, or the one defined by @option{--speller} or
|
||||
@@ -1301,6 +1374,9 @@ while keeping the cursor in the same text position, if possible.
|
||||
Scrolls the viewport down one row (meaning that the text slides up)
|
||||
while keeping the cursor in the same text position, if possible.
|
||||
|
||||
@item center
|
||||
Scrolls the line with the cursor to the middle of the screen.
|
||||
|
||||
@item prevword
|
||||
Moves the cursor to the beginning of the previous word.
|
||||
|
||||
@@ -1346,6 +1422,15 @@ from the end of the file (and end of the line).
|
||||
Moves the cursor to the bracket (brace, parenthesis, etc.) that matches
|
||||
(pairs) with the one under the cursor.
|
||||
|
||||
@item anchor
|
||||
Places an anchor at the current line, or removes it when already present.
|
||||
|
||||
@item prevanchor
|
||||
Goes to the first anchor before the current line.
|
||||
|
||||
@item nextanchor
|
||||
Goes to the first anchor after the current line.
|
||||
|
||||
@item prevbuf
|
||||
Switches to editing/viewing the previous buffer when multiple buffers are open.
|
||||
|
||||
@@ -1385,7 +1470,7 @@ Refreshes the screen.
|
||||
|
||||
@item suspend
|
||||
Suspends the editor (if the suspending function is enabled, see the
|
||||
"suspendenable" entry below).
|
||||
@code{suspendable} toggle item below).
|
||||
|
||||
@item casesens
|
||||
Toggles whether searching/replacing ignores or respects the case of
|
||||
@@ -1441,24 +1526,27 @@ When writing a file, creates a backup of the current file.
|
||||
|
||||
@item discardbuffer
|
||||
When about to write a file, discard the current buffer without saving.
|
||||
(This function is bound by default only when option @option{--tempfile}
|
||||
(This function is bound by default only when option @option{--saveonexit}
|
||||
is in effect.)
|
||||
|
||||
@item browser
|
||||
Starts the file browser, allowing to select a file from a list.
|
||||
Starts the file browser (in the Read File and Write Out menus),
|
||||
allowing to select a file from a list.
|
||||
|
||||
@item gotodir
|
||||
Goes to a directory to be specified, allowing to browse anywhere
|
||||
in the filesystem.
|
||||
|
||||
@item firstfile
|
||||
Goes to the first file when using the file browser (reading or writing files).
|
||||
Goes to the first file in the list when using the file browser.
|
||||
|
||||
@item lastfile
|
||||
Goes to the last file when using the file browser (reading or writing files).
|
||||
Goes to the last file in the list when using the file browser.
|
||||
|
||||
@item nohelp
|
||||
Toggles the presence of the two-line list of key bindings at the bottom of the screen.
|
||||
(This toggle is special: it is available in all menus except the help viewer
|
||||
and the linter. All further toggles are available in the main menu only.)
|
||||
|
||||
@item constantshow
|
||||
Toggles the constant display of the current line, column, and character positions.
|
||||
@@ -1496,8 +1584,10 @@ Toggles whether typed tabs will be converted to spaces.
|
||||
@item mouse
|
||||
Toggles mouse support.
|
||||
|
||||
@item suspendenable
|
||||
Toggles whether the suspend shortcut (normally @kbd{^Z}) will suspend the editor.
|
||||
@item suspendable
|
||||
Toggles whether the suspend keystroke (@kbd{^Z} by default)
|
||||
will actually suspend the editor.
|
||||
(The old name of this function, 'suspendenable', is deprecated.)
|
||||
|
||||
@end table
|
||||
|
||||
@@ -1509,6 +1599,9 @@ Valid names for @code{menu} are:
|
||||
@item main
|
||||
The main editor window where text is entered and edited.
|
||||
|
||||
@item help
|
||||
The help-viewer menu.
|
||||
|
||||
@item search
|
||||
The search menu (AKA whereis).
|
||||
|
||||
@@ -1530,20 +1623,9 @@ The 'write file' menu.
|
||||
@item insert
|
||||
The 'insert file' menu.
|
||||
|
||||
@item extcmd
|
||||
The menu for inserting output from an external command, reached from the insert menu.
|
||||
|
||||
@item help
|
||||
The help-viewer menu.
|
||||
|
||||
@item spell
|
||||
The menu of the integrated spell checker where the user can edit a misspelled word.
|
||||
|
||||
@item linter
|
||||
The linter menu.
|
||||
|
||||
@item browser
|
||||
The file browser, for choosing a file to read from or write to.
|
||||
The 'file browser' menu, for selecting a file to be opened or
|
||||
inserted or written to.
|
||||
|
||||
@item whereisfile
|
||||
The 'search for a file' menu in the file browser.
|
||||
@@ -1551,6 +1633,18 @@ The 'search for a file' menu in the file browser.
|
||||
@item gotodir
|
||||
The 'go to directory' menu in the file browser.
|
||||
|
||||
@item execute
|
||||
The menu for inserting the output from an external command,
|
||||
or for filtering the buffer (or the marked region) through
|
||||
an external command, or for executing one of several tools.
|
||||
(The old form of this menu name, 'extcmd', is deprecated.)
|
||||
|
||||
@item spell
|
||||
The menu of the integrated spell checker where the user can edit a misspelled word.
|
||||
|
||||
@item linter
|
||||
The linter menu, which allows jumping through the linting messages.
|
||||
|
||||
@item all
|
||||
A special name that encompasses all menus. For @code{bind} it means
|
||||
all menus where the specified @code{function} exists; for @code{unbind}
|
||||
@@ -1598,7 +1692,7 @@ whereas Pico does it at screen width minus six columns. You can make
|
||||
By default, @command{nano} will scroll just one line (instead of half
|
||||
a screen) when the cursor is moved to a line that is just out of view.
|
||||
And when paging up or down, @command{nano} keeps the cursor in the same
|
||||
screen position as much as possible, instead always placing it on the
|
||||
screen position as much as possible, instead of always placing it on the
|
||||
first line of the viewport. The Pico-like behavior can be obtained
|
||||
with the @option{--jumpyscrolling} option.
|
||||
|
||||
|
||||
226
doc/nanorc.5
226
doc/nanorc.5
@@ -1,4 +1,4 @@
|
||||
.\" Copyright (C) 2003-2011, 2013-2019 Free Software Foundation, Inc.
|
||||
.\" Copyright (C) 2003-2011, 2013-2020 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:
|
||||
@@ -16,27 +16,35 @@
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <https://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH NANORC 5 "version 4.6" "November 2019"
|
||||
.TH NANORC 5 "version 5.0" "July 2020"
|
||||
|
||||
.SH NAME
|
||||
nanorc \- GNU nano's configuration file
|
||||
|
||||
.SH NOTICE
|
||||
Starting with version 4.0, \fBnano\fR no longer hard-wraps an overlong
|
||||
line by default. It further uses smooth scrolling by default, and by
|
||||
default includes the line below the title bar into the editing area.
|
||||
.sp
|
||||
If you want the old, Pico behavior back, you can use \fBset breaklonglines\fR,
|
||||
\fBset jumpyscrolling\fR, and \fBset emptyline\fR.
|
||||
|
||||
.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
|
||||
DOS or Mac format. During startup, \fBnano\fP will first read the
|
||||
The \fInanorc\fP files contain the default settings for \fBnano\fP,
|
||||
a small and friendly editor. During startup, if \fB\-\-rcfile\fR
|
||||
is not given, \fBnano\fR will read two files: first the
|
||||
system-wide settings, from \fI/etc/nanorc\fP (the exact path might be
|
||||
different on your system), and then the user-specific settings, either
|
||||
from \fI~/.nanorc\fR or from \fI$XDG_CONFIG_HOME/nano/nanorc\fR
|
||||
or from \fI~/.config/nano/nanorc\fR, whichever is encountered first.
|
||||
If \fB\-\-rcfile\fR is given, \fBnano\fR will read just the specified
|
||||
settings file.
|
||||
|
||||
.SH NOTICE
|
||||
Since version 4.0, \fBnano\fR by default:
|
||||
.sp
|
||||
.RS 4
|
||||
\(bu does not automatically hard-wrap lines that become overlong,
|
||||
.br
|
||||
\(bu includes the line below the title bar in the editing area,
|
||||
.br
|
||||
\(bu does linewise (smooth) scrolling.
|
||||
.RE
|
||||
.sp
|
||||
To get the old, Pico behavior back, you can use \fBset breaklonglines\fR,
|
||||
\fBset emptyline\fR, and \fBset jumpyscrolling\fR.
|
||||
|
||||
.SH OPTIONS
|
||||
The configuration file accepts a series of \fBset\fP and \fBunset\fP
|
||||
@@ -44,6 +52,7 @@ commands, which can be used to configure nano on startup without using
|
||||
command-line options. Additionally, there are some commands to define
|
||||
syntax highlighting and to rebind keys -- see the two separate sections
|
||||
on those. \fBnano\fP reads one command per line.
|
||||
All commands and keywords should be written in lowercase.
|
||||
.sp
|
||||
Options in \fInanorc\fP files take precedence over nano's defaults, and
|
||||
command-line options override \fInanorc\fP settings. Also, options that
|
||||
@@ -59,7 +68,7 @@ The supported commands and arguments are:
|
||||
|
||||
.TP 3
|
||||
.B set afterends
|
||||
Make Ctrl+Right stop at word ends instead of beginnings.
|
||||
Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
|
||||
.TP
|
||||
.B set allow_insecure_backup
|
||||
When backing up files, allow the backup to succeed even if its permissions
|
||||
@@ -91,6 +100,10 @@ function tags, line numbers, and selected text. This can be overridden by
|
||||
setting the options \fBtitlecolor\fP, \fBstatuscolor\fP, \fBkeycolor\fP,
|
||||
\fBfunctioncolor\fP, \fBnumbercolor\fP, and \fBselectedcolor\fP.
|
||||
.TP
|
||||
.B set bookstyle
|
||||
When justifying, treat any line that starts with whitespace as the
|
||||
beginning of a paragraph (unless auto-indenting is on).
|
||||
.TP
|
||||
.BI "set brackets """ characters """
|
||||
Set the characters treated as closing brackets when justifying
|
||||
paragraphs. This may not include blank characters. Only closing
|
||||
@@ -113,7 +126,7 @@ Use cut-from-cursor-to-end-of-line by default, instead of cutting the whole line
|
||||
.B set emptyline
|
||||
Do not use the line below the title bar, leaving it entirely blank.
|
||||
.TP
|
||||
.B set errorcolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
.B set errorcolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
|
||||
Use this color combination for the status bar when an error message is displayed.
|
||||
The default value is \fBbrightwhite,red\fR.
|
||||
See \fBset titlecolor\fR for valid color names.
|
||||
@@ -125,7 +138,7 @@ at the width of the screen minus \fInumber\fR columns, allowing the wrap
|
||||
point to vary along with the width of the screen if the screen is resized.
|
||||
The default value is \fB\-8\fR.
|
||||
.TP
|
||||
.B set functioncolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
.B set functioncolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
|
||||
Specify the color combination to use for the function descriptions
|
||||
in the two help lines at the bottom of the screen.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
@@ -138,10 +151,15 @@ text. (The color of the stripe can be changed with \fBset stripecolor\fR.)
|
||||
Save the last hundred search strings and replacement strings and
|
||||
executed commands, so they can be easily reused in later sessions.
|
||||
.TP
|
||||
.B set indicator
|
||||
Display a "scrollbar" on the righthand side of the edit window.
|
||||
It shows the position of the viewport in the buffer
|
||||
and how much of the buffer is covered by the viewport.
|
||||
.TP
|
||||
.B set jumpyscrolling
|
||||
Scroll the buffer contents per half-screen instead of per line.
|
||||
.TP
|
||||
.B set keycolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
.B set keycolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\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.
|
||||
@@ -170,7 +188,7 @@ System, and on the console when gpm is running. Text can still be
|
||||
selected through dragging by holding down the Shift key.
|
||||
.TP
|
||||
.B set multibuffer
|
||||
When reading in a file with ^R, insert it into a new buffer by default.
|
||||
When reading in a file with \fB^R\fR, insert it into a new buffer by default.
|
||||
.TP
|
||||
.B set noconvert
|
||||
Don't convert files from DOS/Mac format.
|
||||
@@ -189,7 +207,7 @@ Obsolete option. Ignored.
|
||||
Deprecated option since it has become the default setting.
|
||||
When needed, use \fBunset breaklonglines\fR instead.
|
||||
.TP
|
||||
.B set numbercolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
.B set numbercolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
|
||||
Specify the color combination to use for line numbers.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
.TP
|
||||
@@ -204,7 +222,7 @@ Save the cursor position of files between editing sessions.
|
||||
The cursor position is remembered for the 200 most-recently edited files.
|
||||
.TP
|
||||
.B set preserve
|
||||
Preserve the XON and XOFF keys (^Q and ^S).
|
||||
Preserve the XON and XOFF keys (\fB^Q\fR and \fB^S\fR).
|
||||
.TP
|
||||
.BI "set punct """ characters """
|
||||
Set the characters treated as closing punctuation when justifying
|
||||
@@ -238,7 +256,11 @@ system either Backspace acts like Delete or Delete acts like Backspace.
|
||||
Do regular-expression searches by default.
|
||||
Regular expressions in \fBnano\fR are of the extended type (ERE).
|
||||
.TP
|
||||
.B set selectedcolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
.B set saveonexit
|
||||
Save a changed buffer automatically on exit (\fB^X\fR); don't prompt.
|
||||
(The old form of this option, \fBset tempfile\fR, is deprecated.)
|
||||
.TP
|
||||
.B set selectedcolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
|
||||
Specify the color combination to use for selected text.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
.TP
|
||||
@@ -258,22 +280,24 @@ Deprecated option since it has become the default setting.
|
||||
When needed, use \fBunset jumpyscrolling\fR instead.
|
||||
.TP
|
||||
.B set softwrap
|
||||
Enable soft line wrapping for easier viewing of very long lines.
|
||||
Display lines that exceed the screen's width over multiple screen lines.
|
||||
(You can make this soft-wrapping occur at whitespace instead of rudely at
|
||||
the screen's edge, by using also \fBset atblanks\fR.)
|
||||
.TP
|
||||
.B set speller """\fIprogram\fR [\fIarg\fR...]\fB"""
|
||||
.B set speller """\fIprogram\fR [\fIargument \fR...]\fB"""
|
||||
Use the given \fIprogram\fR to do spell checking and correcting, instead of
|
||||
using the built-in corrector that calls \fBhunspell\fR or GNU \fBspell\fR.
|
||||
.TP
|
||||
.B set statuscolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
.B set statuscolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
|
||||
Specify the color combination to use for the status bar.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
.TP
|
||||
.B set stripecolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
.B set stripecolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
|
||||
Specify the color combination to use for the vertical guiding stripe.
|
||||
See \fBset titlecolor\fR for more details.
|
||||
.TP
|
||||
.B set suspend
|
||||
Allow \fBnano\fP to be suspended.
|
||||
.B set suspendable
|
||||
Allow \fBnano\fP to be suspended (with \fB^Z\fR by default).
|
||||
.TP
|
||||
.B set tabsize \fInumber\fR
|
||||
Use a tab size of \fInumber\fR columns. The value of \fInumber\fP must be
|
||||
@@ -282,17 +306,22 @@ greater than 0. The default value is \fB8\fR.
|
||||
.B set tabstospaces
|
||||
Convert typed tabs to spaces.
|
||||
.TP
|
||||
.B set tempfile
|
||||
Save automatically on exit, don't prompt.
|
||||
.TP
|
||||
.B set titlecolor \fIfgcolor\fR,\fIbgcolor\fR
|
||||
.B set titlecolor \fR[\fBbold,\fR][\fBitalic,\fR]\fIfgcolor\fB,\fIbgcolor\fR
|
||||
Specify the color combination to use for the title bar.
|
||||
Valid names for the foreground and background colors are:
|
||||
.BR white ", " black ", " blue ", " green ", " red ", "
|
||||
.BR cyan ", " yellow ", " magenta ", and " normal
|
||||
.BR red ", " green ", " blue ", " magenta ", " yellow ", " cyan ", "
|
||||
.BR white ", and " black .
|
||||
Each of these eight names may be prefixed with the word \fBlight\fR
|
||||
to get a brighter version of that color.
|
||||
On terminal emulators that can do at least 256 colors,
|
||||
other valid (but unprefixable) color names are:
|
||||
.BR pink ", " purple ", " mauve ", " lagoon ", " mint ", "
|
||||
.BR lime ", " peach ", " orange ", " latte ", and " normal
|
||||
-- where \fBnormal\fR means the default foreground or background color.
|
||||
The name of the foreground color may be prefixed with \fBbright\fR.
|
||||
And either "\fIfgcolor\fR" or ",\fIbgcolor\fR" may be left out.
|
||||
Either "\fIfgcolor\fR" or "\fB,\fIbgcolor\fR" may be left out,
|
||||
and the pair may be preceded by \fBbold\fR and/or \fBitalic\fR
|
||||
(separated by commas) to get a bold and/or slanting typeface,
|
||||
if your terminal can do those.
|
||||
.TP
|
||||
.B set trimblanks
|
||||
Remove trailing whitespace from wrapped lines when automatic
|
||||
@@ -319,8 +348,8 @@ characters as parts of words.
|
||||
.TP
|
||||
.BI "set wordchars """ characters """
|
||||
Specify which other characters (besides the normal alphanumeric ones)
|
||||
should be considered as parts of words. This overrides the option
|
||||
\fBwordbounds\fR.
|
||||
should be considered as parts of words. When using this option, you
|
||||
probably want to unset \fBwordbounds\fR.
|
||||
.TP
|
||||
.B set zap
|
||||
Let an unmodified Backspace or Delete erase the marked region
|
||||
@@ -381,13 +410,13 @@ file, to determine whether this syntax should be used for it.
|
||||
(This functionality only works when \fBlibmagic\fP is installed on the
|
||||
system and will be silently ignored otherwise.)
|
||||
.TP
|
||||
.BI formatter " program " \fR[ "arg " \fR...]
|
||||
.BI formatter " program " \fR[ "argument " \fR...]
|
||||
Run the given \fIprogram\fR on the full contents of the current buffer.
|
||||
(The current buffer is written out to a temporary file, the program is
|
||||
run on it, and then the temporary file is read back in, replacing the
|
||||
contents of the buffer.)
|
||||
.TP
|
||||
.BI linter " program " \fR[ "arg " \fR...]
|
||||
.BI linter " program " \fR[ "argument " \fR...]
|
||||
Use the given \fIprogram\fR to run a syntax check on the current buffer.
|
||||
.TP
|
||||
.BI "comment """ string """
|
||||
@@ -406,24 +435,30 @@ Make the <Tab> key produce the given \fIstring\fR. Useful for languages like
|
||||
Python that want to see only spaces for indentation.
|
||||
This overrides the setting of the \fBtabstospaces\fR option.
|
||||
.TP
|
||||
.BI "color " fgcolor , bgcolor " """ regex """ " \fR...
|
||||
.BI "color \fR[\fBbold,\fR][\fBitalic,\fR]" fgcolor , bgcolor " """ regex """ " \fR...
|
||||
Paint all pieces of text that match the extended regular expression
|
||||
\fIregex\fP with the given foreground and background colors, at least
|
||||
one of which must be specified. Valid color names are:
|
||||
.BR white ", " black ", " blue ", " green ", " red ", "
|
||||
.BR cyan ", " yellow ", " magenta ", and " normal
|
||||
.BR red ", " green ", " blue ", " magenta ", " yellow ", " cyan ", "
|
||||
.BR white ", and " black .
|
||||
Each of these eight names may be prefixed with the word \fBlight\fR
|
||||
to get a brighter version of that color.
|
||||
On terminal emulators that can do at least 256 colors,
|
||||
other valid (but unprefixable) color names are:
|
||||
.BR pink ", " purple ", " mauve ", " lagoon ", " mint ", "
|
||||
.BR lime ", " peach ", " orange ", " latte ", and " normal
|
||||
-- where \fBnormal\fR means the default foreground or background color.
|
||||
You may use the prefix \fBbright\fR for the foreground color to get a
|
||||
stronger highlight. If your terminal supports transparency, not specifying
|
||||
a \fIbgcolor\fP tells \fBnano\fP to attempt to use a transparent background.
|
||||
The color pair may be preceded by \fBbold\fR and/or \fBitalic\fR
|
||||
(separated by commas) to get a bold and/or slanting typeface,
|
||||
if your terminal can do those.
|
||||
.sp
|
||||
All coloring commands are applied in the order in which they are specified,
|
||||
which means that later commands can recolor stuff that was colored earlier.
|
||||
.TP
|
||||
.BI "icolor " fgcolor , bgcolor " """ regex """ " \fR...
|
||||
.BI "icolor \fR[\fBbold,\fR][\fBitalic,\fR]" fgcolor , bgcolor " """ regex """ " \fR...
|
||||
Same as above, except that the matching is case insensitive.
|
||||
.TP
|
||||
.BI "color " fgcolor , bgcolor " start=""" fromrx """ end=""" torx """
|
||||
.BI "color \fR[\fBbold,\fR][\fBitalic,\fR]" fgcolor , bgcolor " start=""" fromrx """ end=""" torx """
|
||||
Paint all pieces of text whose start matches extended regular expression
|
||||
\fIfromrx\fP and whose end matches extended regular expression \fItorx\fP
|
||||
with the given foreground and background colors,
|
||||
@@ -432,7 +467,7 @@ initial instance of \fIfromrx\fP, all text until the first instance of
|
||||
\fItorx\fP will be colored. This allows syntax highlighting to span
|
||||
multiple lines.
|
||||
.TP
|
||||
.BI "icolor " fgcolor , bgcolor " start=""" fromrx """ end=""" torx """
|
||||
.BI "icolor \fR[\fBbold,\fR][\fBitalic,\fR]" fgcolor , bgcolor " start=""" fromrx """ end=""" torx """
|
||||
Same as above, except that the matching is case insensitive.
|
||||
.TP
|
||||
.BI "include """ syntaxfile """
|
||||
@@ -440,10 +475,11 @@ Read in self-contained color syntaxes from \fIsyntaxfile\fP. Note that
|
||||
\fIsyntaxfile\fP may contain only the above commands, from \fBsyntax\fP
|
||||
to \fBicolor\fP.
|
||||
.TP
|
||||
.BI extendsyntax " name command " \fR[ "arg " \fR...]
|
||||
.BI extendsyntax " name command argument " \fR...
|
||||
Extend the syntax previously defined as \fIname\fR with another
|
||||
\fIcommand\fR. This allows adding a new \fBcolor\fP, \fBicolor\fP,
|
||||
\fBheader\fP, \fBmagic\fP, \fBcomment\fP, \fBlinter\fP, or \fBformatter\fR
|
||||
\fBheader\fR, \fBmagic\fR, \fBformatter\fR, \fBlinter\fR, \fBcomment\fR,
|
||||
or \fBtabgives\fR
|
||||
command to an already defined syntax -- useful when you want to
|
||||
slightly improve a syntax defined in one of the system-installed
|
||||
files (which normally are not writable).
|
||||
@@ -471,7 +507,7 @@ menus where the key exists when \fBall\fP is used).
|
||||
.TP
|
||||
The format of \fIkey\fP should be one of:
|
||||
.RS 3
|
||||
.TP 5
|
||||
.TP 7
|
||||
.BI ^ X
|
||||
where \fIX\fR is a Latin letter, or one of several ASCII characters
|
||||
(@, ], \\, ^, _), or the word "Space".
|
||||
@@ -479,7 +515,14 @@ Example: ^C.
|
||||
.TP
|
||||
.BI M\- X
|
||||
where \fIX\fR is any ASCII character except [, or the word "Space".
|
||||
Example: M\-C.
|
||||
Example: M\-8.
|
||||
.TP
|
||||
.BI Sh\-M\- X
|
||||
where \fIX\fR is a Latin letter.
|
||||
Example: Sh\-M\-U.
|
||||
By default, each Meta+letter keystroke does the same as the corresponding
|
||||
Shift+Meta+letter. But when any Shift+Meta bind is made, that will
|
||||
no longer be the case, for all letters.
|
||||
.TP
|
||||
.BI F N
|
||||
where \fIN\fR is a numeric value from 1 to 24.
|
||||
@@ -491,6 +534,10 @@ Example: F10.
|
||||
.RE
|
||||
|
||||
Rebinding \fB^M\fR (Enter) or \fB^I\fR (Tab) is probably not a good idea.
|
||||
Rebinding \fB^[\fR (Esc) is not possible, because its keycode
|
||||
is the starter byte of Meta keystrokes and escape sequences.
|
||||
Rebinding any of the dedicated cursor-moving keys (the arrows, Home, End,
|
||||
PageUp and PageDown) is not possible.
|
||||
On some terminals it's not possible to rebind \fB^H\fR (unless \fB\-\-raw\fR
|
||||
is used) because its keycode is identical to that of the Backspace key.
|
||||
|
||||
@@ -505,7 +552,7 @@ Invokes the help viewer.
|
||||
Cancels the current command.
|
||||
.TP
|
||||
.B exit
|
||||
Exits from the program (or from the help viewer or the file browser).
|
||||
Exits from the program (or from the help viewer or file browser).
|
||||
.TP
|
||||
.B writeout
|
||||
Writes the current buffer to disk, asking for a name.
|
||||
@@ -552,7 +599,7 @@ Throws away the current line (or the marked region).
|
||||
Deletes from the cursor position to the beginning of the preceding word.
|
||||
(This function is bound by default to <Shift+Ctrl+Delete>. If your terminal
|
||||
produces \fB^H\fR for <Ctrl+Backspace>, you can make <Ctrl+Backspace> delete
|
||||
the word to the left of the cursor by rebinding ^H to this function.)
|
||||
the word to the left of the cursor by rebinding \fB^H\fR to this function.)
|
||||
.TP
|
||||
.B chopwordright
|
||||
Deletes from the cursor position to the beginning of the next word.
|
||||
@@ -565,12 +612,18 @@ Cuts all text from the cursor position till the end of the buffer.
|
||||
Sets the mark at the current position, to start selecting text.
|
||||
Or, when it is set, unsets the mark.
|
||||
.TP
|
||||
.B curpos
|
||||
Shows the current cursor position: the line, column, and character positions.
|
||||
.B location
|
||||
Reports the current position of the cursor in the buffer:
|
||||
the line, column, and character positions.
|
||||
(The old name of this function, 'curpos', is deprecated.)
|
||||
.TP
|
||||
.B wordcount
|
||||
Counts the number of words, lines and characters in the current buffer.
|
||||
.TP
|
||||
.B execute
|
||||
Prompts for a program to execute. The program's output will be inserted
|
||||
into the current buffer (or into a new buffer when \fBM-F\fR is toggled).
|
||||
.TP
|
||||
.B speller
|
||||
Invokes a spell-checking program, either the default \fBhunspell\fR or GNU
|
||||
\fBspell\fR, or the one defined by \fB\-\-speller\fR or \fBset speller\fR.
|
||||
@@ -624,6 +677,9 @@ while keeping the cursor in the same text position, if possible.
|
||||
Scrolls the viewport down one row (meaning that the text slides up)
|
||||
while keeping the cursor in the same text position, if possible.
|
||||
.TP
|
||||
.B center
|
||||
Scrolls the line with the cursor to the middle of the screen.
|
||||
.TP
|
||||
.B prevword
|
||||
Moves the cursor to the beginning of the previous word.
|
||||
.TP
|
||||
@@ -669,6 +725,15 @@ from the end of the file (and end of the line).
|
||||
Moves the cursor to the bracket (brace, parenthesis, etc.) that matches
|
||||
(pairs) with the one under the cursor.
|
||||
.TP
|
||||
.B anchor
|
||||
Places an anchor at the current line, or removes it when already present.
|
||||
.TP
|
||||
.B prevanchor
|
||||
Goes to the first anchor before the current line.
|
||||
.TP
|
||||
.B nextanchor
|
||||
Goes to the first anchor after the current line.
|
||||
.TP
|
||||
.B prevbuf
|
||||
Switches to editing/viewing the previous buffer when multiple buffers are open.
|
||||
.TP
|
||||
@@ -708,7 +773,7 @@ Refreshes the screen.
|
||||
.TP
|
||||
.B suspend
|
||||
Suspends the editor (if the suspending function is enabled, see the
|
||||
"suspendenable" entry below).
|
||||
\fBsuspendable\fR toggle item below).
|
||||
.TP
|
||||
.B casesens
|
||||
Toggles whether searching/replacing ignores or respects the case of
|
||||
@@ -764,24 +829,27 @@ When writing a file, creates a backup of the current file.
|
||||
.TP
|
||||
.B discardbuffer
|
||||
When about to write a file, discard the current buffer without saving.
|
||||
(This function is bound by default only when option \fB\-\-tempfile\fR
|
||||
(This function is bound by default only when option \fB\-\-saveonexit\fR
|
||||
is in effect.)
|
||||
.TP
|
||||
.B browser
|
||||
Starts the file browser, allowing to select a file from a list.
|
||||
Starts the file browser (in the Read File and Write Out menus),
|
||||
allowing to select a file from a list.
|
||||
.TP
|
||||
.B gotodir
|
||||
Goes to a directory to be specified, allowing to browse anywhere
|
||||
in the filesystem.
|
||||
.TP
|
||||
.B firstfile
|
||||
Goes to the first file when using the file browser (reading or writing files).
|
||||
Goes to the first file in the list when using the file browser.
|
||||
.TP
|
||||
.B lastfile
|
||||
Goes to the last file when using the file browser (reading or writing files).
|
||||
Goes to the last file in the list when using the file browser.
|
||||
.TP
|
||||
.B nohelp
|
||||
Toggles the presence of the two-line list of key bindings at the bottom of the screen.
|
||||
(This toggle is special: it is available in all menus except the help viewer
|
||||
and the linter. All further toggles are available in the main menu only.)
|
||||
.TP
|
||||
.B constantshow
|
||||
Toggles the constant display of the current line, column, and character positions.
|
||||
@@ -819,8 +887,10 @@ Toggles whether typed tabs will be converted to spaces.
|
||||
.B mouse
|
||||
Toggles mouse support.
|
||||
.TP
|
||||
.B suspendenable
|
||||
Toggles whether the suspend sequence (normally ^Z) will suspend the editor window.
|
||||
.B suspendable
|
||||
Toggles whether the suspend keystroke (\fB^Z\fR by default)
|
||||
will actually suspend the editor.
|
||||
(The old name of this function, 'suspendenable', is deprecated.)
|
||||
.RE
|
||||
|
||||
.TP
|
||||
@@ -830,6 +900,9 @@ Valid \fImenu\fP sections are:
|
||||
.B main
|
||||
The main editor window where text is entered and edited.
|
||||
.TP
|
||||
.B help
|
||||
The help-viewer menu.
|
||||
.TP
|
||||
.B search
|
||||
The search menu (AKA whereis).
|
||||
.TP
|
||||
@@ -851,20 +924,9 @@ The 'write file' menu.
|
||||
.B insert
|
||||
The 'insert file' menu.
|
||||
.TP
|
||||
.B extcmd
|
||||
The menu for inserting output from an external command, reached from the insert menu.
|
||||
.TP
|
||||
.B help
|
||||
The help-viewer menu.
|
||||
.TP
|
||||
.B spell
|
||||
The menu of the integrated spell checker where the user can edit a misspelled word.
|
||||
.TP
|
||||
.B linter
|
||||
The linter menu.
|
||||
.TP
|
||||
.B browser
|
||||
The file browser for inserting or writing a file.
|
||||
The 'file browser' menu, for selecting a file to be opened or
|
||||
inserted or written to.
|
||||
.TP
|
||||
.B whereisfile
|
||||
The 'search for a file' menu in the file browser.
|
||||
@@ -872,6 +934,18 @@ The 'search for a file' menu in the file browser.
|
||||
.B gotodir
|
||||
The 'go to directory' menu in the file browser.
|
||||
.TP
|
||||
.B execute
|
||||
The menu for inserting the output from an external command,
|
||||
or for filtering the buffer (or the marked region) through
|
||||
an external command, or for executing one of several tools.
|
||||
(The old form of this menu name, 'extcmd', is deprecated.)
|
||||
.TP
|
||||
.B spell
|
||||
The menu of the integrated spell checker where the user can edit a misspelled word.
|
||||
.TP
|
||||
.B linter
|
||||
The linter menu, which allows jumping through the linting messages.
|
||||
.TP
|
||||
.B all
|
||||
A special name that encompasses all menus.
|
||||
For \fBbind\fR it means all menus where the specified \fIfunction\fR exists;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" Copyright (C) 2002-2007, 2014-2019 Free Software Foundation, Inc.
|
||||
.\" Copyright (C) 2002-2007, 2014-2020 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:
|
||||
@@ -16,7 +16,7 @@
|
||||
.\" Documentation License along with this program. If not, see
|
||||
.\" <https://www.gnu.org/licenses/>.
|
||||
.\"
|
||||
.TH RNANO 1 "version 4.6" "November 2019"
|
||||
.TH RNANO 1 "version 5.0" "July 2020"
|
||||
|
||||
.SH NAME
|
||||
rnano \- a restricted nano
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
## Sample initialization file for GNU nano.
|
||||
##
|
||||
## This file should not be in DOS or Mac format, and characters
|
||||
## specially interpreted by the shell should not be escaped here.
|
||||
## For the options that take parameters, the default value is shown.
|
||||
## Other options are unset by default. To make sure that an option
|
||||
## is disabled, you can use "unset <option>".
|
||||
##
|
||||
## To make sure an option is disabled, use "unset <option>".
|
||||
##
|
||||
## For the options that take parameters, the default value is given.
|
||||
## Other options are unset by default.
|
||||
##
|
||||
## Inside string parameters, quotes should not be escaped. The last
|
||||
## Characters that are special in a shell should not be escaped here.
|
||||
## Inside string parameters, quotes should not be escaped -- the last
|
||||
## double quote on the line will be seen as the closing quote.
|
||||
|
||||
## Make the 'nextword' function (Ctrl+Right) stop at word ends
|
||||
## instead of at beginnings.
|
||||
## Make 'nextword' (Ctrl+Right) and 'chopwordright' (Ctrl+Delete)
|
||||
## stop at word ends instead of at beginnings.
|
||||
# set afterends
|
||||
|
||||
## When soft line wrapping is enabled, make it wrap lines at blanks
|
||||
@@ -33,6 +30,9 @@
|
||||
## Use bold text instead of reverse video text.
|
||||
# set boldtext
|
||||
|
||||
## Treat any line with leading whitespace as the beginning of a paragraph.
|
||||
# set bookstyle
|
||||
|
||||
## The characters treated as closing brackets when justifying paragraphs.
|
||||
## This may not include any blank characters. Only closing punctuation,
|
||||
## optionally followed by these closing brackets, can end sentences.
|
||||
@@ -54,14 +54,17 @@
|
||||
## Do not use the line below the title bar, leaving it entirely blank.
|
||||
# set emptyline
|
||||
|
||||
## Enable hard-wrapping and set the target width, both for automatic
|
||||
## line wrapping and for justifying paragraphs. If the value is 0 or
|
||||
## less, the wrapping point will be the screen width minus this number.
|
||||
## Set the target width for automatic hard-wrapping and for justifying
|
||||
## paragraphs. If the specified value is 0 or less, the wrapping point
|
||||
## will be the terminal's width minus this number.
|
||||
# set fill -8
|
||||
|
||||
## Remember the used search/replace strings for the next session.
|
||||
# set historylog
|
||||
|
||||
## Display a "scrollbar" on the righthand side of the edit window.
|
||||
# set indicator
|
||||
|
||||
## Scroll the buffer contents per half-screen instead of per line.
|
||||
# set jumpyscrolling
|
||||
|
||||
@@ -133,6 +136,10 @@
|
||||
## Regular expressions are of the extended type (ERE).
|
||||
# set regexp
|
||||
|
||||
## Save a changed buffer automatically on exit; don't prompt.
|
||||
# set saveonexit
|
||||
## (The old form of this option, 'set tempfile', is deprecated.)
|
||||
|
||||
## Put the cursor on the highlighted item in the file browser, and show
|
||||
## the cursor in the help viewer; useful for people who use a braille
|
||||
## display and people with poor vision.
|
||||
@@ -145,15 +152,16 @@
|
||||
## beginning of the line.
|
||||
# set smarthome
|
||||
|
||||
## Enable soft line wrapping (AKA full-line display).
|
||||
## Spread overlong lines over multiple screen lines.
|
||||
# set softwrap
|
||||
|
||||
## Use this spelling checker instead of the internal one. This option
|
||||
## does not have a default value.
|
||||
# set speller "aspell -x -c"
|
||||
|
||||
## Allow nano to be suspended.
|
||||
# set suspend
|
||||
## Allow nano to be suspended (with ^Z by default).
|
||||
# set suspendable
|
||||
## (The old form of this option, 'set suspend', is deprecated.)
|
||||
|
||||
## Use this tab size instead of the default; it must be greater than 0.
|
||||
# set tabsize 8
|
||||
@@ -161,9 +169,6 @@
|
||||
## Convert typed tabs to spaces.
|
||||
# set tabstospaces
|
||||
|
||||
## Save automatically on exit; don't prompt.
|
||||
# set tempfile
|
||||
|
||||
## Snip whitespace at the end of lines when justifying or hard-wrapping.
|
||||
# set trimblanks
|
||||
|
||||
@@ -193,56 +198,38 @@
|
||||
|
||||
## Paint the interface elements of nano. These are examples;
|
||||
## by default there are no colors, except for errorcolor.
|
||||
# set titlecolor brightwhite,blue
|
||||
# set statuscolor brightwhite,green
|
||||
# set errorcolor brightwhite,red
|
||||
# set selectedcolor brightwhite,magenta
|
||||
# set titlecolor bold,lightwhite,blue
|
||||
# set statuscolor bold,lightwhite,green
|
||||
# set errorcolor bold,lightwhite,red
|
||||
# set selectedcolor lightwhite,magenta
|
||||
# set stripecolor ,yellow
|
||||
# set numbercolor cyan
|
||||
# set keycolor cyan
|
||||
# set functioncolor green
|
||||
## In root's .nanorc you might want to use:
|
||||
# set titlecolor brightwhite,magenta
|
||||
# set statuscolor brightwhite,magenta
|
||||
# set errorcolor brightwhite,red
|
||||
# set selectedcolor brightwhite,cyan
|
||||
# set titlecolor bold,lightwhite,magenta
|
||||
# set statuscolor bold,lightwhite,magenta
|
||||
# set errorcolor bold,lightwhite,red
|
||||
# set selectedcolor lightwhite,cyan
|
||||
# set stripecolor ,yellow
|
||||
# set numbercolor magenta
|
||||
# set keycolor brightmagenta
|
||||
# set keycolor lightmagenta
|
||||
# set functioncolor magenta
|
||||
|
||||
|
||||
## Setup of syntax coloring.
|
||||
##
|
||||
## syntax "name" ["filename regex" ...]
|
||||
##
|
||||
## color|icolor foreground,background "regex" ["regex"...]
|
||||
## [...]
|
||||
##
|
||||
## 'color' will do case-sensitive matches, while 'icolor' will do
|
||||
## case-insensitive matches.
|
||||
##
|
||||
## All color commands are applied in the order in which they are specified,
|
||||
## meaning that later commands can recolor stuff that was colored earlier.
|
||||
##
|
||||
## Valid color names for foreground and background are: white, black, normal,
|
||||
## red, blue, green, yellow, magenta, cyan. For foreground colors, you may
|
||||
## use the prefix "bright" to get a stronger highlight.
|
||||
##
|
||||
## All regexes (regular expressions) are of the extended type (ERE).
|
||||
##
|
||||
## If the coloring rule should span multiple lines, use the following format:
|
||||
##
|
||||
## color fg,bg start="regex" end="regex"
|
||||
##
|
||||
## If you wish, you may put your syntax definitions in separate files.
|
||||
## You can make use of such files as follows:
|
||||
##
|
||||
## include "/path/to/syntax_file.nanorc"
|
||||
## === Syntax coloring ===
|
||||
## For all details, see 'man nanorc', section SYNTAX HIGHLIGHTING.
|
||||
|
||||
## To include all existing syntax definitions, you can do:
|
||||
# include "@PKGDATADIR@/*.nanorc"
|
||||
|
||||
## Or you can select just the ones you need. For example:
|
||||
# include "@PKGDATADIR@/html.nanorc"
|
||||
# include "@PKGDATADIR@/python.nanorc"
|
||||
# include "@PKGDATADIR@/sh.nanorc"
|
||||
|
||||
## In @PKGDATADIR@/extra/ you can find some syntaxes that are
|
||||
## specific for certain distros or for less common languages.
|
||||
|
||||
## If <Tab> should always produce four spaces when editing a Python file,
|
||||
## independent of the settings of 'tabsize' and 'tabstospaces':
|
||||
@@ -252,8 +239,8 @@
|
||||
# extendsyntax makefile tabgives " "
|
||||
|
||||
|
||||
## Key bindings.
|
||||
## See nanorc(5) (section REBINDING KEYS) for more details on this.
|
||||
## === Key bindings ===
|
||||
## For all details, see 'man nanorc', section REBINDING KEYS.
|
||||
|
||||
## The <Ctrl+Delete> keystroke deletes the word to the right of the cursor.
|
||||
## On some terminals the <Ctrl+Backspace> keystroke produces ^H, which is
|
||||
@@ -268,6 +255,9 @@
|
||||
## such as ^O for Open, ^F for Find, ^H for Help, and ^Q for Quit,
|
||||
## then uncomment these:
|
||||
#bind ^Q exit all
|
||||
#bind ^S savefile main
|
||||
#bind ^W writeout main
|
||||
#bind ^O insert main
|
||||
#bind ^H help all
|
||||
#bind ^H exit help
|
||||
#bind ^F whereis all
|
||||
@@ -275,23 +265,23 @@
|
||||
#bind ^B wherewas all
|
||||
#bind ^D findprevious all
|
||||
#bind ^R replace main
|
||||
#bind ^W writeout main
|
||||
#bind ^O insert main
|
||||
#unbind ^V all
|
||||
#unbind ^Y all
|
||||
#bind M-X flipnewbuffer all
|
||||
#bind ^X cut all
|
||||
#bind ^C copy all
|
||||
#bind ^C copy main
|
||||
#bind ^V paste all
|
||||
#bind ^P curpos main
|
||||
#bind ^P location main
|
||||
#bind ^A mark main
|
||||
#unbind ^K main
|
||||
#unbind ^U all
|
||||
#unbind ^N main
|
||||
#unbind ^Y all
|
||||
#unbind M-J main
|
||||
#unbind M-T main
|
||||
#bind ^T gotoline main
|
||||
#bind ^T gotodir browser
|
||||
#bind ^Y speller main
|
||||
#unbind ^K all
|
||||
#unbind ^U all
|
||||
#bind M-U undo main
|
||||
#bind M-R redo main
|
||||
#bind ^U undo main
|
||||
#bind ^E redo main
|
||||
#unbind M-J main
|
||||
#unbind M-T main
|
||||
#set multibuffer
|
||||
|
||||
29
m4/ChangeLog
29
m4/ChangeLog
@@ -1,29 +0,0 @@
|
||||
2002-08-21 gettextize <bug-gnu-gettext@gnu.org>
|
||||
|
||||
* gettext.m4: Upgrade to gettext-0.11.5.
|
||||
* ulonglong.m4: New file, from gettext-0.11.5.
|
||||
* iconv.m4: Upgrade to gettext-0.11.5.
|
||||
* intdiv0.m4: New file, from gettext-0.11.5.
|
||||
* inttypes.m4: New file, from gettext-0.11.5.
|
||||
* inttypes_h.m4: New file, from gettext-0.11.5.
|
||||
* inttypes-pri.m4: New file, from gettext-0.11.5.
|
||||
* lcmessage.m4: Upgrade to gettext-0.11.5.
|
||||
* lib-link.m4: Upgrade to gettext-0.11.5.
|
||||
* stdint_h.m4: New file, from gettext-0.11.5.
|
||||
* uintmax_t.m4: New file, from gettext-0.11.5.
|
||||
* Makefile.am (EXTRA_DIST): Add the new files.
|
||||
|
||||
2002-06-03 gettextize <bug-gnu-gettext@gnu.org>
|
||||
|
||||
* codeset.m4: Upgrade to gettext-0.11.2.
|
||||
* gettext.m4: Upgrade to gettext-0.11.2.
|
||||
* glibc21.m4: Upgrade to gettext-0.11.2.
|
||||
* iconv.m4: Upgrade to gettext-0.11.2.
|
||||
* isc-posix.m4: New file, from gettext-0.11.2.
|
||||
* lcmessage.m4: Upgrade to gettext-0.11.2.
|
||||
* lib-ld.m4: New file, from gettext-0.11.2.
|
||||
* lib-link.m4: New file, from gettext-0.11.2.
|
||||
* lib-prefix.m4: New file, from gettext-0.11.2.
|
||||
* progtest.m4: Upgrade to gettext-0.11.2.
|
||||
* Makefile.am (EXTRA_DIST): Add the new files.
|
||||
|
||||
53
nano.spec.in
53
nano.spec.in
@@ -1,53 +0,0 @@
|
||||
%define name @PACKAGE@
|
||||
%define version @VERSION@
|
||||
%define release 1
|
||||
|
||||
Name : %{name}
|
||||
Version : %{version}
|
||||
Release : %{release}
|
||||
Summary : a user-friendly editor, a Pico clone with enhancements
|
||||
|
||||
License : GPLv3+
|
||||
Group : Applications/Editors
|
||||
URL : https://nano-editor.org/
|
||||
Source : https://nano-editor.org/dist/latest/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRoot : %{_tmppath}/%{name}-%{version}-root
|
||||
BuildRequires : autoconf, automake, gettext-devel, ncurses-devel, texinfo
|
||||
Requires(post) : info
|
||||
Requires(preun) : info
|
||||
|
||||
%description
|
||||
GNU nano is a small and friendly text editor. It aims to emulate the
|
||||
Pico text editor while also offering several enhancements.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%configure
|
||||
make
|
||||
|
||||
%install
|
||||
make DESTDIR="%{buildroot}" install
|
||||
#ln -s nano %{buildroot}/%{_bindir}/pico
|
||||
rm -f %{buildroot}/%{_infodir}/dir
|
||||
|
||||
%post
|
||||
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
|
||||
%preun
|
||||
if [ $1 = 0 ] ; then
|
||||
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS TODO doc/faq.html doc/sample.nanorc
|
||||
%{_bindir}/*
|
||||
%{_docdir}/nano/*
|
||||
%{_mandir}/man*/*
|
||||
%{_mandir}/fr/man*/*
|
||||
%{_infodir}/nano.info*
|
||||
%{_datadir}/locale/*/LC_MESSAGES/nano.mo
|
||||
%{_datadir}/nano/*
|
||||
998
po/ChangeLog
998
po/ChangeLog
@@ -1,998 +0,0 @@
|
||||
2014-05-28 Benno Schulenberg <bensberg@justemail.net>
|
||||
* de.po, eo.po, nl.po: Updates for German, Dutch, and Esperanto.
|
||||
|
||||
2014-05-27 Benno Schulenberg <bensberg@justemail.net>
|
||||
* de.po, nl.po, ru.po: Updates for Russian, Dutch, and German.
|
||||
|
||||
2014-05-25 Benno Schulenberg <bensberg@justemail.net>
|
||||
* it.po, uk.po: Updates from the TP for Ukrainian and Italian.
|
||||
|
||||
2014-05-22 Benno Schulenberg <bensberg@justemail.net>
|
||||
* de.po, uk.po: Updates from the TP for German and Ukrainian.
|
||||
|
||||
2014-05-16 Benno Schulenberg <bensberg@justemail.net>
|
||||
* eo.po, fi.po, fr.po, nl.po, vi.po: Updates from the TP for
|
||||
Vietnamese, Finnish, Dutch, French, and Esperanto.
|
||||
|
||||
2014-05-13 Benno Schulenberg <bensberg@justemail.net>
|
||||
* nano.pot, *.po: Regenerated the POT file and refreshed the PO's.
|
||||
|
||||
2014-03-22 Benno Schulenberg <bensberg@justemail.net>
|
||||
* nano.pot: Regenerated the POT file.
|
||||
* cs.po, es.po, it.po, nb.po, sr.po, zh_TW: Updates from the TP
|
||||
for Czech, Spanish, Italian, Norwegian, Serbian, and Chinese.
|
||||
* LINGUAS: Removed rw (Kinyarwanda) -- it was just fragments.
|
||||
|
||||
2007-12-09 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* LINGUAS: Add zh_CN.
|
||||
* es.po, fr.po, it.po, nb.po, nl.po, pt_BR.po: New pull from the TP,
|
||||
to fetch the now corrected latest pt_BR file.
|
||||
|
||||
2007-12-08 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* zh_CN.po: New Simplified Chinese translation by
|
||||
LI Daobing <lidaobing@gmail.com>.
|
||||
* fr.po, ga.po, ms.po, nl.po, nn.po, vi.po: Translation updates taken
|
||||
from the Translation Project.
|
||||
* Refreshed the rest of the files from the latest TP archive.
|
||||
|
||||
2007-09-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* po/ru.po: Updated Russian translation by Sergey A. Ribalchenko.
|
||||
|
||||
2007-08-11 David Lawrence Ramsey <pooka109@gmail.com>
|
||||
|
||||
* po/update.pl: Relicense to the GNU GPL version 3 or later.
|
||||
|
||||
2007-07-31 David Lawrence Ramsey <pooka109@gmail.com>
|
||||
|
||||
* po/update.pl: Update copyright notice to account for
|
||||
modifications.
|
||||
|
||||
2007-01-29 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* ru.po: Updated Russian translation by Dimitriy Ryazantcev.
|
||||
* ru.po: Fix incorrect "Project-Id-Version" entry and misplaced
|
||||
space.
|
||||
|
||||
2007-01-13 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* es.po: Fix misplaced space.
|
||||
* eu.po: Fix typos and misplaced space.
|
||||
* fr.po: Fix misplaced space.
|
||||
* gl.po: Fix typos and misplaced space.
|
||||
* nb.po: Fix typos and more misplaced space.
|
||||
|
||||
2007-01-06 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* nb.po: Fix misplaced space.
|
||||
|
||||
2006-12-06 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* hu.po: Removed unneeded duplicate plural forms again.
|
||||
* ms.po: Fix incorrect "Project-Id-Version" entry.
|
||||
|
||||
2006-12-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* hu.po: Updated Hungarian translation by Gabor Kelemen.
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2006-11-20 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* tr.po: Removed unneeded blank plural forms, as gettext 0.15
|
||||
generates errors upon encountering them.
|
||||
|
||||
2006-10-25 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* nb.po: Updated Norwegian bokmål translation by
|
||||
Geir Helland.
|
||||
|
||||
2006-10-16 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* gl.po: Updated Galician translation by
|
||||
Francisco Javier Tsao Santín.
|
||||
|
||||
2006-10-16 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* eu.po: Updated Basque translation by Mikel Olasagasti.
|
||||
|
||||
2006-10-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* gl.po: Updated Galician translation by
|
||||
Francisco Javier Tsao Santín.
|
||||
|
||||
2006-10-02 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pt_BR.po: Refetch the current nano 1.9.99pre0 pt_BR file from
|
||||
the TP, as the latest file offered is apparently for 1.3.11pre1.
|
||||
|
||||
2006-10-02 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* pt_BR.po: Restore previous version of pt_BR, as it was for
|
||||
nano 1.9.99pre0, and the current version is for 1.3.11pre1.
|
||||
|
||||
2006-09-27 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pt_BR.po: Updated Brazilian Portuguese translation by
|
||||
Joao Victor Duarte Martins.
|
||||
|
||||
2006-09-10 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* hu.po: Removed unneeded duplicate plural forms again.
|
||||
|
||||
2006-09-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* hu.po: Updated Hungarian translation by Gabor Kelemen.
|
||||
|
||||
2006-09-02 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pt_BR.po: Updated Brazilian Portuguese translation by
|
||||
Joao Victor Duarte Martins.
|
||||
|
||||
2006-09-01 Benno Schulenberg <bensberg@justemail.net>
|
||||
|
||||
* ChangeLog: Fix incorrect years in two entries.
|
||||
|
||||
2006-08-31 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* bg.po: Fix misplaced space.
|
||||
|
||||
2006-08-31 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
* es.po: Updated Spanish translation by
|
||||
Ricardo Javier Cardenes Medina.
|
||||
|
||||
2006-08-28 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2006-08-25 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* bg.po: Updated Bulgarian translation by Anton Zinoviev.
|
||||
* ca.po: Updated Catalan translation.
|
||||
* ga.po: Updated Irish translation by Kevin Patrick Scannell.
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* nl.po: Updated Dutch translation by Benno Schulenberg.
|
||||
* sv.po: Updated Swedish translation by Daniel Nylander.
|
||||
|
||||
2006-08-15 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* hu.po: Removed unneeded duplicate plural forms, as gettext
|
||||
0.15 generates errors upon encountering them.
|
||||
* id.po: Removed unneeded duplicate plural forms, as gettext
|
||||
0.15 generates errors upon encountering them.
|
||||
|
||||
2006-06-20 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* hu.po: Updated Hungarian translation by Gabor Kelemen.
|
||||
* nl.po: Updated Dutch translation by Benno Schulenberg.
|
||||
|
||||
2006-06-20 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* fr.po: Fix incorrect "Project-Id-Version" entry.
|
||||
* hu.po: Fix incorrect "Project-Id-Version" entry.
|
||||
* it.po: Fix incorrect "Project-Id-Version" entry.
|
||||
|
||||
2006-06-19 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* bg.po: Updated Bulgarian translation by Anton Zinoviev.
|
||||
* ga.po: Updated Irish translation by Kevin Patrick Scannell.
|
||||
|
||||
2006-06-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* hu.po: Updated Hungarian translation by Gabor Kelemen.
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* nl.po: Updated Dutch translation by Benno Schulenberg.
|
||||
|
||||
2006-06-12 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* hu.po: Updated Hungarian translation by Gabor Kelemen.
|
||||
|
||||
2006-06-09 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* ga.po: Updated Irish translation by Kevin Patrick Scannell.
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* nl.po: Updated Dutch translation by Benno Schulenberg.
|
||||
|
||||
2006-05-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* LINGUAS: Added "ga".
|
||||
* ga.po: New Irish translation by
|
||||
Kevin Patrick Scannell <scannell@SLU.EDU>.
|
||||
|
||||
2006-05-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* nl.po: Updated Dutch translation by Benno Schulenberg.
|
||||
|
||||
2006-03-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* sv.po: Updated Swedish translation by Daniel Nylander.
|
||||
|
||||
2006-03-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Vietnamese translation by
|
||||
Phan Vinh Thinh.
|
||||
|
||||
2005-12-21 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* bg.po: Updated Bulgarian translation by Anton Zinoviev.
|
||||
* ca.po: Updated Catalan translation.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
* zh_TW: Updated Traditional Chinese translation by
|
||||
Wei-Lun Chao.
|
||||
|
||||
2005-12-13 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
* nl.po: Updated Dutch translation by Benno Schulenberg.
|
||||
|
||||
2005-11-08 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* POTFILES.in: Add prompt.c.
|
||||
|
||||
2005-11-05 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* POTFILES.in: Add browser.c.
|
||||
|
||||
2005-11-01 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* POTFILES.in: Add help.c.
|
||||
|
||||
2005-10-23 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* eu.po: Updated Basque translation by Mikel Olasagasti.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
* nl.po: Updated Dutch translation by Benno Schulenberg.
|
||||
* zh_TW: Updated Traditional Chinese translation by
|
||||
Wei-Lun Chao.
|
||||
|
||||
2005-08-22 Jordi Mallach <jordi@gnu.org>
|
||||
* bg.po: New Bulgarian translation by
|
||||
Yavor Doganov <yavor@doganov.org>.
|
||||
|
||||
* LINGUAS: Added "bg".
|
||||
|
||||
2005-08-16 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
2005-08-16 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* nl.po: Updated Dutch translation by
|
||||
Benno Schulenberg and Reinout van Schouwen.
|
||||
|
||||
2005-07-24 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* POTFILES.in: Add text.c.
|
||||
|
||||
2005-07-19 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2005-07-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2005-07-07 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
2005-06-28 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* POTFILES.in: Remove source files that contain no translatable
|
||||
strings.
|
||||
|
||||
2005-06-19 David Lawrence Ramsey <pooka109@cox.net>
|
||||
|
||||
* pt_BR.po: Typo fix.
|
||||
|
||||
2005-06-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* de.po: Typo fix by Jens Seidel.
|
||||
|
||||
2005-05-23 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2005-04-27 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2005-04-22 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* nb.po: Updated Norwegian bokmål translation by
|
||||
Geir Helland.
|
||||
|
||||
2005-04-20 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
* ro.po: Updated Romanian translation by Laurentiu Buzdugan.
|
||||
* zh_TW.po: Updated Traditional Chinese translation by
|
||||
CHAO Wei-Lun.
|
||||
|
||||
2005-04-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* vi.po: Updated Vietnamese translation by Phan Vinh Thinh.
|
||||
|
||||
2005-04-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* ro.po: Updated Romanian translation by Laurentiu Buzdugan.
|
||||
|
||||
2005-04-14 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* es.po: Updated Spanish translation by
|
||||
Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2005-04-13 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* vi.po: New Vietnamese translation by Phan Vinh Thinh.
|
||||
* LINGUAS: Added "vi".
|
||||
|
||||
2005-04-09 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* zh_TW.po: Added Plural-Forms header and fix format specification
|
||||
typos.
|
||||
|
||||
2005-04-08 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* zh_TW.po: Updated Traditional Chinese translation by
|
||||
CHAO Wei-Lun.
|
||||
|
||||
2005-04-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* rw.po: New Kinyarwanda translation by Steve Murphy.
|
||||
* LINGUAS: Added "rw".
|
||||
|
||||
2005-04-05 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
* ro.po: Updated Romanian translation by
|
||||
Laurentiu Buzdugan.
|
||||
|
||||
2005-03-11 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2005-01-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pt_BR.po: Updated Brazilian Portuguese translation by
|
||||
Joao Victor Duarte Martins.
|
||||
|
||||
2004-12-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
|
||||
2004-12-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* sv.po: Updated Swedish translation by Christian Rose.
|
||||
|
||||
2004-12-13 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* sv.po: Updated Swedish translation by Christian Rose.
|
||||
|
||||
2004-12-07 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* it.po: Updated Italian translation by
|
||||
Marco Colombo.
|
||||
* ro.po: Updated Romanian translation by
|
||||
Laurentiu Buzdugan.
|
||||
|
||||
2004-12-01 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* nb: Updated Norwegian bokmål translation by
|
||||
Geir Helland.
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2004-11-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2004-11-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2004-10-07 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* eu.po: Updated Basque translation by
|
||||
Mikel Olasagasti.
|
||||
|
||||
2004-08-31 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* es.po: Updated Spanish translation by
|
||||
Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2004-08-31 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated Catalan translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2004-08-27 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
|
||||
2004-06-01 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* zh_TW.po: Added Traditional Chinese translation by
|
||||
CHAO Wei-Lun <chaoweilun@pcmail.com.tw>.
|
||||
* LINGUAS: Added "zh_TW".
|
||||
|
||||
2004-02-24 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2003-11-25 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ro.po: Updated Romanian translation by Laurentiu Buzdugan.
|
||||
|
||||
2003-11-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* sr.po: Added Serbian translation by Danilo Segan <dsegan@gmx.net>.
|
||||
* LINGUAS: Added "sr" (Serbian), and alphabetize.
|
||||
* ChangeLog: Recoded as UTF-8.
|
||||
|
||||
2003-10-30 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fi.po: Patch from Martin-Eric Racine <q-funk@pp.fishpool.fi>
|
||||
to accept "Yy" and "Nn" as well as the Finnish letters in Yes/No
|
||||
prompts.
|
||||
|
||||
2003-10-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
2003-09-12 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* POTFILES.in: Updated path to sources.
|
||||
|
||||
2003-09-01 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-08-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* tr.po: Updated Turkish translation by A. Murat EREN.
|
||||
|
||||
2003-08-05 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
2003-06-11 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* nb.po: Updated Norwegian bokmål translation by Geir Helland.
|
||||
|
||||
2003-06-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-06-02 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
|
||||
2003-05-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2003-04-24 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ro.po: New Romanian translation by Laurentiu Buzdugan.
|
||||
* id.po: Updated Indonesian translation by Tedi Heriyanto.
|
||||
* LINGUAS: Added "ro" (Romanian).
|
||||
|
||||
2003-04-12 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2003-04-04 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-03-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2003-03-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* da.po: Updated Danish translation by Keld Simonsen.
|
||||
|
||||
2003-03-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
* id.po: Updated Indonesian translation by Tedi Heriyanto.
|
||||
|
||||
2003-02-23 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* nl.po: Updated Dutch translation by Guus Sliepen.
|
||||
|
||||
2003-02-19 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fi.po: Updated Finnish translation by Kalle Olavi Niemitalo.
|
||||
* es.po: Updated Spanish translation by Ricardo Javier Cárdenes
|
||||
Medina.
|
||||
|
||||
2003-02-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
* ru.po: Updated Russian translation by Sergey A. Ribalchenko.
|
||||
* uk.po: Updated Ukrainian translation by Sergey A. Ribalchenko.
|
||||
|
||||
2003-02-16 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* gl.po: Updated Galician translation by Jacobo Tarrío.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-02-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* nl.po: Updated Dutch translation by Guus Sliepen.
|
||||
* sv.po: Updated Swedish translation by Christian Rose.
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
2003-02-13 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ru.po: Updated Russian translation from Sergey A. Ribalchenko.
|
||||
|
||||
2003-02-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* Makevars (XGETTEXT_OPTIONS): Added --keyword=P_:1,2.
|
||||
* update.pl: likewise.
|
||||
* fi.po: Added Plural-Forms: header.
|
||||
|
||||
2003-02-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fi.po: Updated Finnish translation by Kalle Kivimaa and
|
||||
Kalle Olavi Niemitalo.
|
||||
|
||||
2003-02-08 Chris Allegretta <chrisa@asty.org>
|
||||
|
||||
* it.po: Fix broken format string in translation.
|
||||
|
||||
2003-02-08 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* gl.po: Updated Galician translation by Jacobo Tarrío.
|
||||
* es.po: Updated Spanish translation by Ricardo Javier Cárdenes
|
||||
Medina.
|
||||
|
||||
2003-02-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pl.po: Updated Polish translation by Wojciech Kotwica.
|
||||
* sv.po: Updated Swedish translation by Christian Rose.
|
||||
|
||||
2003-02-04 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* uk.po: Updated Ukrainian translation by Sergey A. Ribalchenko.
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
|
||||
2003-01-27 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2002-01-26 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-01-25 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
|
||||
2002-01-22 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2003-01-21 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
* uk.po: Updated translation by Sergey A. Ribalchenko.
|
||||
|
||||
2003-01-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* nl.po: Updated translation by Guus Sliepen.
|
||||
* ca.po: Updated translation.
|
||||
|
||||
2003-01-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* Makefile.in.in: Removed, generated by autopoint.
|
||||
* Rules-quot: Likewise.
|
||||
* boldquot.sed: Likewise.
|
||||
* en@boldquot.header: Likewise.
|
||||
* en@quot.header: Likewise.
|
||||
* insert-header.sin: Likewise.
|
||||
* quot.sed: Likewise.
|
||||
* remove-potcdate.sin: Likewise.
|
||||
|
||||
2003-01-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* LINGUAS: New file, exported values from configure.ac's ALL_LINGUAS.
|
||||
* it.po: Updated translation by Marco Colombo.
|
||||
* eu.po: New Basque translation by Peio Ziarsolo.
|
||||
|
||||
2002-12-14 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* tr.po: New Turkish translation by Doruk Fisek.
|
||||
|
||||
2002-11-10 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* uk.po: Updated translation by Sergey A. Ribalchenko.
|
||||
* da.po: Updated translation by Keld Simonsen.
|
||||
|
||||
2002-11-05 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2002-11-03 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-10-29 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-10-27 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-10-26 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2002-10-26 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* ca.po: Updated translation.
|
||||
|
||||
2002-10-17 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* de.po: Updated translation by Michel Piefel.
|
||||
|
||||
2002-10-14 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-10-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2002-10-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2002-10-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* de.po: Updated translation by Michel Piefel.
|
||||
|
||||
2002-10-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ca.po: Updated translation.
|
||||
|
||||
2002-10-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-09-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2002-09-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* da.po: Updated translation by Keld Simonsen.
|
||||
|
||||
2002-08-19 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2002-07-31 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
|
||||
2002-07-31 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2002-07-31 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-07-30 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
* sv.po: Upadted translation by Christian Rose.
|
||||
|
||||
2002-07-29 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ca.po: Updated translation.
|
||||
|
||||
2002-07-29 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
|
||||
2002-07-27 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* pt_BR.po: New Brazilian Portuguese translation by
|
||||
Claudio Neves.
|
||||
|
||||
2002-07-25 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
|
||||
2002-07-09 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2002-07-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* da.po: Updated translation by Keld Simonsen.
|
||||
|
||||
2002-07-03 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ms.po: New Bahasa Melayu translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2002-06-03 gettextize <bug-gnu-gettext@gnu.org>
|
||||
|
||||
* Makefile.in.in: Upgrade to gettext-0.11.2.
|
||||
* Rules-quot: New file, from gettext-0.11.2.
|
||||
* boldquot.sed: New file, from gettext-0.11.2.
|
||||
* en@boldquot.header: New file, from gettext-0.11.2.
|
||||
* en@quot.header: New file, from gettext-0.11.2.
|
||||
* insert-header.sin: New file, from gettext-0.11.2.
|
||||
* quot.sed: New file, from gettext-0.11.2.
|
||||
* remove-potcdate.sin: New file, from gettext-0.11.2.
|
||||
|
||||
2002-05-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2002-05-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* it.po: Updated translation by Marco Colombo.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* ca.po: Updated translation.
|
||||
* es.po: Updated translation.
|
||||
|
||||
2002-05-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
|
||||
2002-05-05 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
|
||||
2002-04-25 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
|
||||
2002-04-19 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ru.po: Updated translation by Sergey A. Ribalchenko.
|
||||
* uk.po: Updated translation by Sergey A. Ribalchenko.
|
||||
|
||||
2002-04-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* it.po: Updated translation by Marco Colombo.
|
||||
|
||||
2002-04-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* nl.po: Updated translation by Guus Sliepen.
|
||||
|
||||
2002-04-10 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
|
||||
2002-04-05 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrio.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* ca.po: Updated.
|
||||
* es.po: Updated.
|
||||
|
||||
2002-03-29 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* da.po: Updated translation by Keld Simonsen.
|
||||
|
||||
2002-03-27 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* it.po: Updated translation by Marco Colombo.
|
||||
|
||||
2002-03-25 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
|
||||
2002-03-17 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-03-15 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-03-14 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* uk.po, ru.po: Updated translations by Sergey A.
|
||||
Ribalchenko.
|
||||
|
||||
2002-03-12 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ca.po: Updated to current CVS.
|
||||
* es.po: Updated to current CVS.
|
||||
* gl.po: Updated translation to current CVS by Jacobo Tarrio.
|
||||
|
||||
2002-03-12 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrio.
|
||||
|
||||
2002-03-11 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-03-09 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
* ca.po: Updated.
|
||||
* es.po: Updated.
|
||||
|
||||
2002-03-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2002-03-05 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-02-20 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* nl.po: Updated translation by Guus Sliepen.
|
||||
|
||||
2002-02-15 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* nb.po: Updated translation by Stig E Sandoe.
|
||||
|
||||
2002-02-15 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* nb.po: Updated translation by Stig E Sandoe.
|
||||
|
||||
2002-02-14 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* da.po: Updated translation by Keld Simonsen.
|
||||
|
||||
2002-02-10 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* hu.po: Updated translation by Gergely Nagy.
|
||||
|
||||
2002-02-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* uk.po, ru.po: Updated translations by Sergey A.
|
||||
Ribalchenko.
|
||||
|
||||
2002-02-06 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* hu.po: Updated translation by Gergely Nagy.
|
||||
|
||||
2002-02-06 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* cs.po: Incomplete update by Václav Haisman.
|
||||
|
||||
2002-01-27 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* it.po: Updated translation by Marco Colombo.
|
||||
|
||||
2002-01-26 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* nn.po: Updated translation by Kjetil Torgrim Homme.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2002-01-25 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-01-25 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ca.po: Updated.
|
||||
* es.po: Updated.
|
||||
|
||||
2002-01-23 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ca.po: Updated.
|
||||
* es.po: Updated.
|
||||
|
||||
2002-01-19 gettextize <bug-gnu-utils@gnu.org>
|
||||
|
||||
* Makefile.in.in: Upgrade to gettext-0.10.40.
|
||||
* cat-id-tbl.c: Remove file.
|
||||
* stamp-cat-id: Remove file.
|
||||
|
||||
2002-01-19 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ca.po: Updated.
|
||||
* es.po: Updated.
|
||||
|
||||
2002-01-19 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* da.po: Updated translation by Keld Simonsen.
|
||||
|
||||
2002-01-17 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* no.po: Removed, replaced by nn.po.
|
||||
* nn.po: Updated translation by Kjetil Torgrim Homme.
|
||||
* nb.po: New Norwegian bokmål translation by Stig E Sandoe.
|
||||
|
||||
2002-01-12 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-01-10 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-01-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ru.po, uk.po: Updated translations by Sergey A.
|
||||
Ribalchenko.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-01-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2002-01-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
|
||||
2002-01-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ca.po: Updated.
|
||||
* es.po: Updated.
|
||||
1820
po/nano.pot
1820
po/nano.pot
File diff suppressed because it is too large
Load Diff
1834
po/pt_BR.po
1834
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
1766
po/zh_CN.po
1766
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
1839
po/zh_TW.po
1839
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION="4.6"
|
||||
VERSION="5.0"
|
||||
|
||||
./configure -C --enable-tiny && make && ./configure -C &&
|
||||
|
||||
@@ -22,6 +22,10 @@ gpg --verify nano-$VERSION.tar.xz.asc &&
|
||||
|
||||
git tag -u A0ACE884 -a v$VERSION -m "the nano $VERSION release" &&
|
||||
|
||||
make pdf && rm -rf doc/nano.t2p &&
|
||||
scp doc/nano.pdf bens@wh0rd.org:nano.pdf &&
|
||||
scp doc/cheatsheet.html bens@wh0rd.org:cheatsheet.html &&
|
||||
|
||||
for file in nano-$VERSION.tar.*z*; do scp $file bens@wh0rd.org:$file; done &&
|
||||
|
||||
gnupload --to ftp.gnu.org:nano nano-$VERSION.tar.*z &&
|
||||
|
||||
@@ -21,7 +21,10 @@ revision.h: FORCE
|
||||
FORCE:
|
||||
|
||||
bin_PROGRAMS = nano
|
||||
nano_SOURCES = browser.c \
|
||||
nano_SOURCES = \
|
||||
definitions.h \
|
||||
prototypes.h \
|
||||
browser.c \
|
||||
chars.c \
|
||||
color.c \
|
||||
cut.c \
|
||||
@@ -31,9 +34,7 @@ nano_SOURCES = browser.c \
|
||||
history.c \
|
||||
move.c \
|
||||
nano.c \
|
||||
nano.h \
|
||||
prompt.c \
|
||||
proto.h \
|
||||
rcfile.c \
|
||||
search.c \
|
||||
text.c \
|
||||
|
||||
197
src/browser.c
197
src/browser.c
@@ -1,7 +1,7 @@
|
||||
/**************************************************************************
|
||||
* browser.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 2001-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2001-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2015-2016 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
@@ -19,7 +19,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#ifdef ENABLE_BROWSER
|
||||
|
||||
@@ -39,24 +39,22 @@ static size_t longest = 0;
|
||||
static size_t selected = 0;
|
||||
/* The currently selected filename in the list; zero-based. */
|
||||
|
||||
/* Our main file browser function. path is the tilde-expanded path we
|
||||
* start browsing from. */
|
||||
char *do_browser(char *path)
|
||||
/* Allow the user to browse through the directories in the filesystem,
|
||||
* starting at the given path. */
|
||||
char *browse(char *path)
|
||||
{
|
||||
char *retval = NULL;
|
||||
int kbinput;
|
||||
char *present_name = NULL;
|
||||
/* The name of the currently selected file, or of the directory we
|
||||
* were in before backing up to "..". */
|
||||
size_t old_selected;
|
||||
/* The number of the selected file before the current selected file. */
|
||||
functionptrtype func;
|
||||
/* The function of the key the user typed in. */
|
||||
DIR *dir;
|
||||
/* The directory whose contents we are showing. */
|
||||
char *chosen = NULL;
|
||||
/* The name of the file that the user picked, or NULL if none. */
|
||||
|
||||
read_directory_contents:
|
||||
/* We come here when we refresh or select a new directory. */
|
||||
/* We come here when the user refreshes or selects a new directory. */
|
||||
|
||||
path = free_and_assign(path, get_full_path(path));
|
||||
|
||||
@@ -67,10 +65,10 @@ char *do_browser(char *path)
|
||||
statusline(ALERT, _("Cannot open directory: %s"), strerror(errno));
|
||||
/* If we don't have a file list yet, there is nothing to show. */
|
||||
if (filelist == NULL) {
|
||||
napms(1200);
|
||||
lastmessage = HUSH;
|
||||
free(path);
|
||||
lastmessage = VACUUM;
|
||||
free(present_name);
|
||||
free(path);
|
||||
napms(1200);
|
||||
return NULL;
|
||||
}
|
||||
path = mallocstrcpy(path, present_path);
|
||||
@@ -101,7 +99,10 @@ char *do_browser(char *path)
|
||||
titlebar(path);
|
||||
|
||||
while (TRUE) {
|
||||
lastmessage = HUSH;
|
||||
functionptrtype func;
|
||||
int kbinput;
|
||||
|
||||
lastmessage = VACUUM;
|
||||
|
||||
bottombars(MBROWSER);
|
||||
|
||||
@@ -138,30 +139,42 @@ char *do_browser(char *path)
|
||||
/* If we selected the same filename as last time, fake a
|
||||
* press of the Enter key so that the file is read in. */
|
||||
if (old_selected == selected)
|
||||
unget_kbinput(KEY_ENTER, FALSE);
|
||||
kbinput = KEY_ENTER;
|
||||
}
|
||||
|
||||
continue;
|
||||
if (kbinput == KEY_MOUSE)
|
||||
continue;
|
||||
}
|
||||
#endif /* ENABLE_MOUSE */
|
||||
#ifndef NANO_TINY
|
||||
if (bracketed_paste || kbinput == BRACKETED_PASTE_MARKER) {
|
||||
beep();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
func = interpret(&kbinput);
|
||||
|
||||
func = parse_browser_input(&kbinput);
|
||||
|
||||
if (func == total_refresh) {
|
||||
total_redraw();
|
||||
if (func == full_refresh) {
|
||||
full_refresh();
|
||||
#ifndef NANO_TINY
|
||||
/* Simulate a window resize to force a directory reread. */
|
||||
kbinput = KEY_WINCH;
|
||||
#endif
|
||||
} else if (func == do_help_void) {
|
||||
} else if (func == do_help) {
|
||||
#ifdef ENABLE_HELP
|
||||
do_help_void();
|
||||
do_help();
|
||||
#ifndef NANO_TINY
|
||||
/* The window dimensions might have changed, so act as if. */
|
||||
kbinput = KEY_WINCH;
|
||||
#endif
|
||||
#else
|
||||
say_there_is_no_help();
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
} else if (func == do_toggle_void) {
|
||||
TOGGLE(NO_HELP);
|
||||
window_init();
|
||||
kbinput = KEY_WINCH;
|
||||
#endif
|
||||
} else if (func == do_search_forward) {
|
||||
do_filesearch(FORWARD);
|
||||
@@ -177,9 +190,9 @@ char *do_browser(char *path)
|
||||
} else if (func == do_right) {
|
||||
if (selected < filelist_len - 1)
|
||||
selected++;
|
||||
} else if (func == do_prev_word_void) {
|
||||
} else if (func == to_prev_word) {
|
||||
selected -= (selected % width);
|
||||
} else if (func == do_next_word_void) {
|
||||
} else if (func == to_next_word) {
|
||||
selected += width - 1 - (selected % width);
|
||||
if (selected >= filelist_len)
|
||||
selected = filelist_len - 1;
|
||||
@@ -189,10 +202,10 @@ char *do_browser(char *path)
|
||||
} else if (func == do_down) {
|
||||
if (selected + width <= filelist_len - 1)
|
||||
selected += width;
|
||||
} else if (func == do_prev_block) {
|
||||
} else if (func == to_prev_block) {
|
||||
selected = ((selected / (editwinrows * width)) *
|
||||
editwinrows * width) + selected % width;
|
||||
} else if (func == do_next_block) {
|
||||
} else if (func == to_next_block) {
|
||||
selected = ((selected / (editwinrows * width)) *
|
||||
editwinrows * width) + selected % width +
|
||||
editwinrows * width - width;
|
||||
@@ -219,9 +232,9 @@ char *do_browser(char *path)
|
||||
selected = 0;
|
||||
} else if (func == to_last_file) {
|
||||
selected = filelist_len - 1;
|
||||
} else if (func == goto_dir_void) {
|
||||
} else if (func == goto_dir) {
|
||||
/* Ask for the directory to go to. */
|
||||
if (do_prompt(TRUE, FALSE, MGOTODIR, "", NULL,
|
||||
if (do_prompt(MGOTODIR, "", NULL,
|
||||
/* TRANSLATORS: This is a prompt. */
|
||||
browser_refresh, _("Go To Directory")) < 0) {
|
||||
statusbar(_("Cancelled"));
|
||||
@@ -285,7 +298,7 @@ char *do_browser(char *path)
|
||||
|
||||
/* If it isn't a directory, a file was selected -- we're done. */
|
||||
if (!S_ISDIR(st.st_mode)) {
|
||||
retval = copy_of(filelist[selected]);
|
||||
chosen = copy_of(filelist[selected]);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -330,38 +343,29 @@ char *do_browser(char *path)
|
||||
filelist = NULL;
|
||||
filelist_len = 0;
|
||||
|
||||
return retval;
|
||||
return chosen;
|
||||
}
|
||||
|
||||
/* The file browser front end. We check to see if inpath has a
|
||||
* directory in it. If it does, we start do_browser() from there.
|
||||
* Otherwise, we start do_browser() from the current directory. */
|
||||
char *do_browse_from(const char *inpath)
|
||||
/* Prepare to start browsing. If the given path has a directory part,
|
||||
* start browsing in that directory, otherwise in the current directory. */
|
||||
char *browse_in(const char *inpath)
|
||||
{
|
||||
struct stat st;
|
||||
char *path;
|
||||
/* This holds the tilde-expanded version of inpath. */
|
||||
char *path = real_dir_from_tilde(inpath);
|
||||
struct stat fileinfo;
|
||||
|
||||
path = real_dir_from_tilde(inpath);
|
||||
|
||||
/* Perhaps path is a directory. If so, we'll pass it to
|
||||
* do_browser(). Or perhaps path is a directory / a file. If so,
|
||||
* we'll try stripping off the last path element and passing it to
|
||||
* do_browser(). Or perhaps path doesn't have a directory portion
|
||||
* at all. If so, we'll just pass the current directory to
|
||||
* do_browser(). */
|
||||
if (stat(path, &st) == -1 || !S_ISDIR(st.st_mode)) {
|
||||
/* If path is not a directory, try to strip a filename from it; if then
|
||||
* still not a directory, use the current working directory instead. */
|
||||
if (stat(path, &fileinfo) == -1 || !S_ISDIR(fileinfo.st_mode)) {
|
||||
path = free_and_assign(path, strip_last_component(path));
|
||||
|
||||
if (stat(path, &st) == -1 || !S_ISDIR(st.st_mode)) {
|
||||
if (stat(path, &fileinfo) == -1 || !S_ISDIR(fileinfo.st_mode)) {
|
||||
char *currentdir = charalloc(PATH_MAX + 1);
|
||||
|
||||
free(path);
|
||||
path = getcwd(currentdir, PATH_MAX + 1);
|
||||
path = free_and_assign(path, getcwd(currentdir, PATH_MAX + 1));
|
||||
|
||||
if (path == NULL) {
|
||||
free(currentdir);
|
||||
statusline(MILD, _("The working directory has disappeared"));
|
||||
free(currentdir);
|
||||
beep();
|
||||
napms(1200);
|
||||
return NULL;
|
||||
@@ -376,7 +380,7 @@ char *do_browse_from(const char *inpath)
|
||||
path = mallocstrcpy(path, operating_dir);
|
||||
#endif
|
||||
|
||||
return do_browser(path);
|
||||
return browse(path);
|
||||
}
|
||||
|
||||
/* Set filelist to the list of files contained in the directory path,
|
||||
@@ -447,49 +451,9 @@ void read_the_list(const char *path, DIR *dir)
|
||||
width = (COLS + 2) / (longest + 2);
|
||||
}
|
||||
|
||||
/* Return the function that is bound to the given key, accepting certain
|
||||
* plain characters too, for compatibility with Pico. */
|
||||
functionptrtype parse_browser_input(int *kbinput)
|
||||
{
|
||||
if (!meta_key) {
|
||||
switch (*kbinput) {
|
||||
case '-':
|
||||
return do_page_up;
|
||||
case ' ':
|
||||
return do_page_down;
|
||||
case 'W':
|
||||
case 'w':
|
||||
case '/':
|
||||
return do_search_forward;
|
||||
case 'N':
|
||||
return do_findprevious;
|
||||
case 'n':
|
||||
return do_findnext;
|
||||
case 'G':
|
||||
case 'g':
|
||||
return goto_dir_void;
|
||||
case '?':
|
||||
return do_help_void;
|
||||
case 'S':
|
||||
case 's':
|
||||
return do_enter;
|
||||
case 'E':
|
||||
case 'e':
|
||||
case 'Q':
|
||||
case 'q':
|
||||
case 'X':
|
||||
case 'x':
|
||||
return do_exit;
|
||||
}
|
||||
}
|
||||
return func_from_key(kbinput);
|
||||
}
|
||||
|
||||
/* Set width to the number of files that we can display per screen row,
|
||||
* if necessary, and display the list of files. */
|
||||
/* Display at most a screenful of filenames from the gleaned filelist. */
|
||||
void browser_refresh(void)
|
||||
{
|
||||
size_t i;
|
||||
int row = 0, col = 0;
|
||||
/* The current row and column while the list is getting displayed. */
|
||||
int the_row = 0, the_column = 0;
|
||||
@@ -500,13 +464,9 @@ void browser_refresh(void)
|
||||
titlebar(present_path);
|
||||
blank_edit();
|
||||
|
||||
wmove(edit, 0, 0);
|
||||
|
||||
i = selected - selected % (editwinrows * width);
|
||||
|
||||
for (; i < filelist_len && row < editwinrows; i++) {
|
||||
struct stat st;
|
||||
const char *thename = tail(filelist[i]);
|
||||
for (size_t index = selected - selected % (editwinrows * width);
|
||||
index < filelist_len && row < editwinrows; index++) {
|
||||
const char *thename = tail(filelist[index]);
|
||||
/* The filename we display, minus the path. */
|
||||
size_t namelen = breadth(thename);
|
||||
/* The length of the filename in columns. */
|
||||
@@ -522,10 +482,11 @@ void browser_refresh(void)
|
||||
namelen + infomaxlen + 4 - longest : 0, longest, FALSE, FALSE);
|
||||
/* The filename (or a fragment of it) in displayable format.
|
||||
* When a fragment, account for dots plus one space padding. */
|
||||
struct stat state;
|
||||
|
||||
/* If this is the selected item, draw its highlighted bar upfront, and
|
||||
* remember its location to be able to place the cursor on it. */
|
||||
if (i == selected) {
|
||||
if (index == selected) {
|
||||
wattron(edit, interface_color_pair[SELECTED_TEXT]);
|
||||
mvwprintw(edit, row, col, "%*s", longest, " ");
|
||||
the_row = row;
|
||||
@@ -537,20 +498,18 @@ void browser_refresh(void)
|
||||
mvwaddstr(edit, row, col, "...");
|
||||
mvwaddstr(edit, row, dots ? col + 3 : col, disp);
|
||||
|
||||
free(disp);
|
||||
|
||||
col += longest;
|
||||
|
||||
/* Show information about the file: "--" for symlinks (except when
|
||||
* they point to a directory) and for files that have disappeared,
|
||||
* "(dir)" for directories, and the file size for normal files. */
|
||||
if (lstat(filelist[i], &st) == -1 || S_ISLNK(st.st_mode)) {
|
||||
if (stat(filelist[i], &st) == -1 || !S_ISDIR(st.st_mode))
|
||||
if (lstat(filelist[index], &state) == -1 || S_ISLNK(state.st_mode)) {
|
||||
if (stat(filelist[index], &state) == -1 || !S_ISDIR(state.st_mode))
|
||||
info = copy_of("--");
|
||||
else
|
||||
/* TRANSLATORS: Try to keep this at most 7 characters. */
|
||||
info = copy_of(_("(dir)"));
|
||||
} else if (S_ISDIR(st.st_mode)) {
|
||||
} else if (S_ISDIR(state.st_mode)) {
|
||||
if (strcmp(thename, "..") == 0) {
|
||||
/* TRANSLATORS: Try to keep this at most 12 characters. */
|
||||
info = copy_of(_("(parent dir)"));
|
||||
@@ -558,18 +517,18 @@ void browser_refresh(void)
|
||||
} else
|
||||
info = copy_of(_("(dir)"));
|
||||
} else {
|
||||
off_t result = st.st_size;
|
||||
off_t result = state.st_size;
|
||||
char modifier;
|
||||
|
||||
info = charalloc(infomaxlen + 1);
|
||||
|
||||
/* Massage the file size into a human-readable form. */
|
||||
if (st.st_size < (1 << 10))
|
||||
if (state.st_size < (1 << 10))
|
||||
modifier = ' '; /* bytes */
|
||||
else if (st.st_size < (1 << 20)) {
|
||||
else if (state.st_size < (1 << 20)) {
|
||||
result >>= 10;
|
||||
modifier = 'K'; /* kilobytes */
|
||||
} else if (st.st_size < (1 << 30)) {
|
||||
} else if (state.st_size < (1 << 30)) {
|
||||
result >>= 20;
|
||||
modifier = 'M'; /* megabytes */
|
||||
} else {
|
||||
@@ -596,16 +555,16 @@ void browser_refresh(void)
|
||||
mvwaddstr(edit, row, col - infolen, info);
|
||||
|
||||
/* If this is the selected item, finish its highlighting. */
|
||||
if (i == selected)
|
||||
if (index == selected)
|
||||
wattroff(edit, interface_color_pair[SELECTED_TEXT]);
|
||||
|
||||
free(disp);
|
||||
free(info);
|
||||
|
||||
/* Add some space between the columns. */
|
||||
col += 2;
|
||||
|
||||
/* If the next entry isn't going to fit on the current row,
|
||||
* move to the next row. */
|
||||
/* If the next entry will not fit on this row, move to next row. */
|
||||
if (col > COLS - longest) {
|
||||
row++;
|
||||
col = 0;
|
||||
@@ -667,7 +626,7 @@ int filesearch_init(bool forwards)
|
||||
thedefault = copy_of("");
|
||||
|
||||
/* Now ask what to search for. */
|
||||
response = do_prompt(FALSE, FALSE, MWHEREISFILE, "", &search_history,
|
||||
response = do_prompt(MWHEREISFILE, "", &search_history,
|
||||
browser_refresh, "%s%s%s", _("Search"),
|
||||
/* TRANSLATORS: A modifier of the Search prompt. */
|
||||
!forwards ? _(" [Backwards]") : "", thedefault);
|
||||
@@ -776,18 +735,6 @@ void do_fileresearch(bool forwards)
|
||||
findfile(last_search, forwards);
|
||||
}
|
||||
|
||||
/* Select the first file in the list. */
|
||||
void to_first_file(void)
|
||||
{
|
||||
selected = 0;
|
||||
}
|
||||
|
||||
/* Select the last file in the list. */
|
||||
void to_last_file(void)
|
||||
{
|
||||
selected = filelist_len - 1;
|
||||
}
|
||||
|
||||
/* Strip one element from the end of path, and return the stripped path.
|
||||
* The returned string is dynamically allocated, and should be freed. */
|
||||
char *strip_last_component(const char *path)
|
||||
|
||||
165
src/chars.c
165
src/chars.c
@@ -1,8 +1,8 @@
|
||||
/**************************************************************************
|
||||
* chars.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 2001-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2016-2018 Benno Schulenberg *
|
||||
* Copyright (C) 2001-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2016-2019 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
@@ -19,7 +19,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
@@ -44,118 +44,94 @@ bool using_utf8(void)
|
||||
}
|
||||
#endif /* ENABLE_UTF8 */
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
/* This function is equivalent to isalpha() for multibyte characters. */
|
||||
bool is_alpha_mbchar(const char *c)
|
||||
#ifdef ENABLE_SPELLER
|
||||
/* Return TRUE when the given character is some kind of letter. */
|
||||
bool is_alpha_char(const char *c)
|
||||
{
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
wchar_t wc;
|
||||
wchar_t wc;
|
||||
|
||||
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
|
||||
return FALSE;
|
||||
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
|
||||
return FALSE;
|
||||
|
||||
return iswalpha(wc);
|
||||
} else
|
||||
return iswalpha(wc);
|
||||
#else
|
||||
return isalpha((unsigned char)*c);
|
||||
#endif
|
||||
return isalpha((unsigned char)*c);
|
||||
}
|
||||
#endif /* ENABLE_SPELLER */
|
||||
|
||||
/* This function is equivalent to isalnum() for multibyte characters. */
|
||||
bool is_alnum_mbchar(const char *c)
|
||||
/* Return TRUE when the given character is some kind of letter or a digit. */
|
||||
bool is_alnum_char(const char *c)
|
||||
{
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
wchar_t wc;
|
||||
wchar_t wc;
|
||||
|
||||
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
|
||||
return FALSE;
|
||||
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
|
||||
return FALSE;
|
||||
|
||||
return iswalnum(wc);
|
||||
} else
|
||||
return iswalnum(wc);
|
||||
#else
|
||||
return isalnum((unsigned char)*c);
|
||||
#endif
|
||||
return isalnum((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* This function is equivalent to isblank() for multibyte characters. */
|
||||
bool is_blank_mbchar(const char *c)
|
||||
/* Return TRUE when the given character is space or tab or other whitespace. */
|
||||
bool is_blank_char(const char *c)
|
||||
{
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
wchar_t wc;
|
||||
wchar_t wc;
|
||||
|
||||
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
|
||||
return FALSE;
|
||||
if ((signed char)*c >= 0)
|
||||
return (*c == ' ' || *c == '\t');
|
||||
|
||||
return iswblank(wc);
|
||||
} else
|
||||
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
|
||||
return FALSE;
|
||||
|
||||
return iswblank(wc);
|
||||
#else
|
||||
return isblank((unsigned char)*c);
|
||||
#endif
|
||||
return isblank((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* This function is equivalent to iscntrl(), except in that it only
|
||||
* handles non-high-bit control characters. */
|
||||
bool is_ascii_cntrl_char(int c)
|
||||
{
|
||||
return (0 <= c && c < 32);
|
||||
}
|
||||
|
||||
/* 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)
|
||||
/* Return TRUE when the given character is a control character. */
|
||||
bool is_cntrl_char(const char *c)
|
||||
{
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
return ((c[0] & 0xE0) == 0 || c[0] == 127 ||
|
||||
return ((c[0] & 0xE0) == 0 || c[0] == DEL_CODE ||
|
||||
((signed char)c[0] == -62 && (signed char)c[1] < -96));
|
||||
} else
|
||||
#endif
|
||||
return (((unsigned char)*c & 0x60) == 0 || (unsigned char)*c == 127);
|
||||
return ((*c & 0x60) == 0 || *c == DEL_CODE);
|
||||
}
|
||||
|
||||
/* This function is equivalent to ispunct() for multibyte characters. */
|
||||
bool is_punct_mbchar(const char *c)
|
||||
/* Return TRUE when the given character is a punctuation character. */
|
||||
bool is_punct_char(const char *c)
|
||||
{
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
wchar_t wc;
|
||||
wchar_t wc;
|
||||
|
||||
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
|
||||
return FALSE;
|
||||
if (mbtowc(&wc, c, MAXCHARLEN) < 0)
|
||||
return FALSE;
|
||||
|
||||
return iswpunct(wc);
|
||||
} else
|
||||
return iswpunct(wc);
|
||||
#else
|
||||
return ispunct((unsigned char)*c);
|
||||
#endif
|
||||
return ispunct((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* 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)
|
||||
/* Return TRUE when the given character is word-forming (it is alphanumeric or
|
||||
* specified in 'wordchars', or it is punctuation when allow_punct is TRUE). */
|
||||
bool is_word_char(const char *c, bool allow_punct)
|
||||
{
|
||||
if (*c == '\0')
|
||||
return FALSE;
|
||||
|
||||
if (is_alnum_mbchar(c))
|
||||
if (is_alnum_char(c))
|
||||
return TRUE;
|
||||
|
||||
if (allow_punct && is_punct_char(c))
|
||||
return TRUE;
|
||||
|
||||
if (word_chars != NULL && *word_chars != '\0') {
|
||||
@@ -164,9 +140,8 @@ bool is_word_mbchar(const char *c, bool allow_punct)
|
||||
|
||||
symbol[symlen] = '\0';
|
||||
return (strstr(word_chars, symbol) != NULL);
|
||||
}
|
||||
|
||||
return (allow_punct && is_punct_mbchar(c));
|
||||
} else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Return the visible representation of control character c. */
|
||||
@@ -221,35 +196,25 @@ int mbwidth(const char *c)
|
||||
} else
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Convert the Unicode value in code to a multibyte character, if possible.
|
||||
/* Convert the given Unicode value 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. */
|
||||
* character and its length. Otherwise, return a length of zero. */
|
||||
char *make_mbchar(long code, int *length)
|
||||
{
|
||||
char *mb_char;
|
||||
char *mb_char = charalloc(MAXCHARLEN);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (use_utf8) {
|
||||
mb_char = charalloc(MAXCHARLEN);
|
||||
*length = wctomb(mb_char, (wchar_t)code);
|
||||
*length = wctomb(mb_char, (wchar_t)code);
|
||||
|
||||
/* Reject invalid Unicode characters. */
|
||||
if (*length < 0 || !is_valid_unicode((wchar_t)code)) {
|
||||
IGNORE_CALL_RESULT(wctomb(NULL, 0));
|
||||
*length = 0;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
mb_char = measured_copy((char *)&code, 1);
|
||||
*length = 1;
|
||||
/* Reject invalid Unicode characters. */
|
||||
if (*length < 0 || !is_valid_unicode((wchar_t)code)) {
|
||||
IGNORE_CALL_RESULT(wctomb(NULL, 0));
|
||||
*length = 0;
|
||||
}
|
||||
|
||||
return mb_char;
|
||||
}
|
||||
#endif /* ENABLE_UTF8 */
|
||||
|
||||
/* Return the length (in bytes) of the character located at *pointer. */
|
||||
int char_length(const char *pointer)
|
||||
@@ -319,7 +284,7 @@ int advance_over(const char *string, size_t *column)
|
||||
int charlen = mblen(string, MAXCHARLEN);
|
||||
|
||||
if (charlen > 0) {
|
||||
if (is_cntrl_mbchar(string))
|
||||
if (is_cntrl_char(string))
|
||||
*column += 2;
|
||||
else
|
||||
*column += mbwidth(string);
|
||||
@@ -612,7 +577,7 @@ bool has_blank_char(const char *string)
|
||||
while (*string != '\0') {
|
||||
string += collect_char(string, symbol);
|
||||
|
||||
if (is_blank_mbchar(symbol))
|
||||
if (is_blank_char(symbol))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -623,7 +588,7 @@ bool has_blank_char(const char *string)
|
||||
/* Return TRUE when the given string is empty or consists of only blanks. */
|
||||
bool white_string(const char *string)
|
||||
{
|
||||
while (*string != '\0' && (is_blank_mbchar(string) || *string == '\r'))
|
||||
while (*string != '\0' && (is_blank_char(string) || *string == '\r'))
|
||||
string += char_length(string);
|
||||
|
||||
return !*string;
|
||||
|
||||
220
src/color.c
220
src/color.c
@@ -1,7 +1,7 @@
|
||||
/**************************************************************************
|
||||
* color.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 2001-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2001-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2014-2017 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
@@ -19,7 +19,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
|
||||
@@ -38,108 +38,86 @@
|
||||
#define A_BANDAID A_NORMAL
|
||||
#endif
|
||||
|
||||
/* Assign pair numbers for the colors in the given syntax, giving identical
|
||||
* color pairs the same number. */
|
||||
void set_syntax_colorpairs(syntaxtype *sint)
|
||||
static bool defaults_allowed = FALSE;
|
||||
/* Whether ncurses accepts -1 to mean "default color". */
|
||||
|
||||
/* Initialize the color pairs for nano's interface. */
|
||||
void set_interface_colorpairs(void)
|
||||
{
|
||||
int new_number = NUMBER_OF_ELEMENTS + 1;
|
||||
colortype *ink;
|
||||
#ifdef HAVE_USE_DEFAULT_COLORS
|
||||
/* Ask ncurses to allow -1 to mean "default color". */
|
||||
defaults_allowed = (use_default_colors() == OK);
|
||||
#endif
|
||||
|
||||
for (ink = sint->color; ink != NULL; ink = ink->next) {
|
||||
const colortype *beforenow = sint->color;
|
||||
/* Initialize the color pairs for nano's interface elements. */
|
||||
for (size_t index = 0; index < NUMBER_OF_ELEMENTS; index++) {
|
||||
colortype *combo = color_combo[index];
|
||||
|
||||
while (beforenow != ink && (beforenow->fg != ink->fg ||
|
||||
beforenow->bg != ink->bg))
|
||||
beforenow = beforenow->next;
|
||||
if (combo != NULL) {
|
||||
if (!defaults_allowed) {
|
||||
if (combo->fg == THE_DEFAULT)
|
||||
combo->fg = COLOR_WHITE;
|
||||
if (combo->bg == THE_DEFAULT)
|
||||
combo->bg = COLOR_BLACK;
|
||||
}
|
||||
init_pair(index + 1, combo->fg, combo->bg);
|
||||
interface_color_pair[index] = COLOR_PAIR(index + 1) | A_BANDAID |
|
||||
combo->attributes;
|
||||
} else {
|
||||
if (index == FUNCTION_TAG)
|
||||
interface_color_pair[index] = A_NORMAL;
|
||||
else if (index == GUIDE_STRIPE)
|
||||
interface_color_pair[index] = A_REVERSE;
|
||||
else if (index == ERROR_MESSAGE) {
|
||||
init_pair(index + 1, COLOR_WHITE, COLOR_RED);
|
||||
interface_color_pair[index] = COLOR_PAIR(index + 1) |
|
||||
A_BOLD | A_BANDAID;
|
||||
} else
|
||||
interface_color_pair[index] = hilite_attribute;
|
||||
}
|
||||
|
||||
if (beforenow != ink)
|
||||
ink->pairnum = beforenow->pairnum;
|
||||
else
|
||||
ink->pairnum = new_number++;
|
||||
free(color_combo[index]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Assign a pair number to each of the foreground/background color combinations
|
||||
* in the given syntax, giving identical combinations the same number. */
|
||||
void set_syntax_colorpairs(syntaxtype *sntx)
|
||||
{
|
||||
short number = NUMBER_OF_ELEMENTS;
|
||||
colortype *older;
|
||||
|
||||
for (colortype *ink = sntx->color; ink != NULL; ink = ink->next) {
|
||||
if (!defaults_allowed) {
|
||||
if (ink->fg == THE_DEFAULT)
|
||||
ink->fg = COLOR_WHITE;
|
||||
if (ink->bg == THE_DEFAULT)
|
||||
ink->bg = COLOR_BLACK;
|
||||
}
|
||||
|
||||
older = sntx->color;
|
||||
|
||||
while (older != ink && (older->fg != ink->fg || older->bg != ink->bg))
|
||||
older = older->next;
|
||||
|
||||
ink->pairnum = (older != ink) ? older->pairnum : ++number;
|
||||
|
||||
ink->attributes |= COLOR_PAIR(ink->pairnum) | A_BANDAID;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize the colors for nano's interface, and assign pair numbers
|
||||
* for the colors in each loaded syntax. */
|
||||
void set_colorpairs(void)
|
||||
/* Initialize the color pairs for the current syntax. */
|
||||
void prepare_palette(void)
|
||||
{
|
||||
syntaxtype *sint;
|
||||
bool using_defaults = FALSE;
|
||||
size_t i;
|
||||
short number = NUMBER_OF_ELEMENTS;
|
||||
|
||||
/* Tell ncurses to enable colors. */
|
||||
start_color();
|
||||
|
||||
#ifdef HAVE_USE_DEFAULT_COLORS
|
||||
/* Allow using the default colors, if available. */
|
||||
using_defaults = (use_default_colors() != ERR);
|
||||
#endif
|
||||
|
||||
/* Initialize the color pairs for nano's interface elements. */
|
||||
for (i = 0; i < NUMBER_OF_ELEMENTS; i++) {
|
||||
colortype *combo = color_combo[i];
|
||||
|
||||
if (combo != NULL) {
|
||||
if (combo->fg == USE_THE_DEFAULT && !using_defaults)
|
||||
combo->fg = COLOR_WHITE;
|
||||
if (combo->bg == USE_THE_DEFAULT && !using_defaults)
|
||||
combo->bg = COLOR_BLACK;
|
||||
init_pair(i + 1, combo->fg, combo->bg);
|
||||
interface_color_pair[i] = COLOR_PAIR(i + 1) | A_BANDAID |
|
||||
combo->attributes;
|
||||
} else {
|
||||
if (i == FUNCTION_TAG)
|
||||
interface_color_pair[i] = A_NORMAL;
|
||||
else if (i == GUIDE_STRIPE)
|
||||
interface_color_pair[i] = A_REVERSE;
|
||||
else if (i == ERROR_MESSAGE) {
|
||||
init_pair(i + 1, COLOR_WHITE, COLOR_RED);
|
||||
interface_color_pair[i] = COLOR_PAIR(i + 1) | A_BOLD | A_BANDAID;
|
||||
} else
|
||||
interface_color_pair[i] = hilite_attribute;
|
||||
/* For each unique pair number, tell ncurses the combination of colors. */
|
||||
for (colortype *ink = openfile->syntax->color; ink != NULL; ink = ink->next)
|
||||
if (ink->pairnum > number) {
|
||||
init_pair(ink->pairnum, ink->fg, ink->bg);
|
||||
number = ink->pairnum;
|
||||
}
|
||||
|
||||
free(color_combo[i]);
|
||||
}
|
||||
|
||||
/* For each loaded syntax, assign pair numbers to color combinations. */
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next)
|
||||
if (sint->filename == NULL)
|
||||
set_syntax_colorpairs(sint);
|
||||
}
|
||||
|
||||
/* Initialize the color information. */
|
||||
void color_init(void)
|
||||
{
|
||||
const colortype *ink;
|
||||
bool using_defaults = FALSE;
|
||||
short foreground, background;
|
||||
|
||||
/* If the terminal is not capable of colors, forget it. */
|
||||
if (!has_colors())
|
||||
return;
|
||||
|
||||
#ifdef HAVE_USE_DEFAULT_COLORS
|
||||
/* Allow using the default colors, if available. */
|
||||
using_defaults = (use_default_colors() != ERR);
|
||||
#endif
|
||||
|
||||
/* For each coloring expression, initialize the color pair. */
|
||||
for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) {
|
||||
foreground = ink->fg;
|
||||
background = ink->bg;
|
||||
|
||||
if (foreground == USE_THE_DEFAULT && !using_defaults)
|
||||
foreground = COLOR_WHITE;
|
||||
|
||||
if (background == USE_THE_DEFAULT && !using_defaults)
|
||||
background = COLOR_BLACK;
|
||||
|
||||
init_pair(ink->pairnum, foreground, background);
|
||||
}
|
||||
|
||||
have_palette = TRUE;
|
||||
}
|
||||
|
||||
@@ -164,10 +142,11 @@ bool found_in_list(regexlisttype *head, const char *shibboleth)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Update the color information based on the current filename and content. */
|
||||
void color_update(void)
|
||||
/* Find a syntax that applies to the current buffer, based upon filename
|
||||
* or buffer content, and load and prime this syntax when needed. */
|
||||
void find_and_prime_applicable_syntax(void)
|
||||
{
|
||||
syntaxtype *sint = NULL;
|
||||
syntaxtype *sntx = NULL;
|
||||
|
||||
/* If the rcfiles were not read, or contained no syntaxes, get out. */
|
||||
if (syntaxes == NULL)
|
||||
@@ -179,42 +158,39 @@ void color_update(void)
|
||||
if (strcmp(syntaxstr, "none") == 0)
|
||||
return;
|
||||
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (strcmp(sint->name, syntaxstr) == 0)
|
||||
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
|
||||
if (strcmp(sntx->name, syntaxstr) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (sint == NULL && !inhelp)
|
||||
if (sntx == NULL && !inhelp)
|
||||
statusline(ALERT, _("Unknown syntax name: %s"), syntaxstr);
|
||||
}
|
||||
|
||||
/* If no syntax-override string was specified, or it didn't match,
|
||||
* try finding a syntax based on the filename (extension). */
|
||||
if (sint == NULL && !inhelp) {
|
||||
if (sntx == NULL && !inhelp) {
|
||||
char *fullname = get_full_path(openfile->filename);
|
||||
|
||||
if (fullname == NULL)
|
||||
fullname = mallocstrcpy(fullname, openfile->filename);
|
||||
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (found_in_list(sint->extensions, fullname))
|
||||
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
|
||||
if (found_in_list(sntx->extensions, fullname))
|
||||
break;
|
||||
}
|
||||
|
||||
free(fullname);
|
||||
}
|
||||
|
||||
/* If the filename didn't match anything, try the first line. */
|
||||
if (sint == NULL && !inhelp) {
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (found_in_list(sint->headers, openfile->filetop->data))
|
||||
if (sntx == NULL && !inhelp) {
|
||||
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
|
||||
if (found_in_list(sntx->headers, openfile->filetop->data))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBMAGIC
|
||||
/* If we still don't have an answer, try using magic. */
|
||||
if (sint == NULL && !inhelp) {
|
||||
if (sntx == NULL && !inhelp) {
|
||||
struct stat fileinfo;
|
||||
magic_t cookie = NULL;
|
||||
const char *magicstring = NULL;
|
||||
@@ -238,10 +214,9 @@ void color_update(void)
|
||||
|
||||
/* 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))
|
||||
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
|
||||
if (found_in_list(sntx->magics, magicstring))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (stat(openfile->filename, &fileinfo) == 0)
|
||||
@@ -250,21 +225,19 @@ void color_update(void)
|
||||
#endif /* HAVE_LIBMAGIC */
|
||||
|
||||
/* If nothing at all matched, see if there is a default syntax. */
|
||||
if (sint == NULL && !inhelp) {
|
||||
for (sint = syntaxes; sint != NULL; sint = sint->next) {
|
||||
if (strcmp(sint->name, "default") == 0)
|
||||
if (sntx == NULL && !inhelp) {
|
||||
for (sntx = syntaxes; sntx != NULL; sntx = sntx->next)
|
||||
if (strcmp(sntx->name, "default") == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* When the syntax isn't loaded yet, parse it and initialize its colors. */
|
||||
if (sint != NULL && sint->filename != NULL) {
|
||||
parse_one_include(sint->filename, sint);
|
||||
set_syntax_colorpairs(sint);
|
||||
if (sntx != NULL && sntx->filename != NULL) {
|
||||
parse_one_include(sntx->filename, sntx);
|
||||
set_syntax_colorpairs(sntx);
|
||||
}
|
||||
|
||||
openfile->syntax = sint;
|
||||
openfile->colorstrings = (sint == NULL ? NULL : sint->color);
|
||||
openfile->syntax = sntx;
|
||||
}
|
||||
|
||||
/* Allocate and initialize (for the given line) the cache for multiline info. */
|
||||
@@ -272,7 +245,7 @@ void set_up_multicache(linestruct *line)
|
||||
{
|
||||
line->multidata = (short *)nmalloc(openfile->syntax->nmultis * sizeof(short));
|
||||
|
||||
for (int index = 0; index < openfile->syntax->nmultis; index++)
|
||||
for (short index = 0; index < openfile->syntax->nmultis; index++)
|
||||
line->multidata[index] = -1;
|
||||
}
|
||||
|
||||
@@ -292,7 +265,7 @@ void check_the_multis(linestruct *line)
|
||||
if (line->multidata == NULL)
|
||||
set_up_multicache(line);
|
||||
|
||||
for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) {
|
||||
for (ink = openfile->syntax->color; ink != NULL; ink = ink->next) {
|
||||
/* If it's not a multiline regex, skip. */
|
||||
if (ink->end == NULL)
|
||||
continue;
|
||||
@@ -331,14 +304,15 @@ void precalc_multicolorinfo(void)
|
||||
regmatch_t startmatch, endmatch;
|
||||
linestruct *line, *tailline;
|
||||
|
||||
if (openfile->colorstrings == NULL || ISSET(NO_COLOR_SYNTAX))
|
||||
if (openfile->syntax == NULL || openfile->syntax->nmultis == 0 ||
|
||||
openfile->filetop->multidata || ISSET(NO_SYNTAX))
|
||||
return;
|
||||
|
||||
/* For each line, allocate cache space for the multiline-regex info. */
|
||||
for (line = openfile->filetop; line != NULL; line = line->next)
|
||||
set_up_multicache(line);
|
||||
|
||||
for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) {
|
||||
for (ink = openfile->syntax->color; ink != NULL; ink = ink->next) {
|
||||
/* If this is not a multi-line regex, skip it. */
|
||||
if (ink->end == NULL)
|
||||
continue;
|
||||
|
||||
611
src/cut.c
611
src/cut.c
@@ -1,7 +1,7 @@
|
||||
/**************************************************************************
|
||||
* cut.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 1999-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2014 Mark Majeres *
|
||||
* Copyright (C) 2016, 2018, 2019 Benno Schulenberg *
|
||||
* *
|
||||
@@ -20,17 +20,13 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Delete the character under the cursor. */
|
||||
void do_deletion(undo_type action)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
size_t old_amount = 0;
|
||||
#endif
|
||||
|
||||
openfile->placewewant = xplustabs();
|
||||
|
||||
/* When in the middle of a line, delete the current character. */
|
||||
@@ -38,22 +34,29 @@ void do_deletion(undo_type action)
|
||||
int charlen = char_length(openfile->current->data + openfile->current_x);
|
||||
size_t line_len = strlen(openfile->current->data + openfile->current_x);
|
||||
#ifndef NANO_TINY
|
||||
size_t old_amount = openfile->current->extrarows;
|
||||
|
||||
/* If the type of action changed or the cursor moved to a different
|
||||
* line, create a new undo item, otherwise update the existing item. */
|
||||
if (action != openfile->last_action ||
|
||||
openfile->current->lineno != openfile->current_undo->lineno)
|
||||
openfile->current->lineno != openfile->current_undo->head_lineno)
|
||||
add_undo(action, NULL);
|
||||
else
|
||||
update_undo(action);
|
||||
|
||||
if (ISSET(SOFTWRAP))
|
||||
old_amount = number_of_chunks_in(openfile->current);
|
||||
#endif
|
||||
/* Move the remainder of the line "in", over the current character. */
|
||||
memmove(&openfile->current->data[openfile->current_x],
|
||||
&openfile->current->data[openfile->current_x + charlen],
|
||||
line_len - charlen + 1);
|
||||
#ifndef NANO_TINY
|
||||
/* When softwrapping, recompute the number of chunks in the line,
|
||||
* and schedule a refresh if the number changed. */
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
openfile->current->extrarows = extra_chunks_in(openfile->current);
|
||||
if (openfile->current->extrarows != old_amount)
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
/* Adjust the mark if it is after the cursor on the current line. */
|
||||
if (openfile->mark == openfile->current &&
|
||||
openfile->mark_x > openfile->current_x)
|
||||
@@ -65,7 +68,7 @@ void do_deletion(undo_type action)
|
||||
|
||||
/* If there is a magic line, and we're before it: don't eat it. */
|
||||
if (joining == openfile->filebot && openfile->current_x != 0 &&
|
||||
!ISSET(NO_NEWLINES)) {
|
||||
!ISSET(NO_NEWLINES)) {
|
||||
#ifndef NANO_TINY
|
||||
if (action == BACK)
|
||||
add_undo(BACK, NULL);
|
||||
@@ -75,23 +78,28 @@ void do_deletion(undo_type action)
|
||||
|
||||
#ifndef NANO_TINY
|
||||
add_undo(action, NULL);
|
||||
#endif
|
||||
/* Add the contents of the next line to those of the current one. */
|
||||
openfile->current->data = charealloc(openfile->current->data,
|
||||
strlen(openfile->current->data) + strlen(joining->data) + 1);
|
||||
strcat(openfile->current->data, joining->data);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Adjust the mark if it was on the line that was "eaten". */
|
||||
/* Adjust the mark if it is on the line that will be "eaten". */
|
||||
if (openfile->mark == joining) {
|
||||
openfile->mark = openfile->current;
|
||||
openfile->mark_x += openfile->current_x;
|
||||
}
|
||||
#endif
|
||||
unlink_node(joining);
|
||||
renumber_from(openfile->current);
|
||||
|
||||
/* Two lines were joined, so we need to refresh the screen. */
|
||||
openfile->current->has_anchor |= joining->has_anchor;
|
||||
#endif
|
||||
/* Add the content of the next line to that of the current one. */
|
||||
openfile->current->data = charealloc(openfile->current->data,
|
||||
strlen(openfile->current->data) + strlen(joining->data) + 1);
|
||||
strcat(openfile->current->data, joining->data);
|
||||
|
||||
unlink_node(joining);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP))
|
||||
openfile->current->extrarows = extra_chunks_in(openfile->current);
|
||||
#endif
|
||||
/* Two lines were joined, so do a renumbering and refresh the screen. */
|
||||
renumber_from(openfile->current);
|
||||
refresh_needed = TRUE;
|
||||
} else
|
||||
/* We're at the end-of-file: nothing to do. */
|
||||
@@ -101,14 +109,7 @@ void do_deletion(undo_type action)
|
||||
openfile->totsize--;
|
||||
#ifndef NANO_TINY
|
||||
openfile->current_undo->newsize = openfile->totsize;
|
||||
|
||||
/* If the number of screen rows that a softwrapped line occupies
|
||||
* has changed, we need a full refresh. */
|
||||
if (ISSET(SOFTWRAP) && refresh_needed == FALSE &&
|
||||
number_of_chunks_in(openfile->current) != old_amount)
|
||||
refresh_needed = TRUE;
|
||||
#endif
|
||||
|
||||
set_modified();
|
||||
}
|
||||
|
||||
@@ -120,7 +121,7 @@ void do_delete(void)
|
||||
zap_text();
|
||||
else
|
||||
#endif
|
||||
do_deletion(DEL);
|
||||
do_deletion(DEL);
|
||||
}
|
||||
|
||||
/* Backspace over one character. That is, move the cursor left one
|
||||
@@ -132,12 +133,38 @@ void do_backspace(void)
|
||||
zap_text();
|
||||
else
|
||||
#endif
|
||||
if (openfile->current != openfile->filetop || openfile->current_x > 0) {
|
||||
if (openfile->current_x > 0 || openfile->current != openfile->filetop) {
|
||||
do_left();
|
||||
do_deletion(BACK);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return FALSE when a cut command would not actually cut anything: when
|
||||
* on an empty line at EOF, or when the mark covers zero characters, or
|
||||
* (when test_cliff is TRUE) when the magic line would be cut. */
|
||||
bool is_cuttable(bool test_cliff)
|
||||
{
|
||||
size_t from = (test_cliff) ? openfile->current_x : 0;
|
||||
|
||||
if ((openfile->current->next == NULL && openfile->current->data[from] == '\0'
|
||||
#ifndef NANO_TINY
|
||||
&& openfile->mark == NULL) ||
|
||||
(openfile->mark == openfile->current &&
|
||||
openfile->mark_x == openfile->current_x) ||
|
||||
(from > 0 && !ISSET(NO_NEWLINES) &&
|
||||
openfile->current->data[from] == '\0' &&
|
||||
openfile->current->next == openfile->filebot
|
||||
#endif
|
||||
)) {
|
||||
#ifndef NANO_TINY
|
||||
statusbar(_("Nothing was cut"));
|
||||
openfile->mark = NULL;
|
||||
#endif
|
||||
return FALSE;
|
||||
} else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Delete text from the cursor until the first start of a word to
|
||||
* the left, or to the right when forward is TRUE. */
|
||||
@@ -165,7 +192,7 @@ void chop_word(bool forward)
|
||||
openfile->current_x = strlen(openfile->current->data);
|
||||
}
|
||||
} else {
|
||||
do_next_word(FALSE, ISSET(WORD_BOUNDS));
|
||||
do_next_word(ISSET(AFTER_ENDS), ISSET(WORD_BOUNDS));
|
||||
if (openfile->current != is_current &&
|
||||
is_current->data[is_current_x] != '\0') {
|
||||
openfile->current = is_current;
|
||||
@@ -183,7 +210,7 @@ void chop_word(bool forward)
|
||||
|
||||
/* Now kill the marked region and a word is gone. */
|
||||
add_undo(CUT, NULL);
|
||||
do_snip(FALSE, TRUE, FALSE, FALSE);
|
||||
do_snip(TRUE, FALSE, FALSE);
|
||||
update_undo(CUT);
|
||||
|
||||
/* Discard the cut word and restore the cutbuffer. */
|
||||
@@ -205,175 +232,287 @@ void chop_next_word(void)
|
||||
{
|
||||
openfile->mark = NULL;
|
||||
|
||||
if (is_cuttable(openfile->current_x > 0))
|
||||
if (is_cuttable(TRUE))
|
||||
chop_word(FORWARD);
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Move the whole current line from the current buffer to the cutbuffer. */
|
||||
void cut_line(void)
|
||||
/* Excise the text between the given two points and add it to the cutbuffer. */
|
||||
void extract_segment(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x)
|
||||
{
|
||||
/* When not on the last line of the buffer, move the text from the
|
||||
* head of this line to the head of the next line into the cutbuffer;
|
||||
* otherwise, move all of the text of this line into the cutbuffer. */
|
||||
if (openfile->current != openfile->filebot)
|
||||
extract(openfile->current, 0, openfile->current->next, 0);
|
||||
else
|
||||
extract(openfile->current, 0,
|
||||
openfile->current, strlen(openfile->current->data));
|
||||
linestruct *taken, *last;
|
||||
bool edittop_inside = (openfile->edittop->lineno >= top->lineno &&
|
||||
openfile->edittop->lineno <= bot->lineno);
|
||||
#ifndef NANO_TINY
|
||||
bool same_line = (openfile->mark == top);
|
||||
bool post_marked = (openfile->mark && (openfile->mark->lineno > top->lineno ||
|
||||
(same_line && openfile->mark_x > top_x)));
|
||||
bool was_anchored = top->has_anchor;
|
||||
|
||||
openfile->placewewant = 0;
|
||||
if (top == bot && top_x == bot_x)
|
||||
return;
|
||||
|
||||
if (top != bot)
|
||||
for (linestruct *line = top->next; line != bot->next; line = line->next)
|
||||
was_anchored |= line->has_anchor;
|
||||
#endif
|
||||
|
||||
if (top == bot) {
|
||||
taken = make_new_node(NULL);
|
||||
taken->data = measured_copy(top->data + top_x, bot_x - top_x);
|
||||
memmove(top->data + top_x, top->data + bot_x,
|
||||
strlen(top->data + bot_x) + 1);
|
||||
last = taken;
|
||||
} else if (top_x == 0 && bot_x == 0) {
|
||||
taken = top;
|
||||
last = make_new_node(NULL);
|
||||
last->data = copy_of("");
|
||||
|
||||
last->prev = bot->prev;
|
||||
bot->prev->next = last;
|
||||
last->next = NULL;
|
||||
|
||||
bot->prev = top->prev;
|
||||
if (top->prev)
|
||||
top->prev->next = bot;
|
||||
else
|
||||
openfile->filetop = bot;
|
||||
|
||||
openfile->current = bot;
|
||||
} else {
|
||||
taken = make_new_node(NULL);
|
||||
taken->data = copy_of(top->data + top_x);
|
||||
taken->next = top->next;
|
||||
top->next->prev = taken;
|
||||
|
||||
top->next = bot->next;
|
||||
if (bot->next)
|
||||
bot->next->prev = top;
|
||||
|
||||
top->data = charealloc(top->data, top_x + strlen(bot->data + bot_x) + 1);
|
||||
strcpy(top->data + top_x, bot->data + bot_x);
|
||||
|
||||
last = bot;
|
||||
last->data[bot_x] = '\0';
|
||||
last->next = NULL;
|
||||
|
||||
openfile->current = top;
|
||||
}
|
||||
|
||||
/* Subtract the size of the excised text from the buffer size. */
|
||||
openfile->totsize -= number_of_characters_in(taken, last);
|
||||
|
||||
/* If the cutbuffer is currently empty, just move all the text directly
|
||||
* into it; otherwise, append the text to what is already there. */
|
||||
if (cutbuffer == NULL) {
|
||||
cutbuffer = taken;
|
||||
cutbottom = last;
|
||||
} else {
|
||||
cutbottom->data = charealloc(cutbottom->data,
|
||||
strlen(cutbottom->data) + strlen(taken->data) + 1);
|
||||
strcat(cutbottom->data, taken->data);
|
||||
|
||||
cutbottom->next = taken->next;
|
||||
delete_node(taken);
|
||||
|
||||
if (cutbottom->next != NULL) {
|
||||
cutbottom->next->prev = cutbottom;
|
||||
cutbottom = last;
|
||||
}
|
||||
}
|
||||
|
||||
openfile->current_x = top_x;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
openfile->current->has_anchor = was_anchored;
|
||||
|
||||
if (ISSET(SOFTWRAP))
|
||||
openfile->current->extrarows = extra_chunks_in(openfile->current);
|
||||
|
||||
if (post_marked || same_line)
|
||||
openfile->mark = openfile->current;
|
||||
if (post_marked)
|
||||
openfile->mark_x = openfile->current_x;
|
||||
#endif
|
||||
if (openfile->filebot == bot)
|
||||
openfile->filebot = openfile->current;
|
||||
|
||||
renumber_from(openfile->current);
|
||||
|
||||
/* When the beginning of the viewport was inside the excision, adjust. */
|
||||
if (edittop_inside) {
|
||||
adjust_viewport(STATIONARY);
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
/* If the text doesn't end with a newline, and it should, add one. */
|
||||
if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0')
|
||||
new_magicline();
|
||||
}
|
||||
|
||||
/* Meld the buffer that starts at topline into the current file buffer
|
||||
* at the current cursor position. */
|
||||
void ingraft_buffer(linestruct *topline)
|
||||
{
|
||||
linestruct *line = openfile->current;
|
||||
size_t length = strlen(line->data);
|
||||
size_t extralen = strlen(topline->data);
|
||||
size_t xpos = openfile->current_x;
|
||||
char *tailtext = copy_of(line->data + xpos);
|
||||
#ifndef NANO_TINY
|
||||
bool mark_follows = (openfile->mark == line && !mark_is_before_cursor());
|
||||
#endif
|
||||
linestruct *botline = topline;
|
||||
|
||||
while (botline->next != NULL)
|
||||
botline = botline->next;
|
||||
|
||||
/* Add the size of the text to be grafted to the buffer size. */
|
||||
openfile->totsize += number_of_characters_in(topline, botline);
|
||||
|
||||
if (topline != botline)
|
||||
length = xpos;
|
||||
|
||||
if (extralen > 0) {
|
||||
/* Insert the text of topline at the current cursor position. */
|
||||
line->data = charealloc(line->data, length + extralen + 1);
|
||||
memmove(line->data + xpos + extralen, line->data + xpos, length - xpos + 1);
|
||||
strncpy(line->data + xpos, topline->data, extralen);
|
||||
}
|
||||
|
||||
if (topline != botline) {
|
||||
#ifndef NANO_TINY
|
||||
/* First compute the softwrapped chunks for each line in the graft. */
|
||||
compute_the_extra_rows_per_line_from(topline);
|
||||
#endif
|
||||
/* When inserting at end-of-buffer, update the relevant pointer. */
|
||||
if (line->next == NULL)
|
||||
openfile->filebot = botline;
|
||||
|
||||
line->data[xpos + extralen] = '\0';
|
||||
|
||||
/* Hook the grafted lines in after the current one. */
|
||||
botline->next = openfile->current->next;
|
||||
if (botline->next)
|
||||
botline->next->prev = botline;
|
||||
openfile->current->next = topline->next;
|
||||
topline->next->prev = openfile->current;
|
||||
|
||||
/* Add the text after the cursor position at the end of botline. */
|
||||
length = strlen(botline->data);
|
||||
extralen = strlen(tailtext);
|
||||
botline->data = charealloc(botline->data, length + extralen + 1);
|
||||
strcpy(botline->data + length, tailtext);
|
||||
|
||||
/* Put the cursor at the end of the grafted text. */
|
||||
openfile->current = botline;
|
||||
openfile->current_x = length;
|
||||
} else
|
||||
openfile->current_x += extralen;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* When needed, update the mark's pointer and position. */
|
||||
if (mark_follows && topline != botline) {
|
||||
openfile->mark = botline;
|
||||
openfile->mark_x += length - xpos;
|
||||
} else if (mark_follows)
|
||||
openfile->mark_x += extralen;
|
||||
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
line->extrarows = extra_chunks_in(line);
|
||||
openfile->current->extrarows = extra_chunks_in(openfile->current);
|
||||
}
|
||||
#endif
|
||||
|
||||
delete_node(topline);
|
||||
free(tailtext);
|
||||
|
||||
renumber_from(line);
|
||||
|
||||
/* If the text doesn't end with a newline, and it should, add one. */
|
||||
if (!ISSET(NO_NEWLINES) && openfile->filebot->data[0] != '\0')
|
||||
new_magicline();
|
||||
}
|
||||
|
||||
/* Meld a copy of the given buffer into the current file buffer. */
|
||||
void copy_from_buffer(linestruct *somebuffer)
|
||||
{
|
||||
linestruct *the_copy = copy_buffer(somebuffer);
|
||||
|
||||
ingraft_buffer(the_copy);
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Move all text from the cursor position until the end of this line into
|
||||
* the cutbuffer. But when already at the end of a line, then move this
|
||||
* "newline" to the cutbuffer. */
|
||||
void cut_to_eol(void)
|
||||
{
|
||||
size_t data_len = strlen(openfile->current->data);
|
||||
|
||||
/* When not at the end of a line, move the rest of this line into
|
||||
* the cutbuffer. Otherwise, when not at the end of the buffer,
|
||||
* move the line separation into the cutbuffer. */
|
||||
if (openfile->current_x < data_len)
|
||||
extract(openfile->current, openfile->current_x,
|
||||
openfile->current, data_len);
|
||||
else if (openfile->current != openfile->filebot) {
|
||||
extract(openfile->current, openfile->current_x,
|
||||
openfile->current->next, 0);
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
}
|
||||
|
||||
/* Move all marked text from the current buffer into the cutbuffer. */
|
||||
void cut_marked(bool *right_side_up)
|
||||
void cut_marked_region(void)
|
||||
{
|
||||
linestruct *top, *bot;
|
||||
size_t top_x, bot_x;
|
||||
|
||||
get_region((const linestruct **)&top, &top_x,
|
||||
(const linestruct **)&bot, &bot_x, right_side_up);
|
||||
get_region(&top, &top_x, &bot, &bot_x);
|
||||
|
||||
extract(top, top_x, bot, bot_x);
|
||||
extract_segment(top, top_x, bot, bot_x);
|
||||
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Move all text from the cursor position to end-of-file into the cutbuffer. */
|
||||
void cut_to_eof(void)
|
||||
{
|
||||
extract(openfile->current, openfile->current_x,
|
||||
openfile->filebot, strlen(openfile->filebot->data));
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Move text from the current buffer into the cutbuffer. If
|
||||
* copying is TRUE, copy the text back into the buffer afterward.
|
||||
/* Move text from the current buffer into the cutbuffer.
|
||||
* If until_eof is TRUE, move all text from the current cursor
|
||||
* position to the end of the file into the cutbuffer. If append
|
||||
* is TRUE (when zapping), always append the cut to the cutbuffer. */
|
||||
void do_snip(bool copying, bool marked, bool until_eof, bool append)
|
||||
void do_snip(bool marked, bool until_eof, bool append)
|
||||
{
|
||||
linestruct *line = openfile->current;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
linestruct *was_bottom = NULL;
|
||||
/* The current end of the cutbuffer, before we add text to it. */
|
||||
size_t botlen = 0;
|
||||
/* The length of the string at the current end of the cutbuffer,
|
||||
* before we add text to it. */
|
||||
bool using_magicline = !ISSET(NO_NEWLINES);
|
||||
/* Whether an automatic newline should be added at end-of-buffer. */
|
||||
bool right_side_up = TRUE;
|
||||
/* There *is* no region, *or* it is marked forward. */
|
||||
keep_cutbuffer &= (openfile->last_action != COPY);
|
||||
#endif
|
||||
static bool precedent = FALSE;
|
||||
/* Whether the previous operation was a copying operation. */
|
||||
|
||||
/* If cuts were not continuous, or when cutting a region, clear the slate. */
|
||||
if ((!keep_cutbuffer || marked || until_eof || copying != precedent) &&
|
||||
!append) {
|
||||
if ((marked || until_eof || !keep_cutbuffer) && !append) {
|
||||
free_lines(cutbuffer);
|
||||
cutbuffer = NULL;
|
||||
}
|
||||
|
||||
/* After a line operation, future ones should add to the cutbuffer. */
|
||||
keep_cutbuffer = !marked && !until_eof;
|
||||
precedent = copying;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (copying) {
|
||||
/* If the cutbuffer isn't empty, remember where it currently ends. */
|
||||
if (cutbuffer != NULL) {
|
||||
was_bottom = cutbottom;
|
||||
botlen = strlen(cutbottom->data);
|
||||
}
|
||||
/* Don't add a magic line when moving text to the cutbuffer. */
|
||||
SET(NO_NEWLINES);
|
||||
}
|
||||
|
||||
/* Now move the relevant piece of text into the cutbuffer. */
|
||||
if (until_eof)
|
||||
cut_to_eof();
|
||||
extract_segment(openfile->current, openfile->current_x,
|
||||
openfile->filebot, strlen(openfile->filebot->data));
|
||||
else if (openfile->mark) {
|
||||
cut_marked(&right_side_up);
|
||||
cut_marked_region();
|
||||
openfile->mark = NULL;
|
||||
} else if (ISSET(CUT_FROM_CURSOR))
|
||||
cut_to_eol();
|
||||
else
|
||||
#endif
|
||||
cut_line();
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (copying) {
|
||||
/* Copy the text that was put into the cutbuffer back into the current
|
||||
* file buffer, so that in the end nothing has been deleted. */
|
||||
if (cutbuffer != NULL) {
|
||||
if (was_bottom != NULL) {
|
||||
was_bottom->data += botlen;
|
||||
copy_from_buffer(was_bottom);
|
||||
was_bottom->data -= botlen;
|
||||
} else
|
||||
copy_from_buffer(cutbuffer);
|
||||
|
||||
/* 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();
|
||||
} else if (ISSET(CUT_FROM_CURSOR)) {
|
||||
/* When not at the end of a line, move the rest of this line into
|
||||
* the cutbuffer. Otherwise, when not at the end of the buffer,
|
||||
* move just the "line separator" into the cutbuffer. */
|
||||
if (openfile->current_x < strlen(openfile->current->data))
|
||||
extract_segment(line, openfile->current_x, line, strlen(line->data));
|
||||
else if (openfile->current != openfile->filebot) {
|
||||
extract_segment(line, openfile->current_x, line->next, 0);
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
/* Restore the magic-line behavior now that we're done fiddling. */
|
||||
if (using_magicline)
|
||||
UNSET(NO_NEWLINES);
|
||||
} else
|
||||
#endif
|
||||
set_modified();
|
||||
{
|
||||
/* When not at end-of-buffer, move one full line into the cutbuffer;
|
||||
* otherwise, move all text until end-of-line into the cutbuffer. */
|
||||
if (openfile->current != openfile->filebot)
|
||||
extract_segment(line, 0, line->next, 0);
|
||||
else
|
||||
extract_segment(line, 0, line, strlen(line->data));
|
||||
|
||||
openfile->placewewant = 0;
|
||||
}
|
||||
|
||||
/* After a line operation, future ones should add to the cutbuffer. */
|
||||
keep_cutbuffer = !marked && !until_eof;
|
||||
|
||||
set_modified();
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
/* Return FALSE when a cut command would not actually cut anything: when
|
||||
* on an empty line at EOF, or when the mark covers zero characters, or
|
||||
* (when test_cliff is TRUE) when the magic line would be cut. */
|
||||
bool is_cuttable(bool test_cliff)
|
||||
{
|
||||
if ((openfile->current->next == NULL && openfile->current->data[0] == '\0'
|
||||
#ifndef NANO_TINY
|
||||
&& openfile->mark == NULL) ||
|
||||
(openfile->mark == openfile->current &&
|
||||
openfile->mark_x == openfile->current_x) ||
|
||||
(test_cliff && openfile->current->data[openfile->current_x] == '\0' &&
|
||||
((ISSET(NO_NEWLINES) && openfile->current == openfile->filebot) ||
|
||||
(!ISSET(NO_NEWLINES) && openfile->current == openfile->filebot->prev))
|
||||
#endif
|
||||
)) {
|
||||
#ifndef NANO_TINY
|
||||
openfile->mark = NULL;
|
||||
#endif
|
||||
statusbar(_("Nothing was cut"));
|
||||
return FALSE;
|
||||
} else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Move text from the current buffer into the cutbuffer. */
|
||||
void cut_text(void)
|
||||
{
|
||||
@@ -388,56 +527,32 @@ void cut_text(void)
|
||||
add_undo(CUT, NULL);
|
||||
}
|
||||
|
||||
do_snip(FALSE, openfile->mark != NULL, FALSE, FALSE);
|
||||
do_snip(openfile->mark != NULL, FALSE, FALSE);
|
||||
|
||||
update_undo(CUT);
|
||||
#else
|
||||
if (is_cuttable(FALSE))
|
||||
do_snip(FALSE, FALSE, FALSE, FALSE);
|
||||
do_snip(FALSE, FALSE, FALSE);
|
||||
#endif
|
||||
wipe_statusbar();
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Move text from the current buffer into the cutbuffer, and copy it
|
||||
* back into the buffer afterward. If the mark is set or the cursor
|
||||
* was moved, blow away previous contents of the cutbuffer. */
|
||||
void copy_text(void)
|
||||
{
|
||||
bool mark_is_set = (openfile->mark != NULL);
|
||||
|
||||
/* Remember the current viewport and cursor position. */
|
||||
ssize_t is_edittop_lineno = openfile->edittop->lineno;
|
||||
size_t is_firstcolumn = openfile->firstcolumn;
|
||||
ssize_t is_current_lineno = openfile->current->lineno;
|
||||
size_t is_current_x = openfile->current_x;
|
||||
|
||||
do_snip(TRUE, mark_is_set, FALSE, FALSE);
|
||||
|
||||
/* If the mark was set, restore the viewport and cursor position. */
|
||||
if (mark_is_set) {
|
||||
openfile->edittop = line_from_number(is_edittop_lineno);
|
||||
openfile->firstcolumn = is_firstcolumn;
|
||||
openfile->current = line_from_number(is_current_lineno);
|
||||
openfile->current_x = is_current_x;
|
||||
} else
|
||||
focusing = FALSE;
|
||||
|
||||
openfile->last_action = OTHER;
|
||||
}
|
||||
|
||||
/* Cut from the current cursor position to the end of the file. */
|
||||
void cut_till_eof(void)
|
||||
{
|
||||
if ((openfile->current == openfile->filebot && openfile->current->data[0] == '\0') ||
|
||||
(!ISSET(NO_NEWLINES) && openfile->current->next == openfile->filebot &&
|
||||
openfile->current->data[openfile->current_x] == '\0')) {
|
||||
ran_a_tool = TRUE;
|
||||
|
||||
if (openfile->current->data[openfile->current_x] == '\0' &&
|
||||
(openfile->current->next == NULL ||
|
||||
(!ISSET(NO_NEWLINES) && openfile->current_x > 0 &&
|
||||
openfile->current->next == openfile->filebot))) {
|
||||
statusbar(_("Nothing was cut"));
|
||||
return;
|
||||
}
|
||||
|
||||
add_undo(CUT_TO_EOF, NULL);
|
||||
do_snip(FALSE, FALSE, TRUE, FALSE);
|
||||
do_snip(FALSE, TRUE, FALSE);
|
||||
update_undo(CUT_TO_EOF);
|
||||
wipe_statusbar();
|
||||
}
|
||||
@@ -459,13 +574,123 @@ void zap_text(void)
|
||||
/* Use the cutbuffer from the ZAP undo item, so the cut can be undone. */
|
||||
cutbuffer = openfile->current_undo->cutbuffer;
|
||||
|
||||
do_snip(FALSE, openfile->mark != NULL, FALSE, TRUE);
|
||||
do_snip(openfile->mark != NULL, FALSE, TRUE);
|
||||
|
||||
update_undo(ZAP);
|
||||
wipe_statusbar();
|
||||
|
||||
cutbuffer = was_cutbuffer;
|
||||
}
|
||||
|
||||
/* Make a copy of the marked region, putting it in the cutbuffer. */
|
||||
void copy_marked_region(void)
|
||||
{
|
||||
linestruct *topline, *botline, *afterline;
|
||||
char *was_datastart, saved_byte;
|
||||
size_t top_x, bot_x;
|
||||
|
||||
get_region(&topline, &top_x, &botline, &bot_x);
|
||||
|
||||
openfile->last_action = OTHER;
|
||||
keep_cutbuffer = FALSE;
|
||||
openfile->mark = NULL;
|
||||
refresh_needed = TRUE;
|
||||
|
||||
if (topline == botline && top_x == bot_x) {
|
||||
statusbar(_("Copied nothing"));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Make the area that was marked look like a separate buffer. */
|
||||
afterline = botline->next;
|
||||
botline->next = NULL;
|
||||
saved_byte = botline->data[bot_x];
|
||||
botline->data[bot_x] = '\0';
|
||||
was_datastart = topline->data;
|
||||
topline->data += top_x;
|
||||
|
||||
cutbuffer = copy_buffer(topline);
|
||||
|
||||
/* Restore the proper state of the buffer. */
|
||||
topline->data = was_datastart;
|
||||
botline->data[bot_x] = saved_byte;
|
||||
botline->next = afterline;
|
||||
}
|
||||
|
||||
/* Copy text from the current buffer into the cutbuffer. The text is either
|
||||
* the marked region, the whole line, the text from cursor to end-of-line,
|
||||
* just the line break, or nothing, depending on mode and cursor position. */
|
||||
void copy_text(void)
|
||||
{
|
||||
bool at_eol = (openfile->current->data[openfile->current_x] == '\0');
|
||||
bool sans_newline = (ISSET(NO_NEWLINES) && openfile->current->next == NULL);
|
||||
size_t from_x = (ISSET(CUT_FROM_CURSOR)) ? openfile->current_x : 0;
|
||||
linestruct *was_current = openfile->current;
|
||||
linestruct *addition;
|
||||
|
||||
if (openfile->mark || openfile->last_action != COPY || !keep_cutbuffer) {
|
||||
free_lines(cutbuffer);
|
||||
cutbuffer = NULL;
|
||||
}
|
||||
|
||||
wipe_statusbar();
|
||||
|
||||
if (openfile->mark) {
|
||||
copy_marked_region();
|
||||
return;
|
||||
}
|
||||
|
||||
/* When at the very end of the buffer, there is nothing to do. */
|
||||
if (openfile->current->next == NULL && at_eol && (ISSET(CUT_FROM_CURSOR) ||
|
||||
openfile->current_x == 0 || cutbuffer)) {
|
||||
statusbar(_("Copied nothing"));
|
||||
return;
|
||||
}
|
||||
|
||||
addition = make_new_node(NULL);
|
||||
addition->data = copy_of(openfile->current->data + from_x);
|
||||
|
||||
if (ISSET(CUT_FROM_CURSOR))
|
||||
sans_newline = !at_eol;
|
||||
|
||||
/* Create the cutbuffer OR add to it, depending on the mode, the position
|
||||
* of the cursor, and whether or not the cutbuffer is currently empty. */
|
||||
if (cutbuffer == NULL && sans_newline) {
|
||||
cutbuffer = addition;
|
||||
cutbottom = addition;
|
||||
} else if (cutbuffer == NULL) {
|
||||
cutbuffer = addition;
|
||||
cutbottom = make_new_node(cutbuffer);
|
||||
cutbottom->data = copy_of("");
|
||||
cutbuffer->next = cutbottom;
|
||||
} else if (sans_newline) {
|
||||
addition->prev = cutbottom->prev;
|
||||
addition->prev->next = addition;
|
||||
delete_node(cutbottom);
|
||||
cutbottom = addition;
|
||||
} else if (ISSET(CUT_FROM_CURSOR)) {
|
||||
addition->prev = cutbottom;
|
||||
cutbottom->next = addition;
|
||||
cutbottom = addition;
|
||||
} else {
|
||||
addition->prev = cutbottom->prev;
|
||||
addition->prev->next = addition;
|
||||
addition->next = cutbottom;
|
||||
cutbottom->prev = addition;
|
||||
}
|
||||
|
||||
/* When needed and possible, move the cursor to the next line. */
|
||||
if ((!ISSET(CUT_FROM_CURSOR) || at_eol) && openfile->current->next) {
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current_x = 0;
|
||||
} else
|
||||
openfile->current_x = strlen(openfile->current->data);
|
||||
|
||||
edit_redraw(was_current, FLOWING);
|
||||
|
||||
openfile->last_action = COPY;
|
||||
keep_cutbuffer = TRUE;
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Copy text from the cutbuffer into the current buffer. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**************************************************************************
|
||||
* nano.h -- This file is part of GNU nano. *
|
||||
* definitions.h -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 1999-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2014-2017 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
@@ -25,16 +25,16 @@
|
||||
|
||||
#ifdef NEED_XOPEN_SOURCE_EXTENDED
|
||||
#ifndef _XOPEN_SOURCE_EXTENDED
|
||||
#define _XOPEN_SOURCE_EXTENDED 1
|
||||
#define _XOPEN_SOURCE_EXTENDED 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __TANDEM
|
||||
/* Tandem NonStop Kernel support. */
|
||||
#include <floss.h>
|
||||
#define NANO_ROOT_UID 65535
|
||||
#define ROOT_UID 65535
|
||||
#else
|
||||
#define NANO_ROOT_UID 0
|
||||
#define ROOT_UID 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
@@ -46,30 +46,30 @@
|
||||
#endif
|
||||
|
||||
/* Suppress warnings for __attribute__((warn_unused_result)). */
|
||||
#define IGNORE_CALL_RESULT(call) do { if (call) {} } while(0)
|
||||
#define IGNORE_CALL_RESULT(call) do { if (call) {} } while(0)
|
||||
|
||||
/* Macros for flags, indexing each bit in a small array. */
|
||||
#define FLAGS(flag) flags[((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)
|
||||
#define TOGGLE(flag) FLAGS(flag) ^= FLAGMASK(flag)
|
||||
#define FLAGS(flag) flags[((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)
|
||||
#define TOGGLE(flag) FLAGS(flag) ^= FLAGMASK(flag)
|
||||
|
||||
/* Macros for allocation of character strings. */
|
||||
#define charalloc(howmuch) (char *)nmalloc(howmuch)
|
||||
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, howmuch)
|
||||
#define charalloc(howmuch) (char *)nmalloc(howmuch)
|
||||
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, howmuch)
|
||||
|
||||
/* In UTF-8 a character is at most six bytes long. */
|
||||
#ifdef ENABLE_UTF8
|
||||
#define MAXCHARLEN 6
|
||||
#define MAXCHARLEN 6
|
||||
#else
|
||||
#define MAXCHARLEN 1
|
||||
#define MAXCHARLEN 1
|
||||
#endif
|
||||
|
||||
/* Set a default value for PATH_MAX if there isn't one. */
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
#ifdef USE_SLANG
|
||||
@@ -77,8 +77,8 @@
|
||||
#include <slcurses.h>
|
||||
/* Slang curses emulation brain damage, part 3: Slang doesn't define the
|
||||
* curses equivalents of the Insert or Delete keys. */
|
||||
#define KEY_DC SL_KEY_DELETE
|
||||
#define KEY_IC SL_KEY_IC
|
||||
#define KEY_DC SL_KEY_DELETE
|
||||
#define KEY_IC SL_KEY_IC
|
||||
/* Ncurses support. */
|
||||
#elif defined(HAVE_NCURSESW_NCURSES_H)
|
||||
#include <ncursesw/ncurses.h>
|
||||
@@ -90,7 +90,7 @@
|
||||
#endif /* CURSES_H */
|
||||
|
||||
#if defined(NCURSES_VERSION_MAJOR) && (NCURSES_VERSION_MAJOR < 6)
|
||||
#define USING_OLD_NCURSES yes
|
||||
#define USING_OLD_NCURSES yes
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
@@ -98,14 +98,14 @@
|
||||
#ifdef HAVE_LIBINTL_H
|
||||
#include <libintl.h>
|
||||
#endif
|
||||
#define _(string) gettext(string)
|
||||
#define P_(singular, plural, number) ngettext(singular, plural, number)
|
||||
#define _(string) gettext(string)
|
||||
#define P_(singular, plural, number) ngettext(singular, plural, number)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#define P_(singular, plural, number) (number == 1 ? singular : plural)
|
||||
#define _(string) (string)
|
||||
#define P_(singular, plural, number) (number == 1 ? singular : plural)
|
||||
#endif
|
||||
#define gettext_noop(string) (string)
|
||||
#define N_(string) gettext_noop(string)
|
||||
#define gettext_noop(string) (string)
|
||||
#define N_(string) gettext_noop(string)
|
||||
/* Mark a string that will be sent to gettext() later. */
|
||||
|
||||
#include <dirent.h>
|
||||
@@ -121,22 +121,22 @@
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_WRAPPING) || defined(ENABLE_JUSTIFY)
|
||||
#define ENABLED_WRAPORJUSTIFY 1
|
||||
#define ENABLED_WRAPORJUSTIFY 1
|
||||
#endif
|
||||
|
||||
#define BACKWARD FALSE
|
||||
#define FORWARD TRUE
|
||||
#define BACKWARD FALSE
|
||||
#define FORWARD TRUE
|
||||
|
||||
#define BLIND FALSE
|
||||
#define VISIBLE TRUE
|
||||
#define BLIND FALSE
|
||||
#define VISIBLE TRUE
|
||||
|
||||
#define JUSTFIND 0
|
||||
#define REPLACING 1
|
||||
#define INREGION 2
|
||||
#define JUSTFIND 0
|
||||
#define REPLACING 1
|
||||
#define INREGION 2
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
#define USE_THE_DEFAULT -1
|
||||
#define BAD_COLOR -2
|
||||
#define THE_DEFAULT -1
|
||||
#define BAD_COLOR -2
|
||||
#endif
|
||||
|
||||
#define STANDARD_INPUT 0
|
||||
@@ -147,7 +147,7 @@ typedef enum {
|
||||
} format_type;
|
||||
|
||||
typedef enum {
|
||||
HUSH, NOTICE, MILD, ALERT
|
||||
VACUUM, HUSH, NOTICE, MILD, ALERT
|
||||
} message_type;
|
||||
|
||||
typedef enum {
|
||||
@@ -172,16 +172,19 @@ typedef enum {
|
||||
#ifdef ENABLE_COMMENT
|
||||
COMMENT, UNCOMMENT, PREFLIGHT,
|
||||
#endif
|
||||
ZAP, CUT, CUT_TO_EOF, PASTE, INSERT, COUPLE_BEGIN, COUPLE_END, OTHER
|
||||
ZAP, CUT, CUT_TO_EOF, COPY, PASTE, INSERT,
|
||||
COUPLE_BEGIN, COUPLE_END, OTHER
|
||||
} undo_type;
|
||||
|
||||
/* Structure types. */
|
||||
#ifdef ENABLE_COLOR
|
||||
typedef struct colortype {
|
||||
short id;
|
||||
/* An ordinal number (if this color combo is for a multiline regex). */
|
||||
short fg;
|
||||
/* This syntax's foreground color. */
|
||||
/* This combo's foreground color. */
|
||||
short bg;
|
||||
/* This syntax's background color. */
|
||||
/* This combo's background color. */
|
||||
short pairnum;
|
||||
/* The pair number for this foreground/background color combination. */
|
||||
int attributes;
|
||||
@@ -191,9 +194,7 @@ typedef struct colortype {
|
||||
regex_t *end;
|
||||
/* The compiled regular expression for 'end=', if any. */
|
||||
struct colortype *next;
|
||||
/* Next set of colors. */
|
||||
int id;
|
||||
/* Basic id for assigning to lines later. */
|
||||
/* Next color combination. */
|
||||
} colortype;
|
||||
|
||||
typedef struct regexlisttype {
|
||||
@@ -241,7 +242,7 @@ typedef struct syntaxtype {
|
||||
#endif
|
||||
colortype *color;
|
||||
/* The colors and their regexes used in this syntax. */
|
||||
int nmultis;
|
||||
short nmultis;
|
||||
/* How many multiline regex strings this syntax has. */
|
||||
struct syntaxtype *next;
|
||||
/* Next syntax. */
|
||||
@@ -283,6 +284,10 @@ typedef struct linestruct {
|
||||
/* The text of this line. */
|
||||
ssize_t lineno;
|
||||
/* The number of this line. */
|
||||
#ifndef NANO_TINY
|
||||
ssize_t extrarows;
|
||||
/* The extra rows that this line occupies when softwrapping. */
|
||||
#endif
|
||||
struct linestruct *next;
|
||||
/* Next node. */
|
||||
struct linestruct *prev;
|
||||
@@ -291,6 +296,10 @@ typedef struct linestruct {
|
||||
short *multidata;
|
||||
/* Array of which multi-line regexes apply to this line. */
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
bool has_anchor;
|
||||
/* Whether the user has placed an anchor at this line. */
|
||||
#endif
|
||||
} linestruct;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
@@ -310,9 +319,9 @@ typedef struct undostruct {
|
||||
/* The operation type that this undo item is for. */
|
||||
int xflags;
|
||||
/* Some flag data to mark certain corner cases. */
|
||||
ssize_t lineno;
|
||||
ssize_t head_lineno;
|
||||
/* The line number where the operation began or ended. */
|
||||
size_t begin;
|
||||
size_t head_x;
|
||||
/* The x position where the operation began or ended. */
|
||||
char *strdata;
|
||||
/* String data to help restore the affected line. */
|
||||
@@ -324,9 +333,9 @@ typedef struct undostruct {
|
||||
/* Undo info specific to groups of lines. */
|
||||
linestruct *cutbuffer;
|
||||
/* A copy of the cutbuffer. */
|
||||
ssize_t mark_begin_lineno;
|
||||
ssize_t tail_lineno;
|
||||
/* Mostly the line number of the current line; sometimes something else. */
|
||||
size_t mark_begin_x;
|
||||
size_t tail_x;
|
||||
/* The x position corresponding to the above line number. */
|
||||
struct undostruct *next;
|
||||
/* A pointer to the undo item of the preceding action. */
|
||||
@@ -368,8 +377,8 @@ typedef struct openfilestruct {
|
||||
/* The file's x position we would like. */
|
||||
ssize_t current_y;
|
||||
/* The file's y-coordinate position. */
|
||||
struct stat *current_stat;
|
||||
/* The file's current stat information. */
|
||||
struct stat *statinfo;
|
||||
/* The file's stat information from when it was opened or last saved. */
|
||||
#ifdef ENABLE_WRAPPING
|
||||
linestruct *spillage_line;
|
||||
/* The line for prepending stuff to during automatic hard-wrapping. */
|
||||
@@ -382,7 +391,7 @@ typedef struct openfilestruct {
|
||||
mark_type kind_of_mark;
|
||||
/* Whether it is a soft (with Shift) or a hard mark. */
|
||||
format_type fmt;
|
||||
/* The file's format -- Unix or DOS or Mac or mixed. */
|
||||
/* The file's format -- Unix or DOS or Mac. */
|
||||
char *lock_filename;
|
||||
/* The path of the lockfile, if we created one. */
|
||||
undostruct *undotop;
|
||||
@@ -398,9 +407,7 @@ typedef struct openfilestruct {
|
||||
/* Whether the file has been modified. */
|
||||
#ifdef ENABLE_COLOR
|
||||
syntaxtype *syntax;
|
||||
/* The syntax struct for this file, if any. */
|
||||
colortype *colorstrings;
|
||||
/* The file's associated colors. */
|
||||
/* The syntax that applies to this file, if any. */
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
struct openfilestruct *next;
|
||||
@@ -422,8 +429,6 @@ typedef struct rcoption {
|
||||
typedef struct keystruct {
|
||||
const char *keystr;
|
||||
/* The string that describes the 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;
|
||||
@@ -495,13 +500,13 @@ enum
|
||||
CASE_SENSITIVE,
|
||||
CONSTANT_SHOW,
|
||||
NO_HELP,
|
||||
SUSPEND,
|
||||
SUSPENDABLE,
|
||||
NO_WRAP,
|
||||
AUTOINDENT,
|
||||
VIEW_MODE,
|
||||
USE_MOUSE,
|
||||
USE_REGEXP,
|
||||
TEMP_FILE,
|
||||
SAVE_ON_EXIT,
|
||||
CUT_FROM_CURSOR,
|
||||
BACKWARDS_SEARCH,
|
||||
MULTIBUFFER,
|
||||
@@ -509,9 +514,9 @@ enum
|
||||
REBIND_DELETE,
|
||||
RAW_SEQUENCES,
|
||||
NO_CONVERT,
|
||||
BACKUP_FILE,
|
||||
MAKE_BACKUP,
|
||||
INSECURE_BACKUP,
|
||||
NO_COLOR_SYNTAX,
|
||||
NO_SYNTAX,
|
||||
PRESERVE,
|
||||
HISTORYLOG,
|
||||
RESTRICTED,
|
||||
@@ -537,7 +542,9 @@ enum
|
||||
LET_THEM_ZAP,
|
||||
BREAK_LONG_LINES,
|
||||
JUMPY_SCROLLING,
|
||||
EMPTY_LINE
|
||||
EMPTY_LINE,
|
||||
INDICATOR,
|
||||
BOOKSTYLE
|
||||
};
|
||||
|
||||
/* Flags for the menus in which a given function should be present. */
|
||||
@@ -548,7 +555,7 @@ enum
|
||||
#define MGOTOLINE (1<<4)
|
||||
#define MWRITEFILE (1<<5)
|
||||
#define MINSERTFILE (1<<6)
|
||||
#define MEXTCMD (1<<7)
|
||||
#define MEXECUTE (1<<7)
|
||||
#define MHELP (1<<8)
|
||||
#define MSPELL (1<<9)
|
||||
#define MBROWSER (1<<10)
|
||||
@@ -559,7 +566,7 @@ enum
|
||||
#define MFINDINHELP (1<<15)
|
||||
/* This is an abbreviation for all menus except Help and Browser and YesNo. */
|
||||
#define MMOST (MMAIN|MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MWRITEFILE|MINSERTFILE|\
|
||||
MEXTCMD|MWHEREISFILE|MGOTODIR|MFINDINHELP|MSPELL|MLINTER)
|
||||
MEXECUTE|MWHEREISFILE|MGOTODIR|MFINDINHELP|MSPELL|MLINTER)
|
||||
#ifndef NANO_TINY
|
||||
#define MSOME MMOST|MBROWSER
|
||||
#else
|
||||
@@ -567,85 +574,89 @@ enum
|
||||
#endif
|
||||
|
||||
/* Basic control codes. */
|
||||
#define BS_CODE 0x08
|
||||
#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 CONTROL_HOME 0x405
|
||||
#define CONTROL_END 0x406
|
||||
#define CONTROL_DELETE 0x40D
|
||||
#define SHIFT_CONTROL_LEFT 0x411
|
||||
#define SHIFT_CONTROL_RIGHT 0x412
|
||||
#define SHIFT_CONTROL_UP 0x413
|
||||
#define SHIFT_CONTROL_DOWN 0x414
|
||||
#define SHIFT_CONTROL_HOME 0x415
|
||||
#define SHIFT_CONTROL_END 0x416
|
||||
#define CONTROL_SHIFT_DELETE 0x41D
|
||||
#define ALT_LEFT 0x421
|
||||
#define ALT_RIGHT 0x422
|
||||
#define ALT_UP 0x423
|
||||
#define ALT_DOWN 0x424
|
||||
#define ALT_DELETE 0x42D
|
||||
#define SHIFT_ALT_LEFT 0x431
|
||||
#define SHIFT_ALT_RIGHT 0x432
|
||||
#define SHIFT_ALT_UP 0x433
|
||||
#define SHIFT_ALT_DOWN 0x434
|
||||
#define CONTROL_LEFT 0x401
|
||||
#define CONTROL_RIGHT 0x402
|
||||
#define CONTROL_UP 0x403
|
||||
#define CONTROL_DOWN 0x404
|
||||
#define CONTROL_HOME 0x405
|
||||
#define CONTROL_END 0x406
|
||||
#define CONTROL_DELETE 0x40D
|
||||
#define SHIFT_CONTROL_LEFT 0x411
|
||||
#define SHIFT_CONTROL_RIGHT 0x412
|
||||
#define SHIFT_CONTROL_UP 0x413
|
||||
#define SHIFT_CONTROL_DOWN 0x414
|
||||
#define SHIFT_CONTROL_HOME 0x415
|
||||
#define SHIFT_CONTROL_END 0x416
|
||||
#define CONTROL_SHIFT_DELETE 0x41D
|
||||
#define ALT_LEFT 0x421
|
||||
#define ALT_RIGHT 0x422
|
||||
#define ALT_UP 0x423
|
||||
#define ALT_DOWN 0x424
|
||||
#define ALT_PAGEUP 0x427
|
||||
#define ALT_PAGEDOWN 0x428
|
||||
#define ALT_INSERT 0x42C
|
||||
#define ALT_DELETE 0x42D
|
||||
#define SHIFT_ALT_LEFT 0x431
|
||||
#define SHIFT_ALT_RIGHT 0x432
|
||||
#define SHIFT_ALT_UP 0x433
|
||||
#define SHIFT_ALT_DOWN 0x434
|
||||
//#define SHIFT_LEFT 0x451
|
||||
//#define SHIFT_RIGHT 0x452
|
||||
#define SHIFT_UP 0x453
|
||||
#define SHIFT_DOWN 0x454
|
||||
#define SHIFT_HOME 0x455
|
||||
#define SHIFT_END 0x456
|
||||
#define SHIFT_PAGEUP 0x457
|
||||
#define SHIFT_PAGEDOWN 0x458
|
||||
#define SHIFT_DELETE 0x45D
|
||||
#define SHIFT_TAB 0x45F
|
||||
#define SHIFT_UP 0x453
|
||||
#define SHIFT_DOWN 0x454
|
||||
#define SHIFT_HOME 0x455
|
||||
#define SHIFT_END 0x456
|
||||
#define SHIFT_PAGEUP 0x457
|
||||
#define SHIFT_PAGEDOWN 0x458
|
||||
#define SHIFT_DELETE 0x45D
|
||||
#define SHIFT_TAB 0x45F
|
||||
|
||||
/* A special keycode for when <Tab> is pressed while the mark is on. */
|
||||
#define INDENT_KEY 0x4F1
|
||||
#define INDENT_KEY 0x4F1
|
||||
|
||||
/* A special keycode to signal the beginning and end of a bracketed paste. */
|
||||
#define BRACKETED_PASTE_MARKER 0x4FB
|
||||
|
||||
/* A special keycode for when a key produces an unknown escape sequence. */
|
||||
#define FOREIGN_SEQUENCE 0x4FC
|
||||
|
||||
#ifdef USE_SLANG
|
||||
#ifdef ENABLE_UTF8
|
||||
#define KEY_BAD 0xFF /* Clipped error code. */
|
||||
#define KEY_BAD 0xFF /* Clipped error code. */
|
||||
#endif
|
||||
#define KEY_FLUSH 0x91 /* User-definable control code. */
|
||||
#define KEY_FLUSH 0x91 /* User-definable control code. */
|
||||
#else
|
||||
#define KEY_FLUSH KEY_F0 /* Nonexistent function key. */
|
||||
#define KEY_FLUSH KEY_F0 /* Nonexistent function key. */
|
||||
#endif
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* An imaginary key for when we get a SIGWINCH (window resize). */
|
||||
#define KEY_WINCH -2
|
||||
#define KEY_WINCH -2
|
||||
|
||||
/* Some extra flags for the undo function. */
|
||||
#define WAS_FINAL_BACKSPACE (1<<1)
|
||||
#define WAS_BACKSPACE_AT_EOF (1<<1)
|
||||
#define WAS_WHOLE_LINE (1<<2)
|
||||
#define WAS_FINAL_LINE (1<<3)
|
||||
#define INCLUDED_LAST_LINE (1<<3)
|
||||
#define MARK_WAS_SET (1<<4)
|
||||
#define WAS_MARKED_FORWARD (1<<5)
|
||||
#define CURSOR_WAS_AT_HEAD (1<<5)
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* The default number of columns from end of line where wrapping occurs. */
|
||||
#define COLUMNS_FROM_EOL 8
|
||||
#define COLUMNS_FROM_EOL 8
|
||||
|
||||
/* The default width of a tab in spaces. */
|
||||
#define WIDTH_OF_TAB 8
|
||||
#define WIDTH_OF_TAB 8
|
||||
|
||||
/* The default comment character when a syntax does not specify any. */
|
||||
#define GENERAL_COMMENT_CHARACTER "#"
|
||||
#define GENERAL_COMMENT_CHARACTER "#"
|
||||
|
||||
/* The maximum number of search/replace history strings saved, not
|
||||
* counting the blank lines at their ends. */
|
||||
#define MAX_SEARCH_HISTORY 100
|
||||
|
||||
/* The maximum number of bytes buffered at one time. */
|
||||
#define MAX_BUF_SIZE 128
|
||||
#define MAX_SEARCH_HISTORY 100
|
||||
|
||||
/* The largest size_t number that doesn't have the high bit set. */
|
||||
#define HIGHEST_POSITIVE ((~(size_t)0) >> 1)
|
||||
#define HIGHEST_POSITIVE ((~(size_t)0) >> 1)
|
||||
1834
src/files.c
1834
src/files.c
File diff suppressed because it is too large
Load Diff
1086
src/global.c
1086
src/global.c
File diff suppressed because it is too large
Load Diff
543
src/help.c
543
src/help.c
@@ -1,9 +1,9 @@
|
||||
/**************************************************************************
|
||||
* help.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 2000-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2000-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2017 Rishabh Dave *
|
||||
* Copyright (C) 2014-2018 Benno Schulenberg *
|
||||
* Copyright (C) 2014-2019 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
@@ -20,7 +20,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#ifdef ENABLE_HELP
|
||||
|
||||
@@ -29,245 +29,15 @@
|
||||
|
||||
static char *help_text = NULL;
|
||||
/* The text displayed in the help window. */
|
||||
|
||||
static const char *start_of_body = NULL;
|
||||
/* The point in the help text just after the title. */
|
||||
|
||||
static char *end_of_intro = NULL;
|
||||
/* The point in the help text where the shortcut descriptions begin. */
|
||||
|
||||
static size_t location;
|
||||
/* The offset (in bytes) of the topleft of the shown help text. */
|
||||
|
||||
/* Hard-wrap the concatenated help text, and write it into a new buffer. */
|
||||
void wrap_help_text_into_buffer(void)
|
||||
{
|
||||
size_t sum = 0;
|
||||
const char *ptr = start_of_body;
|
||||
|
||||
make_new_buffer();
|
||||
|
||||
/* Copy the help text into the just-created new buffer. */
|
||||
while (*ptr != '\0') {
|
||||
int length = help_line_len(ptr);
|
||||
char *oneline = nmalloc(length + 1);
|
||||
|
||||
snprintf(oneline, length + 1, "%s", ptr);
|
||||
free(openfile->current->data);
|
||||
openfile->current->data = oneline;
|
||||
|
||||
ptr += length;
|
||||
if (*ptr != '\n')
|
||||
ptr--;
|
||||
|
||||
/* Create a new line, and then one more for each extra \n. */
|
||||
do {
|
||||
openfile->current->next = make_new_node(openfile->current);
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current->data = copy_of("");
|
||||
} while (*(++ptr) == '\n');
|
||||
}
|
||||
|
||||
openfile->filebot = openfile->current;
|
||||
openfile->current = openfile->filetop;
|
||||
|
||||
remove_magicline();
|
||||
#ifdef ENABLE_COLOR
|
||||
color_update();
|
||||
#endif
|
||||
prepare_for_display();
|
||||
|
||||
/* Move to the position in the file where we were before. */
|
||||
while (TRUE) {
|
||||
sum += strlen(openfile->current->data);
|
||||
if (sum > location)
|
||||
break;
|
||||
openfile->current = openfile->current->next;
|
||||
}
|
||||
|
||||
openfile->edittop = openfile->current;
|
||||
}
|
||||
|
||||
/* Our main help-viewer function. */
|
||||
void do_help(void)
|
||||
{
|
||||
int kbinput = ERR;
|
||||
functionptrtype func;
|
||||
/* The function of the key the user typed in. */
|
||||
int oldmenu = currmenu;
|
||||
/* The menu we were called from. */
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
int was_margin = margin;
|
||||
#endif
|
||||
ssize_t was_tabsize = tabsize;
|
||||
#ifdef ENABLE_COLOR
|
||||
char *was_syntax = syntaxstr;
|
||||
#endif
|
||||
char *saved_answer = (answer != NULL) ? copy_of(answer) : NULL;
|
||||
/* The current answer when the user invokes help at the prompt. */
|
||||
unsigned stash[sizeof(flags) / sizeof(flags[0])];
|
||||
/* A storage place for the current flag settings. */
|
||||
linestruct *line;
|
||||
int length;
|
||||
|
||||
blank_statusbar();
|
||||
|
||||
/* Save the settings of all flags. */
|
||||
memcpy(stash, flags, sizeof(flags));
|
||||
|
||||
/* Ensure that the help screen's shortcut list can be displayed. */
|
||||
if (ISSET(NO_HELP) && LINES > 4) {
|
||||
UNSET(NO_HELP);
|
||||
window_init();
|
||||
}
|
||||
|
||||
/* When searching, do it forward, case insensitive, and without regexes. */
|
||||
UNSET(BACKWARDS_SEARCH);
|
||||
UNSET(CASE_SENSITIVE);
|
||||
UNSET(USE_REGEXP);
|
||||
|
||||
UNSET(WHITESPACE_DISPLAY);
|
||||
UNSET(NOREAD_MODE);
|
||||
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
UNSET(LINE_NUMBERS);
|
||||
editwincols = COLS;
|
||||
margin = 0;
|
||||
#endif
|
||||
tabsize = 8;
|
||||
#ifdef ENABLE_COLOR
|
||||
syntaxstr = "nanohelp";
|
||||
#endif
|
||||
curs_set(0);
|
||||
|
||||
/* Compose the help text from all the pieces. */
|
||||
help_init();
|
||||
inhelp = TRUE;
|
||||
location = 0;
|
||||
didfind = 0;
|
||||
|
||||
bottombars(MHELP);
|
||||
|
||||
/* Extract the title from the head of the help text. */
|
||||
length = break_line(help_text, MAX_BUF_SIZE, TRUE);
|
||||
title = measured_copy(help_text, length + 1);
|
||||
title[length] = '\0';
|
||||
|
||||
titlebar(title);
|
||||
|
||||
/* Skip over the title to point at the start of the body text. */
|
||||
start_of_body = help_text + length;
|
||||
while (*start_of_body == '\n')
|
||||
start_of_body++;
|
||||
|
||||
wrap_help_text_into_buffer();
|
||||
edit_refresh();
|
||||
|
||||
while (TRUE) {
|
||||
lastmessage = HUSH;
|
||||
focusing = TRUE;
|
||||
|
||||
/* Show the cursor when we searched and found something. */
|
||||
kbinput = get_kbinput(edit, didfind == 1 || ISSET(SHOW_CURSOR));
|
||||
didfind = 0;
|
||||
|
||||
func = parse_help_input(&kbinput);
|
||||
|
||||
if (func == total_refresh) {
|
||||
total_redraw();
|
||||
} else if (ISSET(SHOW_CURSOR) && (func == do_left || func == do_right ||
|
||||
func == do_up || func == do_down)) {
|
||||
func();
|
||||
} else if (func == do_up || func == do_scroll_up) {
|
||||
do_scroll_up();
|
||||
} else if (func == do_down || func == do_scroll_down) {
|
||||
if (openfile->edittop->lineno + editwinrows - 1 <
|
||||
openfile->filebot->lineno)
|
||||
do_scroll_down();
|
||||
} else if (func == do_page_up || func == do_page_down ||
|
||||
func == to_first_line || func == to_last_line ||
|
||||
func == do_findprevious || func == do_findnext) {
|
||||
func();
|
||||
} else if (func == do_search_forward || func == do_search_backward) {
|
||||
func();
|
||||
bottombars(MHELP);
|
||||
#ifdef ENABLE_NANORC
|
||||
} else if (func == (functionptrtype)implant) {
|
||||
implant(first_sc_for(MHELP, func)->expansion);
|
||||
#endif
|
||||
#ifdef ENABLE_MOUSE
|
||||
} else if (kbinput == KEY_MOUSE) {
|
||||
int dummy_row, dummy_col;
|
||||
get_mouseinput(&dummy_row, &dummy_col, TRUE);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
} else if (kbinput == KEY_WINCH) {
|
||||
; /* Nothing to do. */
|
||||
#endif
|
||||
} else if (func == do_exit) {
|
||||
break;
|
||||
} else
|
||||
unbound_key(kbinput);
|
||||
|
||||
currmenu = MHELP;
|
||||
edit_refresh();
|
||||
|
||||
location = 0;
|
||||
line = openfile->filetop;
|
||||
|
||||
/* Count how far (in bytes) edittop is into the file. */
|
||||
while (line != openfile->edittop) {
|
||||
location += strlen(line->data);
|
||||
line = line->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* Discard the help-text buffer. */
|
||||
close_buffer();
|
||||
|
||||
/* Restore the settings of all flags. */
|
||||
memcpy(flags, stash, sizeof(flags));
|
||||
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
margin = was_margin;
|
||||
editwincols = COLS - margin;
|
||||
#endif
|
||||
tabsize = was_tabsize;
|
||||
#ifdef ENABLE_COLOR
|
||||
syntaxstr = was_syntax;
|
||||
have_palette = FALSE;
|
||||
#endif
|
||||
|
||||
free(title);
|
||||
title = NULL;
|
||||
free(answer);
|
||||
answer = saved_answer;
|
||||
free(help_text);
|
||||
inhelp = FALSE;
|
||||
|
||||
curs_set(0);
|
||||
|
||||
if (ISSET(NO_HELP)) {
|
||||
currmenu = oldmenu;
|
||||
window_init();
|
||||
} else {
|
||||
wipe_statusbar();
|
||||
bottombars(oldmenu);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_BROWSER
|
||||
if (oldmenu == MBROWSER || oldmenu == MWHEREISFILE || oldmenu == MGOTODIR)
|
||||
browser_refresh();
|
||||
else
|
||||
#endif
|
||||
{
|
||||
titlebar(NULL);
|
||||
edit_refresh();
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate space for the help text for the current menu, and concatenate
|
||||
* the different pieces of text into it. */
|
||||
/* Allocate space for the help text for the current menu,
|
||||
* and concatenate the different pieces of text into it. */
|
||||
void help_init(void)
|
||||
{
|
||||
size_t allocsize = 0;
|
||||
@@ -275,9 +45,9 @@ void help_init(void)
|
||||
const char *htx[3];
|
||||
/* Untranslated help introduction. We break it up into three chunks
|
||||
* in case the full string is too long for the compiler to handle. */
|
||||
char *ptr;
|
||||
const funcstruct *f;
|
||||
const keystruct *s;
|
||||
char *ptr;
|
||||
|
||||
/* First, set up the initial help text for the current function. */
|
||||
if (currmenu == MWHEREIS || currmenu == MREPLACE || currmenu == MREPLACEWITH) {
|
||||
@@ -387,7 +157,7 @@ void help_init(void)
|
||||
}
|
||||
#endif /* ENABLE_SPELLER */
|
||||
#ifndef NANO_TINY
|
||||
else if (currmenu == MEXTCMD) {
|
||||
else if (currmenu == MEXECUTE) {
|
||||
htx[0] = N_("Execute Command Help Text\n\n "
|
||||
"This mode allows you to insert the output of a "
|
||||
"command run by the shell into the current buffer (or "
|
||||
@@ -395,7 +165,8 @@ void help_init(void)
|
||||
"(the pipe symbol), the current contents of the buffer "
|
||||
"(or marked region) will be piped to the command. ");
|
||||
htx[1] = N_("If you just need another blank buffer, do not enter any "
|
||||
"command.\n\n");
|
||||
"command.\n\n You can also pick one of four tools, or cut a "
|
||||
"large piece of the buffer, or put the editor to sleep.\n\n");
|
||||
htx[2] = N_(" The following function keys are "
|
||||
"available in Execute Command mode:\n\n");
|
||||
} else if (currmenu == MLINTER) {
|
||||
@@ -448,9 +219,9 @@ void help_init(void)
|
||||
if (htx[2] != NULL)
|
||||
allocsize += strlen(htx[2]);
|
||||
|
||||
/* Calculate the length of the shortcut help text. Each entry has
|
||||
* one or two keys, which fill 17 cells, plus translated text,
|
||||
* plus one or two \n's. */
|
||||
/* Calculate the length of the descriptions of the shortcuts.
|
||||
* Each entry has one or two keystrokes, which fill 17 cells,
|
||||
* plus translated text, plus one or two \n's. */
|
||||
for (f = allfuncs; f != NULL; f = f->next)
|
||||
if (f->menus & currmenu)
|
||||
allocsize += strlen(_(f->help)) + 21;
|
||||
@@ -491,7 +262,7 @@ void help_init(void)
|
||||
|
||||
/* Show the first two shortcuts (if any) for each function. */
|
||||
for (s = sclist; s != NULL; s = s->next) {
|
||||
if ((s->menus & currmenu) && s->func == f->func) {
|
||||
if ((s->menus & currmenu) && s->func == f->func && s->keystr[0]) {
|
||||
/* Make the first column 7 cells wide and the second 10. */
|
||||
if (++tally == 1) {
|
||||
sprintf(ptr, "%s ", s->keystr);
|
||||
@@ -533,7 +304,7 @@ void help_init(void)
|
||||
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"));
|
||||
if (s->toggle == NO_COLOR_SYNTAX || s->toggle == TABS_TO_SPACES)
|
||||
if (s->toggle == NO_SYNTAX || s->toggle == TABS_TO_SPACES)
|
||||
ptr += sprintf(ptr, "\n");
|
||||
break;
|
||||
}
|
||||
@@ -542,72 +313,260 @@ void help_init(void)
|
||||
#endif /* !NANO_TINY */
|
||||
}
|
||||
|
||||
/* Return the function that is bound to the given key, accepting certain
|
||||
* plain characters too, for consistency with the file browser. */
|
||||
functionptrtype parse_help_input(int *kbinput)
|
||||
/* Hard-wrap the concatenated help text, and write it into a new buffer. */
|
||||
void wrap_help_text_into_buffer(void)
|
||||
{
|
||||
if (!meta_key) {
|
||||
switch (*kbinput) {
|
||||
case '-':
|
||||
return do_page_up;
|
||||
case ' ':
|
||||
return do_page_down;
|
||||
case 'W':
|
||||
case 'w':
|
||||
case '/':
|
||||
return do_search_forward;
|
||||
case 'N':
|
||||
return do_findprevious;
|
||||
case 'n':
|
||||
return do_findnext;
|
||||
case 'E':
|
||||
case 'e':
|
||||
case 'Q':
|
||||
case 'q':
|
||||
case 'X':
|
||||
case 'x':
|
||||
return do_exit;
|
||||
size_t sum = 0;
|
||||
/* Avoid overtight and overwide paragraphs in the introductory text. */
|
||||
size_t wrapping_point = ((COLS < 40) ? 40 : (COLS > 74) ? 74 : COLS) - thebar;
|
||||
const char *ptr = start_of_body;
|
||||
|
||||
make_new_buffer();
|
||||
|
||||
/* Copy the help text into the just-created new buffer. */
|
||||
while (*ptr != '\0') {
|
||||
int length, shim;
|
||||
char *oneline;
|
||||
|
||||
if (ptr == end_of_intro)
|
||||
wrapping_point = ((COLS < 40) ? 40 : COLS) - thebar;
|
||||
|
||||
if (ptr < end_of_intro || *(ptr - 1) == '\n') {
|
||||
length = break_line(ptr, wrapping_point, TRUE);
|
||||
oneline = nmalloc(length + 1);
|
||||
shim = (*(ptr + length - 1) == ' ') ? 0 : 1;
|
||||
snprintf(oneline, length + shim, "%s", ptr);
|
||||
} else {
|
||||
length = break_line(ptr, ((COLS < 40) ? 22 : COLS - 18) - thebar, TRUE);
|
||||
oneline = nmalloc(length + 5);
|
||||
snprintf(oneline, length + 5, "\t\t %s", ptr);
|
||||
}
|
||||
|
||||
free(openfile->current->data);
|
||||
openfile->current->data = oneline;
|
||||
|
||||
ptr += length;
|
||||
if (*ptr != '\n')
|
||||
ptr--;
|
||||
|
||||
/* Create a new line, and then one more for each extra \n. */
|
||||
do {
|
||||
openfile->current->next = make_new_node(openfile->current);
|
||||
openfile->current = openfile->current->next;
|
||||
openfile->current->data = copy_of("");
|
||||
} while (*(++ptr) == '\n');
|
||||
}
|
||||
return func_from_key(kbinput);
|
||||
|
||||
openfile->filebot = openfile->current;
|
||||
openfile->current = openfile->filetop;
|
||||
|
||||
remove_magicline();
|
||||
#ifdef ENABLE_COLOR
|
||||
find_and_prime_applicable_syntax();
|
||||
#endif
|
||||
prepare_for_display();
|
||||
|
||||
/* Move to the position in the file where we were before. */
|
||||
while (TRUE) {
|
||||
sum += strlen(openfile->current->data);
|
||||
if (sum > location)
|
||||
break;
|
||||
openfile->current = openfile->current->next;
|
||||
}
|
||||
|
||||
openfile->edittop = openfile->current;
|
||||
}
|
||||
|
||||
/* Calculate the displayable length of the help-text line starting at ptr. */
|
||||
size_t help_line_len(const char *ptr)
|
||||
/* Assemble a help text, display it, and allow scrolling through it. */
|
||||
void show_help(void)
|
||||
{
|
||||
size_t wrapping_point = (COLS > 24) ? COLS - 1 : 24;
|
||||
/* The target width for wrapping long lines. */
|
||||
ssize_t wrap_location;
|
||||
/* Actual position where the line can be wrapped. */
|
||||
size_t length = 0;
|
||||
/* Full length of the line, until the first newline. */
|
||||
int kbinput = ERR;
|
||||
functionptrtype func;
|
||||
/* The function of the key the user typed in. */
|
||||
int oldmenu = currmenu;
|
||||
/* The menu we were called from. */
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
int was_margin = margin;
|
||||
#endif
|
||||
ssize_t was_tabsize = tabsize;
|
||||
#ifdef ENABLE_COLOR
|
||||
char *was_syntax = syntaxstr;
|
||||
#endif
|
||||
char *saved_answer = (answer != NULL) ? copy_of(answer) : NULL;
|
||||
/* The current answer when the user invokes help at the prompt. */
|
||||
unsigned stash[sizeof(flags) / sizeof(flags[0])];
|
||||
/* A storage place for the current flag settings. */
|
||||
linestruct *line;
|
||||
int length;
|
||||
|
||||
/* Avoid overwide paragraphs in the introductory text. */
|
||||
if (ptr < end_of_intro && COLS > 74)
|
||||
wrapping_point = 74;
|
||||
/* Save the settings of all flags. */
|
||||
memcpy(stash, flags, sizeof(flags));
|
||||
|
||||
wrap_location = break_line(ptr, wrapping_point, TRUE);
|
||||
/* Ensure that the help screen's shortcut list can be displayed. */
|
||||
if (ISSET(NO_HELP) && LINES > 4) {
|
||||
UNSET(NO_HELP);
|
||||
window_init();
|
||||
} else
|
||||
blank_statusbar();
|
||||
|
||||
/* Get the length of the entire line up to a null or a newline. */
|
||||
while (*(ptr + length) != '\0' && *(ptr + length) != '\n')
|
||||
length = step_right(ptr, length);
|
||||
/* When searching, do it forward, case insensitive, and without regexes. */
|
||||
UNSET(BACKWARDS_SEARCH);
|
||||
UNSET(CASE_SENSITIVE);
|
||||
UNSET(USE_REGEXP);
|
||||
|
||||
/* If the entire line will just fit the screen, don't wrap it. */
|
||||
if (wideness(ptr, length) <= wrapping_point + 1)
|
||||
return length;
|
||||
else if (wrap_location > 0)
|
||||
return wrap_location;
|
||||
UNSET(WHITESPACE_DISPLAY);
|
||||
UNSET(NOREAD_MODE);
|
||||
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
UNSET(LINE_NUMBERS);
|
||||
editwincols = COLS - thebar;
|
||||
margin = 0;
|
||||
#endif
|
||||
tabsize = 8;
|
||||
#ifdef ENABLE_COLOR
|
||||
syntaxstr = "nanohelp";
|
||||
#endif
|
||||
curs_set(0);
|
||||
|
||||
/* Compose the help text from all the relevant pieces. */
|
||||
help_init();
|
||||
|
||||
inhelp = TRUE;
|
||||
location = 0;
|
||||
didfind = 0;
|
||||
|
||||
bottombars(MHELP);
|
||||
|
||||
/* Extract the title from the head of the help text. */
|
||||
length = break_line(help_text, HIGHEST_POSITIVE, TRUE);
|
||||
title = measured_copy(help_text, length);
|
||||
|
||||
titlebar(title);
|
||||
|
||||
/* Skip over the title to point at the start of the body text. */
|
||||
start_of_body = help_text + length;
|
||||
while (*start_of_body == '\n')
|
||||
start_of_body++;
|
||||
|
||||
wrap_help_text_into_buffer();
|
||||
edit_refresh();
|
||||
|
||||
while (TRUE) {
|
||||
lastmessage = VACUUM;
|
||||
focusing = TRUE;
|
||||
|
||||
/* Show the cursor when we searched and found something. */
|
||||
kbinput = get_kbinput(edit, didfind == 1 || ISSET(SHOW_CURSOR));
|
||||
didfind = 0;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (bracketed_paste || kbinput == BRACKETED_PASTE_MARKER) {
|
||||
beep();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
func = interpret(&kbinput);
|
||||
|
||||
if (func == full_refresh) {
|
||||
full_refresh();
|
||||
} else if (ISSET(SHOW_CURSOR) && (func == do_left || func == do_right ||
|
||||
func == do_up || func == do_down)) {
|
||||
func();
|
||||
} else if (func == do_up || func == do_scroll_up) {
|
||||
do_scroll_up();
|
||||
} else if (func == do_down || func == do_scroll_down) {
|
||||
if (openfile->edittop->lineno + editwinrows - 1 <
|
||||
openfile->filebot->lineno)
|
||||
do_scroll_down();
|
||||
} else if (func == do_page_up || func == do_page_down ||
|
||||
func == to_first_line || func == to_last_line ||
|
||||
func == do_findprevious || func == do_findnext) {
|
||||
func();
|
||||
} else if (func == do_search_forward || func == do_search_backward) {
|
||||
func();
|
||||
bottombars(MHELP);
|
||||
#ifdef ENABLE_NANORC
|
||||
} else if (func == (functionptrtype)implant) {
|
||||
implant(first_sc_for(MHELP, func)->expansion);
|
||||
#endif
|
||||
#ifdef ENABLE_MOUSE
|
||||
} else if (kbinput == KEY_MOUSE) {
|
||||
int dummy_row, dummy_col;
|
||||
get_mouseinput(&dummy_row, &dummy_col, TRUE);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
} else if (kbinput == KEY_WINCH) {
|
||||
; /* Nothing to do. */
|
||||
#endif
|
||||
} else if (func == do_exit) {
|
||||
break;
|
||||
} else
|
||||
unbound_key(kbinput);
|
||||
|
||||
currmenu = MHELP;
|
||||
edit_refresh();
|
||||
|
||||
location = 0;
|
||||
line = openfile->filetop;
|
||||
|
||||
/* Count how far (in bytes) edittop is into the file. */
|
||||
while (line != openfile->edittop) {
|
||||
location += strlen(line->data);
|
||||
line = line->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* Discard the help-text buffer. */
|
||||
close_buffer();
|
||||
|
||||
/* Restore the settings of all flags. */
|
||||
memcpy(flags, stash, sizeof(flags));
|
||||
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
margin = was_margin;
|
||||
editwincols = COLS - margin - thebar;
|
||||
#endif
|
||||
tabsize = was_tabsize;
|
||||
#ifdef ENABLE_COLOR
|
||||
syntaxstr = was_syntax;
|
||||
have_palette = FALSE;
|
||||
#endif
|
||||
|
||||
free(title);
|
||||
title = NULL;
|
||||
free(answer);
|
||||
answer = saved_answer;
|
||||
free(help_text);
|
||||
inhelp = FALSE;
|
||||
|
||||
curs_set(0);
|
||||
|
||||
if (ISSET(NO_HELP)) {
|
||||
currmenu = oldmenu;
|
||||
window_init();
|
||||
} else {
|
||||
blank_statusbar();
|
||||
bottombars(oldmenu);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_BROWSER
|
||||
if (oldmenu == MBROWSER || oldmenu == MWHEREISFILE || oldmenu == MGOTODIR)
|
||||
browser_refresh();
|
||||
else
|
||||
return 1;
|
||||
#endif
|
||||
{
|
||||
titlebar(NULL);
|
||||
edit_refresh();
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ENABLE_HELP */
|
||||
|
||||
/* Start the help viewer. */
|
||||
void do_help_void(void)
|
||||
/* Start the help viewer, or indicate that there is no help. */
|
||||
void do_help(void)
|
||||
{
|
||||
#ifdef ENABLE_HELP
|
||||
do_help();
|
||||
show_help();
|
||||
#else
|
||||
if (currmenu == MMAIN)
|
||||
say_there_is_no_help();
|
||||
|
||||
435
src/history.c
435
src/history.c
@@ -1,8 +1,8 @@
|
||||
/**************************************************************************
|
||||
* history.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 2003-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2016-2017 Benno Schulenberg *
|
||||
* Copyright (C) 2003-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2016, 2017, 2019 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
@@ -19,7 +19,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#ifdef ENABLE_HISTORIES
|
||||
|
||||
@@ -27,19 +27,19 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifndef SEARCH_HISTORY
|
||||
#define SEARCH_HISTORY "search_history"
|
||||
#define SEARCH_HISTORY "search_history"
|
||||
#endif
|
||||
|
||||
#ifndef POSITION_HISTORY
|
||||
#define POSITION_HISTORY "filepos_history"
|
||||
#define POSITION_HISTORY "filepos_history"
|
||||
#endif
|
||||
|
||||
static bool history_changed = FALSE;
|
||||
/* Whether any of the history lists has changed. */
|
||||
static struct stat stat_of_positions_file;
|
||||
/* The last-obtained stat information of the positions file. */
|
||||
static char *poshistname = NULL;
|
||||
/* The name of the positions-history file. */
|
||||
static time_t latest_timestamp = 942927132;
|
||||
/* The last time the positions-history file was written. */
|
||||
static poshiststruct *position_history = NULL;
|
||||
/* The list of filenames with their last cursor positions. */
|
||||
|
||||
@@ -178,53 +178,49 @@ void get_history_newer_void(void)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TABCOMP
|
||||
/* Move h to the next string that's a tab completion of the string s,
|
||||
* looking at only the first len characters of s, and return that
|
||||
* string. If there isn't one, or if len is 0, don't move h and return
|
||||
* s. */
|
||||
/* Go backward through one of three history lists, starting at its item h,
|
||||
* searching for a string that is a tab completion of the given string s,
|
||||
* looking at only the first len characters of s. When found, make h point
|
||||
* at it and return that string; otherwise, don't move h and return s. */
|
||||
char *get_history_completion(linestruct **h, char *s, size_t len)
|
||||
{
|
||||
if (len > 0) {
|
||||
linestruct *htop = NULL, *hbot = NULL, *p;
|
||||
linestruct *htop = NULL, *hbot = NULL, *p;
|
||||
|
||||
if (*h == search_history) {
|
||||
htop = searchtop;
|
||||
hbot = searchbot;
|
||||
} else if (*h == replace_history) {
|
||||
htop = replacetop;
|
||||
hbot = replacebot;
|
||||
} else if (*h == execute_history) {
|
||||
htop = executetop;
|
||||
hbot = executebot;
|
||||
}
|
||||
|
||||
/* Search the history list from the current position to the top
|
||||
* for a match of len characters. Skip over an exact match. */
|
||||
p = find_history((*h)->prev, htop, s, len);
|
||||
|
||||
while (p != NULL && strcmp(p->data, s) == 0)
|
||||
p = find_history(p->prev, htop, s, len);
|
||||
|
||||
if (p != NULL) {
|
||||
*h = p;
|
||||
return mallocstrcpy(s, (*h)->data);
|
||||
}
|
||||
|
||||
/* Search the history list from the bottom to the current position
|
||||
* for a match of len characters. Skip over an exact match. */
|
||||
p = find_history(hbot, *h, s, len);
|
||||
|
||||
while (p != NULL && strcmp(p->data, s) == 0)
|
||||
p = find_history(p->prev, *h, s, len);
|
||||
|
||||
if (p != NULL) {
|
||||
*h = p;
|
||||
return mallocstrcpy(s, (*h)->data);
|
||||
}
|
||||
if (*h == search_history) {
|
||||
htop = searchtop;
|
||||
hbot = searchbot;
|
||||
} else if (*h == replace_history) {
|
||||
htop = replacetop;
|
||||
hbot = replacebot;
|
||||
} else if (*h == execute_history) {
|
||||
htop = executetop;
|
||||
hbot = executebot;
|
||||
}
|
||||
|
||||
/* If we're here, we didn't find a match, we didn't find an inexact
|
||||
* match, or len is 0. Return s. */
|
||||
/* First search from the current position to the top of the list
|
||||
* for a match of len characters. Skip over an exact match. */
|
||||
p = find_history((*h)->prev, htop, s, len);
|
||||
|
||||
while (p != NULL && strcmp(p->data, s) == 0)
|
||||
p = find_history(p->prev, htop, s, len);
|
||||
|
||||
if (p != NULL) {
|
||||
*h = p;
|
||||
return mallocstrcpy(s, (*h)->data);
|
||||
}
|
||||
|
||||
/* Now search from the bottom of the list to the original position. */
|
||||
p = find_history(hbot, *h, s, len);
|
||||
|
||||
while (p != NULL && strcmp(p->data, s) == 0)
|
||||
p = find_history(p->prev, *h, s, len);
|
||||
|
||||
if (p != NULL) {
|
||||
*h = p;
|
||||
return mallocstrcpy(s, (*h)->data);
|
||||
}
|
||||
|
||||
/* When no useful match was found, simply return the given string. */
|
||||
return (char *)s;
|
||||
}
|
||||
#endif /* ENABLE_TABCOMP */
|
||||
@@ -285,53 +281,54 @@ bool have_statedir(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Load the histories for Search and Replace and Execute Command. */
|
||||
/* Load the histories for Search, Replace With, and Execute Command. */
|
||||
void load_history(void)
|
||||
{
|
||||
char *histname = concatenate(statedir, SEARCH_HISTORY);
|
||||
FILE *hisfile = fopen(histname, "rb");
|
||||
FILE *histfile = fopen(histname, "rb");
|
||||
|
||||
if (hisfile == NULL) {
|
||||
if (errno != ENOENT) {
|
||||
/* When reading failed, don't save history when we quit. */
|
||||
UNSET(HISTORYLOG);
|
||||
jot_error(N_("Error reading %s: %s"), histname,
|
||||
strerror(errno));
|
||||
}
|
||||
} else {
|
||||
/* Load the three history lists -- first search, then replace,
|
||||
* then execute -- from oldest entry to newest. Between two
|
||||
* lists there is an empty line. */
|
||||
linestruct **history = &search_history;
|
||||
char *line = NULL;
|
||||
size_t buf_len = 0;
|
||||
ssize_t read;
|
||||
|
||||
while ((read = getline(&line, &buf_len, hisfile)) > 0) {
|
||||
line[--read] = '\0';
|
||||
if (read > 0) {
|
||||
/* Encode any embedded NUL as 0x0A. */
|
||||
unsunder(line, read);
|
||||
update_history(history, line);
|
||||
} else if (history == &search_history)
|
||||
history = &replace_history;
|
||||
else
|
||||
history = &execute_history;
|
||||
}
|
||||
|
||||
fclose(hisfile);
|
||||
free(line);
|
||||
/* If reading an existing file failed, don't save history when we quit. */
|
||||
if (histfile == NULL && errno != ENOENT) {
|
||||
jot_error(N_("Error reading %s: %s"), histname, strerror(errno));
|
||||
UNSET(HISTORYLOG);
|
||||
}
|
||||
|
||||
/* After reading them in, set the status of the lists to "unchanged". */
|
||||
history_changed = FALSE;
|
||||
if (histfile == NULL) {
|
||||
free(histname);
|
||||
return;
|
||||
}
|
||||
|
||||
linestruct **history = &search_history;
|
||||
char *line = NULL;
|
||||
size_t buf_len = 0;
|
||||
ssize_t read;
|
||||
|
||||
/* Load the three history lists (first search, then replace, then execute)
|
||||
* from oldest entry to newest. Between two lists there is an empty line. */
|
||||
while ((read = getline(&line, &buf_len, histfile)) > 0) {
|
||||
line[--read] = '\0';
|
||||
if (read > 0) {
|
||||
recode_NUL_to_LF(line, read);
|
||||
update_history(history, line);
|
||||
} else if (history == &search_history)
|
||||
history = &replace_history;
|
||||
else
|
||||
history = &execute_history;
|
||||
}
|
||||
|
||||
if (fclose(histfile) == EOF)
|
||||
jot_error(N_("Error reading %s: %s"), histname, strerror(errno));
|
||||
|
||||
free(histname);
|
||||
free(line);
|
||||
|
||||
/* Reading in the lists has marked them as changed; undo this side effect. */
|
||||
history_changed = FALSE;
|
||||
}
|
||||
|
||||
/* Write the lines of a history list, starting at head, from oldest to newest,
|
||||
* to the given file. Return TRUE if writing succeeded, and FALSE otherwise. */
|
||||
bool write_list(const linestruct *head, FILE *hisfile)
|
||||
bool write_list(const linestruct *head, FILE *histfile)
|
||||
{
|
||||
const linestruct *item;
|
||||
|
||||
@@ -339,183 +336,199 @@ bool write_list(const linestruct *head, FILE *hisfile)
|
||||
size_t length = strlen(item->data);
|
||||
|
||||
/* Decode 0x0A bytes as embedded NULs. */
|
||||
sunder(item->data);
|
||||
recode_LF_to_NUL(item->data);
|
||||
|
||||
if (fwrite(item->data, sizeof(char), length, hisfile) < length)
|
||||
if (fwrite(item->data, sizeof(char), length, histfile) < length)
|
||||
return FALSE;
|
||||
if (putc('\n', hisfile) == EOF)
|
||||
if (putc('\n', histfile) == EOF)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Save the histories for Search and Replace and Execute Command. */
|
||||
/* Save the histories for Search, Replace With, and Execute Command. */
|
||||
void save_history(void)
|
||||
{
|
||||
char *histname;
|
||||
FILE *hisfile;
|
||||
FILE *histfile;
|
||||
|
||||
/* If the histories are unchanged, don't bother saving them. */
|
||||
if (!history_changed)
|
||||
return;
|
||||
|
||||
histname = concatenate(statedir, SEARCH_HISTORY);
|
||||
hisfile = fopen(histname, "wb");
|
||||
histfile = fopen(histname, "wb");
|
||||
|
||||
if (hisfile == NULL)
|
||||
fprintf(stderr, _("Error writing %s: %s\n"), histname,
|
||||
strerror(errno));
|
||||
else {
|
||||
/* Don't allow others to read or write the history file. */
|
||||
chmod(histname, S_IRUSR | S_IWUSR);
|
||||
|
||||
if (!write_list(searchtop, hisfile) ||
|
||||
!write_list(replacetop, hisfile) ||
|
||||
!write_list(executetop, hisfile))
|
||||
fprintf(stderr, _("Error writing %s: %s\n"), histname,
|
||||
strerror(errno));
|
||||
|
||||
fclose(hisfile);
|
||||
if (histfile == NULL) {
|
||||
jot_error(N_("Error writing %s: %s\n"), histname, strerror(errno));
|
||||
free(histname);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't allow others to read or write the history file. */
|
||||
chmod(histname, S_IRUSR | S_IWUSR);
|
||||
|
||||
if (!write_list(searchtop, histfile) || !write_list(replacetop, histfile) ||
|
||||
!write_list(executetop, histfile))
|
||||
jot_error(N_("Error writing %s: %s\n"), histname, strerror(errno));
|
||||
|
||||
if (fclose(histfile) == EOF)
|
||||
jot_error(N_("Error writing %s: %s\n"), histname, strerror(errno));
|
||||
|
||||
free(histname);
|
||||
}
|
||||
|
||||
/* Load the recorded cursor positions for files that were edited. */
|
||||
void load_poshistory(void)
|
||||
{
|
||||
FILE *hisfile = fopen(poshistname, "rb");
|
||||
FILE *histfile = fopen(poshistname, "rb");
|
||||
|
||||
if (hisfile == NULL) {
|
||||
if (errno != ENOENT) {
|
||||
/* When reading failed, don't save history when we quit. */
|
||||
UNSET(POSITIONLOG);
|
||||
jot_error(N_("Error reading %s: %s"), poshistname, strerror(errno));
|
||||
}
|
||||
} else {
|
||||
char *line = NULL, *lineptr, *xptr;
|
||||
size_t buf_len = 0;
|
||||
ssize_t read, count = 0;
|
||||
poshiststruct *record_ptr = NULL, *newrecord;
|
||||
|
||||
/* Read and parse each line, and store the extracted data. */
|
||||
while ((read = getline(&line, &buf_len, hisfile)) > 5) {
|
||||
/* Decode NULs as embedded newlines. */
|
||||
unsunder(line, read);
|
||||
|
||||
/* Find where the x index and line number are in the line. */
|
||||
xptr = revstrstr(line, " ", line + read - 3);
|
||||
if (xptr == NULL)
|
||||
continue;
|
||||
lineptr = revstrstr(line, " ", xptr - 2);
|
||||
if (lineptr == NULL)
|
||||
continue;
|
||||
|
||||
/* Now separate the three elements of the line. */
|
||||
*(xptr++) = '\0';
|
||||
*(lineptr++) = '\0';
|
||||
|
||||
/* Create a new position record. */
|
||||
newrecord = (poshiststruct *)nmalloc(sizeof(poshiststruct));
|
||||
newrecord->filename = copy_of(line);
|
||||
newrecord->lineno = atoi(lineptr);
|
||||
newrecord->xno = atoi(xptr);
|
||||
newrecord->next = NULL;
|
||||
|
||||
/* Add the record to the list. */
|
||||
if (position_history == NULL)
|
||||
position_history = newrecord;
|
||||
else
|
||||
record_ptr->next = newrecord;
|
||||
|
||||
record_ptr = newrecord;
|
||||
|
||||
/* Impose a limit, so the file will not grow indefinitely. */
|
||||
if (++count > 200) {
|
||||
poshiststruct *drop_record = position_history;
|
||||
|
||||
position_history = position_history->next;
|
||||
|
||||
free(drop_record->filename);
|
||||
free(drop_record);
|
||||
}
|
||||
}
|
||||
fclose(hisfile);
|
||||
free(line);
|
||||
|
||||
stat(poshistname, &stat_of_positions_file);
|
||||
/* If reading an existing file failed, don't save history when we quit. */
|
||||
if (histfile == NULL && errno != ENOENT) {
|
||||
jot_error(N_("Error reading %s: %s"), poshistname, strerror(errno));
|
||||
UNSET(POSITIONLOG);
|
||||
}
|
||||
|
||||
if (histfile == NULL)
|
||||
return;
|
||||
|
||||
char *line = NULL, *lineptr, *xptr;
|
||||
size_t buf_len = 0;
|
||||
ssize_t read, count = 0;
|
||||
struct stat fileinfo;
|
||||
poshiststruct *record_ptr = NULL, *newrecord;
|
||||
|
||||
/* Read and parse each line, and store the extracted data. */
|
||||
while ((read = getline(&line, &buf_len, histfile)) > 5) {
|
||||
/* Decode NULs as embedded newlines. */
|
||||
recode_NUL_to_LF(line, read);
|
||||
|
||||
/* Find where the x index and line number are in the line. */
|
||||
xptr = revstrstr(line, " ", line + read - 3);
|
||||
if (xptr == NULL)
|
||||
continue;
|
||||
lineptr = revstrstr(line, " ", xptr - 2);
|
||||
if (lineptr == NULL)
|
||||
continue;
|
||||
|
||||
/* Now separate the three elements of the line. */
|
||||
*(xptr++) = '\0';
|
||||
*(lineptr++) = '\0';
|
||||
|
||||
/* Create a new position record. */
|
||||
newrecord = (poshiststruct *)nmalloc(sizeof(poshiststruct));
|
||||
newrecord->filename = copy_of(line);
|
||||
newrecord->lineno = atoi(lineptr);
|
||||
newrecord->xno = atoi(xptr);
|
||||
newrecord->next = NULL;
|
||||
|
||||
/* Add the record to the list. */
|
||||
if (position_history == NULL)
|
||||
position_history = newrecord;
|
||||
else
|
||||
record_ptr->next = newrecord;
|
||||
|
||||
record_ptr = newrecord;
|
||||
|
||||
/* Impose a limit, so the file will not grow indefinitely. */
|
||||
if (++count > 200) {
|
||||
poshiststruct *drop_record = position_history;
|
||||
|
||||
position_history = position_history->next;
|
||||
|
||||
free(drop_record->filename);
|
||||
free(drop_record);
|
||||
}
|
||||
}
|
||||
|
||||
if (fclose(histfile) == EOF)
|
||||
jot_error(N_("Error reading %s: %s"), poshistname, strerror(errno));
|
||||
|
||||
free(line);
|
||||
|
||||
if (stat(poshistname, &fileinfo) == -1)
|
||||
jot_error(N_("Error reading %s: %s\n"), poshistname, strerror(errno));
|
||||
else
|
||||
latest_timestamp = fileinfo.st_mtime;
|
||||
}
|
||||
|
||||
/* Save the recorded cursor positions for files that were edited. */
|
||||
void save_poshistory(void)
|
||||
{
|
||||
poshiststruct *posptr;
|
||||
FILE *hisfile = fopen(poshistname, "wb");
|
||||
struct stat fileinfo;
|
||||
FILE *histfile = fopen(poshistname, "wb");
|
||||
|
||||
if (hisfile == NULL)
|
||||
fprintf(stderr, _("Error writing %s: %s\n"), poshistname, strerror(errno));
|
||||
else {
|
||||
/* Don't allow others to read or write the history file. */
|
||||
chmod(poshistname, S_IRUSR | S_IWUSR);
|
||||
|
||||
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
|
||||
char *path_and_place;
|
||||
size_t length;
|
||||
|
||||
/* Assume 20 decimal positions each for line and column number,
|
||||
* plus two spaces, plus the line feed, plus the null byte. */
|
||||
path_and_place = charalloc(strlen(posptr->filename) + 44);
|
||||
sprintf(path_and_place, "%s %zd %zd\n",
|
||||
posptr->filename, posptr->lineno, posptr->xno);
|
||||
length = strlen(path_and_place);
|
||||
|
||||
/* Encode newlines in filenames as NULs. */
|
||||
sunder(path_and_place);
|
||||
/* Restore the terminating newline. */
|
||||
path_and_place[length - 1] = '\n';
|
||||
|
||||
if (fwrite(path_and_place, sizeof(char), length, hisfile) < length)
|
||||
fprintf(stderr, _("Error writing %s: %s\n"),
|
||||
poshistname, strerror(errno));
|
||||
free(path_and_place);
|
||||
}
|
||||
fclose(hisfile);
|
||||
|
||||
stat(poshistname, &stat_of_positions_file);
|
||||
if (histfile == NULL) {
|
||||
jot_error(N_("Error writing %s: %s\n"), poshistname, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't allow others to read or write the history file. */
|
||||
chmod(poshistname, S_IRUSR | S_IWUSR);
|
||||
|
||||
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
|
||||
char *path_and_place;
|
||||
size_t length;
|
||||
|
||||
/* Assume 20 decimal positions each for line and column number,
|
||||
* plus two spaces, plus the line feed, plus the null byte. */
|
||||
path_and_place = charalloc(strlen(posptr->filename) + 44);
|
||||
sprintf(path_and_place, "%s %zd %zd\n",
|
||||
posptr->filename, posptr->lineno, posptr->xno);
|
||||
length = strlen(path_and_place);
|
||||
|
||||
/* Encode newlines in filenames as NULs. */
|
||||
recode_LF_to_NUL(path_and_place);
|
||||
/* Restore the terminating newline. */
|
||||
path_and_place[length - 1] = '\n';
|
||||
|
||||
if (fwrite(path_and_place, sizeof(char), length, histfile) < length)
|
||||
jot_error(N_("Error writing %s: %s\n"), poshistname, strerror(errno));
|
||||
|
||||
free(path_and_place);
|
||||
}
|
||||
|
||||
if (fclose(histfile) == EOF)
|
||||
jot_error(N_("Error writing %s: %s\n"), poshistname, strerror(errno));
|
||||
|
||||
if (stat(poshistname, &fileinfo) == -1)
|
||||
jot_error(N_("Error writing %s: %s\n"), poshistname, strerror(errno));
|
||||
else
|
||||
latest_timestamp = fileinfo.st_mtime;
|
||||
}
|
||||
|
||||
/* Reload the position history file if it has been modified since last load. */
|
||||
void reload_positions_if_needed(void)
|
||||
{
|
||||
struct stat newstat;
|
||||
struct stat fileinfo;
|
||||
|
||||
stat(poshistname, &newstat);
|
||||
if (stat(poshistname, &fileinfo) == -1)
|
||||
jot_error(N_("Error reading %s: %s\n"), poshistname, strerror(errno));
|
||||
else if (fileinfo.st_mtime != latest_timestamp) {
|
||||
poshiststruct *item, *nextone;
|
||||
|
||||
if (newstat.st_mtime != stat_of_positions_file.st_mtime) {
|
||||
poshiststruct *ptr, *nextone;
|
||||
|
||||
for (ptr = position_history; ptr != NULL; ptr = nextone) {
|
||||
nextone = ptr->next;
|
||||
free(ptr->filename);
|
||||
free(ptr);
|
||||
for (item = position_history; item != NULL; item = nextone) {
|
||||
nextone = item->next;
|
||||
free(item->filename);
|
||||
free(item);
|
||||
}
|
||||
|
||||
position_history = NULL;
|
||||
|
||||
load_poshistory();
|
||||
}
|
||||
}
|
||||
|
||||
/* Update the recorded last file positions, given a filename, a line
|
||||
* and a column. If no entry is found, add a new one at the end. */
|
||||
void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
|
||||
/* Update the recorded last file positions with the current position in the
|
||||
* current buffer. If no existing entry is found, add a new one at the end. */
|
||||
void update_poshistory(void)
|
||||
{
|
||||
poshiststruct *posptr, *theone, *posprev = NULL;
|
||||
char *fullpath = get_full_path(filename);
|
||||
char *fullpath = get_full_path(openfile->filename);
|
||||
|
||||
if (fullpath == NULL || *filename == '\0') {
|
||||
if (fullpath == NULL || openfile->filename[0] == '\0') {
|
||||
free(fullpath);
|
||||
return;
|
||||
}
|
||||
@@ -530,7 +543,7 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
|
||||
}
|
||||
|
||||
/* Don't record files that have the default cursor position. */
|
||||
if (lineno == 1 && xpos == 1) {
|
||||
if (openfile->current->lineno == 1 && openfile->current_x == 0) {
|
||||
if (posptr != NULL) {
|
||||
if (posprev == NULL)
|
||||
position_history = posptr->next;
|
||||
@@ -566,8 +579,8 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
|
||||
}
|
||||
|
||||
/* Store the last cursor position. */
|
||||
theone->lineno = lineno;
|
||||
theone->xno = xpos;
|
||||
theone->lineno = openfile->current->lineno;
|
||||
theone->xno = xplustabs() + 1;
|
||||
theone->next = NULL;
|
||||
|
||||
free(fullpath);
|
||||
|
||||
42
src/move.c
42
src/move.c
@@ -1,7 +1,7 @@
|
||||
/**************************************************************************
|
||||
* move.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 1999-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2014-2018 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
@@ -19,7 +19,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -37,7 +37,7 @@ void to_first_line(void)
|
||||
void to_last_line(void)
|
||||
{
|
||||
openfile->current = openfile->filebot;
|
||||
openfile->current_x = strlen(openfile->filebot->data);
|
||||
openfile->current_x = (inhelp) ? 0 : strlen(openfile->filebot->data);
|
||||
openfile->placewewant = xplustabs();
|
||||
|
||||
/* Set the last line of the screen as the target for the cursor. */
|
||||
@@ -192,7 +192,7 @@ void do_para_end(linestruct **line)
|
||||
}
|
||||
|
||||
/* Move up to first start of a paragraph before the current line. */
|
||||
void do_para_begin_void(void)
|
||||
void to_para_begin(void)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
|
||||
@@ -203,7 +203,7 @@ void do_para_begin_void(void)
|
||||
}
|
||||
|
||||
/* Move down to just after the first found end of a paragraph. */
|
||||
void do_para_end_void(void)
|
||||
void to_para_end(void)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
|
||||
@@ -222,7 +222,7 @@ void do_para_end_void(void)
|
||||
#endif /* ENABLE_JUSTIFY */
|
||||
|
||||
/* Move to the preceding block of text. */
|
||||
void do_prev_block(void)
|
||||
void to_prev_block(void)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
bool is_text = FALSE, seen_text = FALSE;
|
||||
@@ -244,7 +244,7 @@ void do_prev_block(void)
|
||||
}
|
||||
|
||||
/* Move to the next block of text. */
|
||||
void do_next_block(void)
|
||||
void to_next_block(void)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
bool is_white = white_string(openfile->current->data);
|
||||
@@ -281,7 +281,7 @@ void do_prev_word(bool allow_punct)
|
||||
openfile->current_x = step_left(openfile->current->data,
|
||||
openfile->current_x);
|
||||
|
||||
if (is_word_mbchar(openfile->current->data + openfile->current_x,
|
||||
if (is_word_char(openfile->current->data + openfile->current_x,
|
||||
allow_punct)) {
|
||||
seen_a_word = TRUE;
|
||||
/* If at the head of a line now, this surely is a word start. */
|
||||
@@ -305,7 +305,7 @@ void do_prev_word(bool allow_punct)
|
||||
* part of a word. Return TRUE if we started on a word, and FALSE otherwise. */
|
||||
bool do_next_word(bool after_ends, bool allow_punct)
|
||||
{
|
||||
bool started_on_word = is_word_mbchar(openfile->current->data +
|
||||
bool started_on_word = is_word_char(openfile->current->data +
|
||||
openfile->current_x, allow_punct);
|
||||
bool seen_space = !started_on_word;
|
||||
#ifndef NANO_TINY
|
||||
@@ -332,7 +332,7 @@ bool do_next_word(bool after_ends, bool allow_punct)
|
||||
if (after_ends) {
|
||||
/* If this is a word character, continue; else it's a separator,
|
||||
* and if we've already seen a word, then it's a word end. */
|
||||
if (is_word_mbchar(openfile->current->data + openfile->current_x,
|
||||
if (is_word_char(openfile->current->data + openfile->current_x,
|
||||
allow_punct))
|
||||
seen_word = TRUE;
|
||||
else if (seen_word)
|
||||
@@ -342,7 +342,7 @@ bool do_next_word(bool after_ends, bool allow_punct)
|
||||
{
|
||||
/* 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,
|
||||
if (!is_word_char(openfile->current->data + openfile->current_x,
|
||||
allow_punct))
|
||||
seen_space = TRUE;
|
||||
else if (seen_space)
|
||||
@@ -355,7 +355,7 @@ bool do_next_word(bool after_ends, bool allow_punct)
|
||||
|
||||
/* 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)
|
||||
void to_prev_word(void)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
|
||||
@@ -367,7 +367,7 @@ void do_prev_word_void(void)
|
||||
/* Move to the next word in the file. If the AFTER_ENDS flag is set, stop
|
||||
* at word ends instead of beginnings. If the WORD_BOUNDS flag is set, treat
|
||||
* punctuation as part of a word. Update the screen afterwards. */
|
||||
void do_next_word_void(void)
|
||||
void to_next_word(void)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
|
||||
@@ -437,7 +437,7 @@ void do_home(void)
|
||||
}
|
||||
|
||||
/* Move to the end of the current line (or softwrapped chunk).
|
||||
* When softwrapping and alredy at the end of a chunk, go to the
|
||||
* When softwrapping and already at the end of a chunk, go to the
|
||||
* end of the full line. */
|
||||
void do_end(void)
|
||||
{
|
||||
@@ -556,13 +556,21 @@ void do_scroll_down(void)
|
||||
|
||||
if (editwinrows > 1 && (openfile->edittop->next != NULL
|
||||
#ifndef NANO_TINY
|
||||
|| chunk_for(openfile->firstcolumn, openfile->edittop) <
|
||||
number_of_chunks_in(openfile->edittop)
|
||||
|| (ISSET(SOFTWRAP) && (extra_chunks_in(openfile->edittop) >
|
||||
chunk_for(openfile->firstcolumn, openfile->edittop)))
|
||||
#endif
|
||||
))
|
||||
edit_scroll(FORWARD);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Scroll the line with the cursor to the center of the screen. */
|
||||
void do_center(void)
|
||||
{
|
||||
adjust_viewport(CENTERING);
|
||||
draw_all_subwindows();
|
||||
full_refresh();
|
||||
}
|
||||
#endif /* !NANO_TINY || ENABLE_HELP */
|
||||
|
||||
/* Move left one character. */
|
||||
void do_left(void)
|
||||
|
||||
1237
src/nano.c
1237
src/nano.c
File diff suppressed because it is too large
Load Diff
520
src/prompt.c
520
src/prompt.c
@@ -1,7 +1,7 @@
|
||||
/**************************************************************************
|
||||
* prompt.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 1999-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2016, 2018 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
@@ -19,23 +19,149 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static char *prompt = NULL;
|
||||
/* The prompt string used for statusbar questions. */
|
||||
/* The prompt string used for status-bar questions. */
|
||||
static size_t typing_x = HIGHEST_POSITIVE;
|
||||
/* The cursor position in answer. */
|
||||
|
||||
/* Move to the beginning of the answer. */
|
||||
void do_statusbar_home(void)
|
||||
{
|
||||
typing_x = 0;
|
||||
}
|
||||
|
||||
/* Move to the end of the answer. */
|
||||
void do_statusbar_end(void)
|
||||
{
|
||||
typing_x = strlen(answer);
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Move to the next word in the answer. */
|
||||
void do_statusbar_next_word(void)
|
||||
{
|
||||
bool seen_space = !is_word_char(answer + typing_x, FALSE);
|
||||
bool seen_word = !seen_space;
|
||||
|
||||
/* Move forward until we reach either the end or the start of a word,
|
||||
* depending on whether the AFTER_ENDS flag is set or not. */
|
||||
while (answer[typing_x] != '\0') {
|
||||
typing_x = step_right(answer, typing_x);
|
||||
|
||||
if (ISSET(AFTER_ENDS)) {
|
||||
/* If this is a word character, continue; else it's a separator,
|
||||
* and if we've already seen a word, then it's a word end. */
|
||||
if (is_word_char(answer + typing_x, FALSE))
|
||||
seen_word = TRUE;
|
||||
else if (seen_word)
|
||||
break;
|
||||
} else {
|
||||
/* 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_char(answer + typing_x, FALSE))
|
||||
seen_space = TRUE;
|
||||
else if (seen_space)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Move to the previous word in the answer. */
|
||||
void do_statusbar_prev_word(void)
|
||||
{
|
||||
bool seen_a_word = FALSE, step_forward = FALSE;
|
||||
|
||||
/* Move backward until we pass over the start of a word. */
|
||||
while (typing_x != 0) {
|
||||
typing_x = step_left(answer, typing_x);
|
||||
|
||||
if (is_word_char(answer + typing_x, FALSE))
|
||||
seen_a_word = TRUE;
|
||||
else if (seen_a_word) {
|
||||
/* This is space now: we've overshot the start of the word. */
|
||||
step_forward = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (step_forward)
|
||||
/* Move one character forward again to sit on the start of the word. */
|
||||
typing_x = step_right(answer, typing_x);
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Move left one character in the answer. */
|
||||
void do_statusbar_left(void)
|
||||
{
|
||||
if (typing_x > 0)
|
||||
typing_x = step_left(answer, typing_x);
|
||||
}
|
||||
|
||||
/* Move right one character in the answer. */
|
||||
void do_statusbar_right(void)
|
||||
{
|
||||
if (answer[typing_x] != '\0')
|
||||
typing_x = step_right(answer, typing_x);
|
||||
}
|
||||
|
||||
/* Delete one character in the answer. */
|
||||
void do_statusbar_delete(void)
|
||||
{
|
||||
if (answer[typing_x] != '\0') {
|
||||
int charlen = char_length(answer + typing_x);
|
||||
|
||||
memmove(answer + typing_x, answer + typing_x + charlen,
|
||||
strlen(answer) - typing_x - charlen + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Backspace over one character in the answer. */
|
||||
void do_statusbar_backspace(void)
|
||||
{
|
||||
if (typing_x > 0) {
|
||||
typing_x = step_left(answer, typing_x);
|
||||
do_statusbar_delete();
|
||||
}
|
||||
}
|
||||
|
||||
/* Zap some or all text from the answer. */
|
||||
void do_statusbar_cut_text(void)
|
||||
{
|
||||
if (!ISSET(CUT_FROM_CURSOR))
|
||||
typing_x = 0;
|
||||
|
||||
answer[typing_x] = '\0';
|
||||
}
|
||||
|
||||
/* Paste the first line of the cutbuffer into the current answer. */
|
||||
void paste_into_answer(void)
|
||||
{
|
||||
size_t pastelen = strlen(cutbuffer->data);
|
||||
char *fusion = charalloc(strlen(answer) + pastelen + 1);
|
||||
|
||||
/* Concatenate: the current answer before the cursor, the first line
|
||||
* of the cutbuffer, plus the rest of the current answer. */
|
||||
strncpy(fusion, answer, typing_x);
|
||||
strncpy(fusion + typing_x, cutbuffer->data, pastelen);
|
||||
strcpy(fusion + typing_x + pastelen, answer + typing_x);
|
||||
|
||||
free(answer);
|
||||
answer = fusion;
|
||||
typing_x += pastelen;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MOUSE
|
||||
/* Handle a mouse click on the statusbar prompt or the shortcut list. */
|
||||
/* Handle a mouse click on the status-bar prompt or the shortcut list. */
|
||||
int do_statusbar_mouse(void)
|
||||
{
|
||||
int click_row, click_col;
|
||||
int retval = get_mouseinput(&click_row, &click_col, TRUE);
|
||||
|
||||
/* We can click on the statusbar window text to move the cursor. */
|
||||
/* We can click on the status-bar window text to move the cursor. */
|
||||
if (retval == 0 && wmouse_trafo(bottomwin, &click_row, &click_col, FALSE)) {
|
||||
size_t start_col = breadth(prompt) + 2;
|
||||
|
||||
@@ -50,6 +176,38 @@ int do_statusbar_mouse(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Insert the given short burst of bytes into the answer. */
|
||||
void inject_into_answer(char *burst, size_t count)
|
||||
{
|
||||
/* First encode any embedded NUL byte as 0x0A. */
|
||||
for (size_t index = 0; index < count; index++)
|
||||
if (burst[index] == '\0')
|
||||
burst[index] = '\n';
|
||||
|
||||
answer = charealloc(answer, strlen(answer) + count + 1);
|
||||
memmove(answer + typing_x + count, answer + typing_x,
|
||||
strlen(answer) - typing_x + 1);
|
||||
strncpy(answer + typing_x, burst , count);
|
||||
|
||||
typing_x += count;
|
||||
}
|
||||
|
||||
/* Get a verbatim keystroke and insert it into the answer. */
|
||||
void do_statusbar_verbatim_input(void)
|
||||
{
|
||||
char *bytes;
|
||||
size_t count;
|
||||
|
||||
bytes = get_verbatim_kbinput(bottomwin, &count);
|
||||
|
||||
if (count > 0)
|
||||
inject_into_answer(bytes, count);
|
||||
else
|
||||
beep();
|
||||
|
||||
free(bytes);
|
||||
}
|
||||
|
||||
/* Read in a keystroke, interpret it if it is a shortcut or toggle, and
|
||||
* return it. Set finished to TRUE if we're done after running
|
||||
* or trying to run a function associated with a shortcut key. */
|
||||
@@ -57,9 +215,9 @@ int do_statusbar_input(bool *finished)
|
||||
{
|
||||
int input;
|
||||
/* The character we read in. */
|
||||
static int *kbinput = NULL;
|
||||
static char *puddle = NULL;
|
||||
/* The input buffer. */
|
||||
static size_t kbinput_len = 0;
|
||||
static size_t depth = 0;
|
||||
/* The length of the input buffer. */
|
||||
const keystruct *shortcut;
|
||||
|
||||
@@ -87,40 +245,30 @@ int do_statusbar_input(bool *finished)
|
||||
/* Check for a shortcut in the current list. */
|
||||
shortcut = get_shortcut(&input);
|
||||
|
||||
/* 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 not a command, discard anything that is not a normal character byte.
|
||||
* Apart from that, only accept input when not in restricted mode, or when
|
||||
* not at the "Write File" prompt, or when there is no filename yet. */
|
||||
if (shortcut == NULL) {
|
||||
if (is_ascii_cntrl_char(input) || meta_key || !is_byte(input)) {
|
||||
if (input < 0x20 || input > 0xFF || meta_key)
|
||||
beep();
|
||||
input = ERR;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 && shortcut == NULL) {
|
||||
/* 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 ||
|
||||
else if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE ||
|
||||
openfile->filename[0] == '\0') {
|
||||
kbinput_len++;
|
||||
kbinput = (int *)nrealloc(kbinput, kbinput_len * sizeof(int));
|
||||
kbinput[kbinput_len - 1] = input;
|
||||
puddle = charealloc(puddle, depth + 2);
|
||||
puddle[depth++] = (char)input;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 ((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);
|
||||
/* If we got a shortcut, or if there aren't any other keystrokes waiting,
|
||||
* it's time to insert all characters in the input buffer (if not empty)
|
||||
* into the answer, and then clear the input buffer. */
|
||||
if ((shortcut || get_key_buffer_len() == 0) && puddle != NULL) {
|
||||
puddle[depth] = '\0';
|
||||
|
||||
/* Empty the input buffer. */
|
||||
kbinput_len = 0;
|
||||
free(kbinput);
|
||||
kbinput = NULL;
|
||||
inject_into_answer(puddle, depth);
|
||||
|
||||
free(puddle);
|
||||
puddle = NULL;
|
||||
depth = 0;
|
||||
}
|
||||
|
||||
if (shortcut) {
|
||||
@@ -136,9 +284,9 @@ int do_statusbar_input(bool *finished)
|
||||
else if (shortcut->func == do_right)
|
||||
do_statusbar_right();
|
||||
#ifndef NANO_TINY
|
||||
else if (shortcut->func == do_prev_word_void)
|
||||
else if (shortcut->func == to_prev_word)
|
||||
do_statusbar_prev_word();
|
||||
else if (shortcut->func == do_next_word_void)
|
||||
else if (shortcut->func == to_next_word)
|
||||
do_statusbar_next_word();
|
||||
#endif
|
||||
else if (shortcut->func == do_home)
|
||||
@@ -169,7 +317,7 @@ int do_statusbar_input(bool *finished)
|
||||
do_statusbar_backspace();
|
||||
else if (shortcut->func == paste_text) {
|
||||
if (cutbuffer != NULL)
|
||||
do_statusbar_uncut_text();
|
||||
paste_into_answer();
|
||||
} else {
|
||||
/* Handle any other shortcut in the current menu, setting finished
|
||||
* to TRUE to indicate that we're done after running or trying to
|
||||
@@ -183,187 +331,8 @@ int do_statusbar_input(bool *finished)
|
||||
return input;
|
||||
}
|
||||
|
||||
/* 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)
|
||||
{
|
||||
char *output = charalloc(input_len + 1);
|
||||
char onechar[MAXCHARLEN];
|
||||
size_t charlen, i, j = 0;
|
||||
|
||||
/* 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';
|
||||
|
||||
while (j < input_len) {
|
||||
/* Encode any NUL byte as 0x0A. */
|
||||
if (output[j] == '\0')
|
||||
output[j] = '\n';
|
||||
|
||||
/* Interpret the next multibyte character. */
|
||||
charlen = collect_char(output + j, onechar);
|
||||
|
||||
j += charlen;
|
||||
|
||||
/* When filtering, skip any ASCII control character. */
|
||||
if (filtering && is_ascii_cntrl_char(*(output + j - charlen)))
|
||||
continue;
|
||||
|
||||
/* Insert the typed character into the existing answer string. */
|
||||
answer = charealloc(answer, strlen(answer) + charlen + 1);
|
||||
memmove(answer + typing_x + charlen, answer + typing_x,
|
||||
strlen(answer) - typing_x + 1);
|
||||
strncpy(answer + typing_x, onechar, charlen);
|
||||
|
||||
typing_x += charlen;
|
||||
}
|
||||
|
||||
free(output);
|
||||
}
|
||||
|
||||
/* Move to the beginning of the answer. */
|
||||
void do_statusbar_home(void)
|
||||
{
|
||||
typing_x = 0;
|
||||
}
|
||||
|
||||
/* Move to the end of the answer. */
|
||||
void do_statusbar_end(void)
|
||||
{
|
||||
typing_x = strlen(answer);
|
||||
}
|
||||
|
||||
/* Move left one character. */
|
||||
void do_statusbar_left(void)
|
||||
{
|
||||
if (typing_x > 0)
|
||||
typing_x = step_left(answer, typing_x);
|
||||
}
|
||||
|
||||
/* Move right one character. */
|
||||
void do_statusbar_right(void)
|
||||
{
|
||||
if (answer[typing_x] != '\0')
|
||||
typing_x = step_right(answer, typing_x);
|
||||
}
|
||||
|
||||
/* Delete one character. */
|
||||
void do_statusbar_delete(void)
|
||||
{
|
||||
if (answer[typing_x] != '\0') {
|
||||
int charlen = char_length(answer + typing_x);
|
||||
|
||||
memmove(answer + typing_x, answer + typing_x + charlen,
|
||||
strlen(answer) - typing_x - charlen + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Backspace over one character. */
|
||||
void do_statusbar_backspace(void)
|
||||
{
|
||||
if (typing_x > 0) {
|
||||
typing_x = step_left(answer, typing_x);
|
||||
do_statusbar_delete();
|
||||
}
|
||||
}
|
||||
|
||||
/* Zap some or all text from the answer. */
|
||||
void do_statusbar_cut_text(void)
|
||||
{
|
||||
if (!ISSET(CUT_FROM_CURSOR))
|
||||
typing_x = 0;
|
||||
|
||||
answer[typing_x] = '\0';
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Move to the next word in the answer. */
|
||||
void do_statusbar_next_word(void)
|
||||
{
|
||||
bool seen_space = !is_word_mbchar(answer + typing_x, FALSE);
|
||||
bool seen_word = !seen_space;
|
||||
|
||||
/* Move forward until we reach either the end or the start of a word,
|
||||
* depending on whether the AFTER_ENDS flag is set or not. */
|
||||
while (answer[typing_x] != '\0') {
|
||||
typing_x = step_right(answer, typing_x);
|
||||
|
||||
if (ISSET(AFTER_ENDS)) {
|
||||
/* If this is a word character, continue; else it's a separator,
|
||||
* and if we've already seen a word, then it's a word end. */
|
||||
if (is_word_mbchar(answer + typing_x, FALSE))
|
||||
seen_word = TRUE;
|
||||
else if (seen_word)
|
||||
break;
|
||||
} else {
|
||||
/* 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(answer + typing_x, FALSE))
|
||||
seen_space = TRUE;
|
||||
else if (seen_space)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Move to the previous word in the answer. */
|
||||
void do_statusbar_prev_word(void)
|
||||
{
|
||||
bool seen_a_word = FALSE, step_forward = FALSE;
|
||||
|
||||
/* Move backward until we pass over the start of a word. */
|
||||
while (typing_x != 0) {
|
||||
typing_x = step_left(answer, typing_x);
|
||||
|
||||
if (is_word_mbchar(answer + typing_x, FALSE))
|
||||
seen_a_word = TRUE;
|
||||
else if (seen_a_word) {
|
||||
/* This is space now: we've overshot the start of the word. */
|
||||
step_forward = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (step_forward)
|
||||
/* Move one character forward again to sit on the start of the word. */
|
||||
typing_x = step_right(answer, typing_x);
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Get verbatim input and inject it into the answer, without filtering. */
|
||||
void do_statusbar_verbatim_input(void)
|
||||
{
|
||||
int *kbinput;
|
||||
size_t kbinput_len;
|
||||
|
||||
kbinput = get_verbatim_kbinput(bottomwin, &kbinput_len);
|
||||
|
||||
do_statusbar_output(kbinput, kbinput_len, FALSE);
|
||||
|
||||
free(kbinput);
|
||||
}
|
||||
|
||||
/* Paste the first line of the cutbuffer into the current answer. */
|
||||
void do_statusbar_uncut_text(void)
|
||||
{
|
||||
size_t pastelen = strlen(cutbuffer->data);
|
||||
char *fusion = charalloc(strlen(answer) + pastelen + 1);
|
||||
|
||||
/* Concatenate: the current answer before the cursor, the first line
|
||||
* of the cutbuffer, plus the rest of the current answer. */
|
||||
strncpy(fusion, answer, typing_x);
|
||||
strncpy(fusion + typing_x, cutbuffer->data, pastelen);
|
||||
strcpy(fusion + typing_x + pastelen, answer + typing_x);
|
||||
|
||||
free(answer);
|
||||
answer = fusion;
|
||||
typing_x += pastelen;
|
||||
}
|
||||
|
||||
/* 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,
|
||||
* displayed in the status bar 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)
|
||||
@@ -436,29 +405,23 @@ void add_or_remove_pipe_symbol_from_answer(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Get a string of input at the statusbar prompt. */
|
||||
functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||
bool allow_files, bool *listed, linestruct **history_list,
|
||||
void (*refresh_func)(void))
|
||||
/* Get a string of input at the status-bar prompt. */
|
||||
functionptrtype acquire_an_answer(int *actual, bool *listed,
|
||||
linestruct **history_list, void (*refresh_func)(void))
|
||||
{
|
||||
int kbinput = ERR;
|
||||
bool finished;
|
||||
functionptrtype func;
|
||||
#ifdef ENABLE_TABCOMP
|
||||
bool tabbed = FALSE;
|
||||
/* Whether we've pressed Tab. */
|
||||
#endif
|
||||
#ifdef ENABLE_HISTORIES
|
||||
char *history = NULL;
|
||||
/* The current history string. */
|
||||
char *magichistory = NULL;
|
||||
/* The (partial) answer that was typed at the prompt, if any. */
|
||||
#ifdef ENABLE_TABCOMP
|
||||
int last_kbinput = ERR;
|
||||
/* The key we pressed before the current key. */
|
||||
size_t complete_len = 0;
|
||||
/* The length of the original string that we're trying to
|
||||
* tab complete, if any. */
|
||||
bool previous_was_tab = FALSE;
|
||||
/* Whether the previous keystroke was an attempt at tab completion. */
|
||||
size_t fragment_length = 0;
|
||||
/* The length of the fragment that the user tries to tab complete. */
|
||||
#endif
|
||||
#endif /* ENABLE_HISTORIES */
|
||||
|
||||
@@ -488,25 +451,23 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_TABCOMP
|
||||
if (func != do_tab)
|
||||
tabbed = FALSE;
|
||||
|
||||
if (func == do_tab) {
|
||||
#ifdef ENABLE_HISTORIES
|
||||
if (history_list != NULL) {
|
||||
if (last_kbinput != the_code_for(do_tab, TAB_CODE))
|
||||
complete_len = strlen(answer);
|
||||
if (!previous_was_tab)
|
||||
fragment_length = strlen(answer);
|
||||
|
||||
if (complete_len > 0) {
|
||||
if (fragment_length > 0) {
|
||||
answer = get_history_completion(history_list,
|
||||
answer, complete_len);
|
||||
answer, fragment_length);
|
||||
typing_x = strlen(answer);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (allow_tabs)
|
||||
answer = input_tab(answer, allow_files, &typing_x,
|
||||
&tabbed, refresh_func, listed);
|
||||
/* Allow tab completion of filenames, but not in restricted mode. */
|
||||
if ((currmenu == MINSERTFILE || currmenu == MWRITEFILE ||
|
||||
currmenu == MGOTODIR) && !ISSET(RESTRICTED))
|
||||
answer = input_tab(answer, &typing_x, refresh_func, listed);
|
||||
} else
|
||||
#endif /* ENABLE_TABCOMP */
|
||||
#ifdef ENABLE_HISTORIES
|
||||
@@ -543,14 +504,21 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||
}
|
||||
} else
|
||||
#endif /* ENABLE_HISTORIES */
|
||||
if (func == do_help_void) {
|
||||
/* 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.
|
||||
* Set it back to FALSE here, so that we aren't kicked out of
|
||||
* the statusbar prompt. */
|
||||
/* If we ran a function that should not exit from the prompt... */
|
||||
if (func == do_help || func == full_refresh)
|
||||
finished = FALSE;
|
||||
#ifndef NANO_TINY
|
||||
else if (func == do_nothing)
|
||||
finished = FALSE;
|
||||
else if (func == do_toggle_void) {
|
||||
TOGGLE(NO_HELP);
|
||||
window_init();
|
||||
focusing = FALSE;
|
||||
refresh_func();
|
||||
bottombars(currmenu);
|
||||
finished = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If we have a shortcut with an associated function, break out if
|
||||
* we're finished after running or trying to run the function. */
|
||||
@@ -558,7 +526,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||
break;
|
||||
|
||||
#if defined(ENABLE_HISTORIES) && defined(ENABLE_TABCOMP)
|
||||
last_kbinput = kbinput;
|
||||
previous_was_tab = (func == do_tab);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -575,23 +543,18 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||
return func;
|
||||
}
|
||||
|
||||
/* Ask a question on the statusbar. Return 0 when text was entered,
|
||||
/* Ask a question on the status bar. Return 0 when text was entered,
|
||||
* -1 for a cancelled entry, -2 for a blank string, and the relevant
|
||||
* keycode when a valid shortcut key was pressed.
|
||||
*
|
||||
* The allow_tabs parameter indicates whether tab completion is allowed,
|
||||
* and allow_files indicates whether all files (and not just directories)
|
||||
* can be tab completed. The 'provided' parameter is the default answer
|
||||
* for when simply Enter is typed. */
|
||||
int do_prompt(bool allow_tabs, bool allow_files,
|
||||
int menu, const char *provided, linestruct **history_list,
|
||||
void (*refresh_func)(void), const char *msg, ...)
|
||||
* keycode when a valid shortcut key was pressed. The 'provided'
|
||||
* parameter is the default answer for when simply Enter is typed. */
|
||||
int do_prompt(int menu, const char *provided, linestruct **history_list,
|
||||
void (*refresh_func)(void), const char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int retval;
|
||||
functionptrtype func = NULL;
|
||||
bool listed = FALSE;
|
||||
/* Save a possible current statusbar x position and prompt. */
|
||||
/* Save a possible current status-bar x position and prompt. */
|
||||
size_t was_typing_x = typing_x;
|
||||
char *saved_prompt = prompt;
|
||||
|
||||
@@ -610,8 +573,9 @@ int do_prompt(bool allow_tabs, bool allow_files,
|
||||
/* Reserve five columns for colon plus angles plus answer, ":<aa>". */
|
||||
prompt[actual_x(prompt, (COLS < 5) ? 0 : COLS - 5)] = '\0';
|
||||
|
||||
func = acquire_an_answer(&retval, allow_tabs, allow_files, &listed,
|
||||
history_list, refresh_func);
|
||||
lastmessage = VACUUM;
|
||||
|
||||
func = acquire_an_answer(&retval, &listed, history_list, refresh_func);
|
||||
free(prompt);
|
||||
prompt = saved_prompt;
|
||||
|
||||
@@ -632,11 +596,11 @@ int do_prompt(bool allow_tabs, bool allow_files,
|
||||
else if (func == do_enter)
|
||||
retval = (*answer == '\0') ? -2 : 0;
|
||||
|
||||
wipe_statusbar();
|
||||
if (lastmessage == VACUUM)
|
||||
wipe_statusbar();
|
||||
|
||||
#ifdef ENABLE_TABCOMP
|
||||
/* If we've done tab completion, there might still be a list of
|
||||
* filename matches on the edit window. Clear them off. */
|
||||
/* If possible filename completions are still listed, clear them off. */
|
||||
if (listed)
|
||||
refresh_func();
|
||||
#endif
|
||||
@@ -645,7 +609,7 @@ int do_prompt(bool allow_tabs, bool allow_files,
|
||||
}
|
||||
|
||||
/* Ask a simple Yes/No (and optionally All) question, specified in msg,
|
||||
* on the statusbar. Return 1 for Yes, 0 for No, 2 for All (if all is
|
||||
* on the status bar. Return 1 for Yes, 0 for No, 2 for All (if all is
|
||||
* TRUE when passed in), and -1 for Cancel. */
|
||||
int do_yesno_prompt(bool all, const char *msg)
|
||||
{
|
||||
@@ -707,6 +671,15 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||
/* When not replacing, show the cursor while waiting for a key. */
|
||||
kbinput = get_kbinput(bottomwin, !all);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH)
|
||||
continue;
|
||||
|
||||
/* Accept the first character of an external paste. */
|
||||
if (bracketed_paste && kbinput == BRACKETED_PASTE_MARKER)
|
||||
kbinput = get_kbinput(bottomwin, BLIND);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
letter[index++] = (unsigned char)kbinput;
|
||||
#ifdef ENABLE_UTF8
|
||||
@@ -762,6 +735,25 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||
}
|
||||
}
|
||||
#endif /* ENABLE_MOUSE */
|
||||
else if (func_from_key(&kbinput) == full_refresh)
|
||||
full_refresh();
|
||||
#ifndef NANO_TINY
|
||||
else if (func_from_key(&kbinput) == do_toggle_void) {
|
||||
TOGGLE(NO_HELP);
|
||||
window_init();
|
||||
titlebar(NULL);
|
||||
focusing = FALSE;
|
||||
edit_refresh();
|
||||
}
|
||||
#endif
|
||||
else
|
||||
beep();
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Ignore the rest of an external paste. */
|
||||
while (bracketed_paste)
|
||||
kbinput = get_kbinput(bottomwin, BLIND);
|
||||
#endif
|
||||
}
|
||||
|
||||
return choice;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**************************************************************************
|
||||
* proto.h -- This file is part of GNU nano. *
|
||||
* prototypes.h -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 1999-2011, 2013-2020 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 *
|
||||
@@ -18,7 +18,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "nano.h"
|
||||
#include "definitions.h"
|
||||
|
||||
/* All external variables. See global.c for their descriptions. */
|
||||
|
||||
@@ -27,9 +27,20 @@ extern volatile sig_atomic_t the_window_resized;
|
||||
#endif
|
||||
|
||||
extern bool on_a_vt;
|
||||
extern bool shifted_metas;
|
||||
|
||||
extern bool meta_key;
|
||||
extern bool shift_held;
|
||||
extern bool mute_modifiers;
|
||||
extern bool bracketed_paste;
|
||||
|
||||
extern bool we_are_running;
|
||||
extern bool more_than_one;
|
||||
|
||||
extern bool ran_a_tool;
|
||||
|
||||
extern bool inhelp;
|
||||
extern char *title;
|
||||
|
||||
extern bool focusing;
|
||||
|
||||
@@ -37,25 +48,21 @@ extern bool as_an_at;
|
||||
|
||||
extern bool control_C_was_pressed;
|
||||
|
||||
extern bool suppress_cursorpos;
|
||||
|
||||
extern bool started_curses;
|
||||
|
||||
extern message_type lastmessage;
|
||||
|
||||
extern linestruct *pletion_line;
|
||||
|
||||
extern bool inhelp;
|
||||
extern char *title;
|
||||
|
||||
extern bool more_than_one;
|
||||
|
||||
extern bool also_the_last;
|
||||
|
||||
extern bool is_shorter;
|
||||
extern char *answer;
|
||||
|
||||
extern char *last_search;
|
||||
extern int didfind;
|
||||
|
||||
extern char *present_path;
|
||||
|
||||
extern unsigned flags[4];
|
||||
|
||||
extern int controlleft, controlright;
|
||||
extern int controlup, controldown;
|
||||
extern int controlhome, controlend;
|
||||
@@ -68,7 +75,8 @@ extern int shiftcontrolup, shiftcontroldown;
|
||||
extern int shiftcontrolhome, shiftcontrolend;
|
||||
extern int altleft, altright;
|
||||
extern int altup, altdown;
|
||||
extern int altdelete;
|
||||
extern int altpageup, altpagedown;
|
||||
extern int altinsert, altdelete;
|
||||
extern int shiftaltleft, shiftaltright;
|
||||
extern int shiftaltup, shiftaltdown;
|
||||
#endif
|
||||
@@ -78,19 +86,15 @@ extern ssize_t fill;
|
||||
extern size_t wrap_at;
|
||||
#endif
|
||||
|
||||
extern char *last_search;
|
||||
|
||||
extern char *present_path;
|
||||
|
||||
extern unsigned flags[4];
|
||||
|
||||
extern WINDOW *topwin;
|
||||
extern WINDOW *edit;
|
||||
extern WINDOW *bottomwin;
|
||||
extern int editwinrows;
|
||||
extern int editwincols;
|
||||
extern int margin;
|
||||
extern int thebar;
|
||||
#ifndef NANO_TINY
|
||||
extern int *bardata;
|
||||
extern ssize_t stripe_column;
|
||||
#endif
|
||||
|
||||
@@ -120,14 +124,10 @@ extern regex_t quotereg;
|
||||
|
||||
extern char *word_chars;
|
||||
|
||||
extern char *answer;
|
||||
|
||||
extern ssize_t tabsize;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
extern char *backup_dir;
|
||||
extern const char *locking_prefix;
|
||||
extern const char *locking_suffix;
|
||||
#endif
|
||||
#ifdef ENABLE_OPERATINGDIR
|
||||
extern char *operating_dir;
|
||||
@@ -176,6 +176,9 @@ extern char *statedir;
|
||||
#if defined(ENABLE_NANORC) || defined(ENABLE_HISTORIES)
|
||||
extern char *startup_problem;
|
||||
#endif
|
||||
#ifdef ENABLE_NANORC
|
||||
extern char *custom_nanorc;
|
||||
#endif
|
||||
|
||||
extern bool spotlighted;
|
||||
extern size_t light_from_col;
|
||||
@@ -185,15 +188,12 @@ typedef void (*functionptrtype)(void);
|
||||
|
||||
/* Most functions in browser.c. */
|
||||
#ifdef ENABLE_BROWSER
|
||||
char *do_browse_from(const char *inpath);
|
||||
char *browse_in(const char *inpath);
|
||||
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);
|
||||
void do_filesearch(bool forwards);
|
||||
void do_fileresearch(bool forwards);
|
||||
void to_first_file(void);
|
||||
void to_last_file(void);
|
||||
char *strip_last_component(const char *path);
|
||||
#endif
|
||||
|
||||
@@ -202,50 +202,46 @@ char *strip_last_component(const char *path);
|
||||
void utf8_init(void);
|
||||
bool using_utf8(void);
|
||||
#endif
|
||||
char *addstrings(char* str1, size_t len1, char* str2, size_t len2);
|
||||
bool is_byte(int c);
|
||||
bool is_alpha_mbchar(const char *c);
|
||||
bool is_blank_mbchar(const char *c);
|
||||
bool is_ascii_cntrl_char(int c);
|
||||
bool is_cntrl_mbchar(const char *c);
|
||||
bool is_word_mbchar(const char *c, bool allow_punct);
|
||||
bool is_alpha_char(const char *c);
|
||||
bool is_blank_char(const char *c);
|
||||
bool is_cntrl_char(const char *c);
|
||||
bool is_word_char(const char *c, bool allow_punct);
|
||||
char control_mbrep(const char *c, bool isdata);
|
||||
#ifdef ENABLE_UTF8
|
||||
int mbwidth(const char *c);
|
||||
char *make_mbchar(long code, int *length);
|
||||
#endif
|
||||
char *make_mbchar(long chr, int *chr_mb_len);
|
||||
int char_length(const char *pointer);
|
||||
size_t mbstrlen(const char *s);
|
||||
int collect_char(const char *buf, char *chr);
|
||||
size_t mbstrlen(const char *pointer);
|
||||
int collect_char(const char *string, char *thechar);
|
||||
int advance_over(const char *string, size_t *column);
|
||||
size_t step_left(const char *buf, size_t pos);
|
||||
size_t step_right(const char *buf, size_t pos);
|
||||
int mbstrcasecmp(const char *s1, const char *s2);
|
||||
int mbstrncasecmp(const char *s1, const char *s2, size_t n);
|
||||
char *mbstrcasestr(const char *haystack, const char *needle);
|
||||
char *revstrstr(const char *haystack, const char *needle, const char *index);
|
||||
char *mbrevstrcasestr(const char *haystack, const char *needle, const char *index);
|
||||
char *revstrstr(const char *haystack, const char *needle, const char *pointer);
|
||||
char *mbrevstrcasestr(const char *haystack, const char *needle, const char *pointer);
|
||||
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
|
||||
char *mbstrchr(const char *s, const char *c);
|
||||
char *mbstrchr(const char *string, const char *chr);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
char *mbstrpbrk(const char *s, const char *accept);
|
||||
char *revstrpbrk(const char *head, const char *accept, const char *index);
|
||||
char *mbrevstrpbrk(const char *head, const char *accept, const char *index);
|
||||
char *mbstrpbrk(const char *string, const char *accept);
|
||||
char *mbrevstrpbrk(const char *head, const char *accept, const char *pointer);
|
||||
#endif
|
||||
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_JUSTIFY))
|
||||
bool has_blank_char(const char *s);
|
||||
bool has_blank_char(const char *string);
|
||||
#endif
|
||||
bool white_string(const char *s);
|
||||
bool white_string(const char *string);
|
||||
#ifdef ENABLE_UTF8
|
||||
bool is_valid_unicode(wchar_t wc);
|
||||
#endif
|
||||
|
||||
/* Most functions in color.c. */
|
||||
#ifdef ENABLE_COLOR
|
||||
void set_colorpairs(void);
|
||||
void color_init(void);
|
||||
void color_update(void);
|
||||
void set_interface_colorpairs(void);
|
||||
void prepare_palette(void);
|
||||
void find_and_prime_applicable_syntax(void);
|
||||
void set_up_multicache(linestruct *line);
|
||||
void check_the_multis(linestruct *line);
|
||||
void precalc_multicolorinfo(void);
|
||||
@@ -257,26 +253,30 @@ void do_backspace(void);
|
||||
#ifndef NANO_TINY
|
||||
void chop_previous_word(void);
|
||||
void chop_next_word(void);
|
||||
void cut_marked(bool *right_side_up);
|
||||
#endif
|
||||
void do_snip(bool copying, bool marked, bool until_eof, bool append);
|
||||
bool is_cuttable(bool test_cliff);
|
||||
void extract_segment(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x);
|
||||
void ingraft_buffer(linestruct *topline);
|
||||
void copy_from_buffer(linestruct *somebuffer);
|
||||
#ifndef NANO_TINY
|
||||
void cut_marked_region(void);
|
||||
#endif
|
||||
void do_snip(bool marked, bool until_eof, bool append);
|
||||
void cut_text(void);
|
||||
#ifndef NANO_TINY
|
||||
void copy_text(void);
|
||||
void cut_till_eof(void);
|
||||
void zap_text(void);
|
||||
void copy_marked_region(void);
|
||||
void copy_text(void);
|
||||
#endif
|
||||
void paste_text(void);
|
||||
|
||||
/* Most functions in files.c. */
|
||||
void make_new_buffer(void);
|
||||
void set_modified(void);
|
||||
bool open_buffer(const char *filename, bool new_buffer);
|
||||
#ifdef ENABLE_SPELLER
|
||||
bool replace_buffer(const char *filename, undo_type action, bool marked,
|
||||
const char *operation);
|
||||
#ifndef NANO_TINY
|
||||
bool delete_lockfile(const char *lockfilename);
|
||||
#endif
|
||||
bool open_buffer(const char *filename, bool new_one);
|
||||
void set_modified(void);
|
||||
void prepare_for_display(void);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
void mention_name_and_linecount(void);
|
||||
@@ -285,70 +285,62 @@ void switch_to_next_buffer(void);
|
||||
void close_buffer(void);
|
||||
#endif
|
||||
void read_file(FILE *f, int fd, const char *filename, bool undoable);
|
||||
int open_file(const char *filename, bool newfie, FILE **f);
|
||||
int open_file(const char *filename, bool new_one, FILE **f);
|
||||
char *get_next_filename(const char *name, const char *suffix);
|
||||
void do_insertfile_void(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_execute(void);
|
||||
#endif
|
||||
char *get_full_path(const char *origpath);
|
||||
char *safe_tempfile(FILE **f);
|
||||
char *safe_tempfile(FILE **stream);
|
||||
#ifdef ENABLE_OPERATINGDIR
|
||||
void init_operating_dir(void);
|
||||
bool outside_of_confinement(const char *currpath, bool allow_tabcomp);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
void init_backup_dir(void);
|
||||
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 close_out);
|
||||
bool write_file(const char *name, FILE *f_open, bool tmp,
|
||||
bool write_file(const char *name, FILE *thefile, bool tmp,
|
||||
kind_of_writing_type method, bool fullbuffer);
|
||||
#ifndef NANO_TINY
|
||||
bool write_marked_file(const char *name, FILE *f_open, bool tmp,
|
||||
bool write_marked_file(const char *name, FILE *stream, bool tmp,
|
||||
kind_of_writing_type method);
|
||||
#endif
|
||||
int do_writeout(bool exiting, bool withprompt);
|
||||
void do_writeout_void(void);
|
||||
void do_savefile(void);
|
||||
char *real_dir_from_tilde(const char *buf);
|
||||
char *real_dir_from_tilde(const char *path);
|
||||
#if defined(ENABLE_TABCOMP) || defined(ENABLE_BROWSER)
|
||||
int diralphasort(const void *va, const void *vb);
|
||||
#endif
|
||||
#ifdef ENABLE_TABCOMP
|
||||
char *input_tab(char *buf, bool allow_files, size_t *place,
|
||||
bool *lastwastab, void (*refresh_func)(void), bool *listed);
|
||||
char *input_tab(char *buf, size_t *place, void (*refresh_func)(void), bool *listed);
|
||||
#endif
|
||||
|
||||
/* Some functions in global.c. */
|
||||
const keystruct *first_sc_for(int menu, void (*func)(void));
|
||||
int the_code_for(void (*func)(void), int defaultval);
|
||||
size_t shown_entries_for(int menu);
|
||||
const keystruct *get_shortcut(int *kbinput);
|
||||
functionptrtype func_from_key(int *kbinput);
|
||||
const keystruct *get_shortcut(int *keycode);
|
||||
functionptrtype func_from_key(int *keycode);
|
||||
#if defined(ENABLE_BROWSER) || defined(ENABLE_HELP)
|
||||
functionptrtype interpret(int *keycode);
|
||||
#endif
|
||||
int keycode_from_string(const char *keystring);
|
||||
void assign_keyinfo(keystruct *s, const char *keystring, const int keycode);
|
||||
void shortcut_init(void);
|
||||
const char *flagtostr(int flag);
|
||||
#ifdef ENABLE_NANORC
|
||||
keystruct *strtosc(const char *input);
|
||||
int name_to_menu(const char *name);
|
||||
char *menu_to_name(int menu);
|
||||
#endif
|
||||
|
||||
/* All functions in help.c. */
|
||||
/* Some functions in help.c. */
|
||||
#ifdef ENABLE_HELP
|
||||
void wrap_help_text_into_buffer(void);
|
||||
void do_help(void);
|
||||
void help_init(void);
|
||||
functionptrtype parse_help_input(int *kbinput);
|
||||
size_t help_line_len(const char *ptr);
|
||||
#endif
|
||||
void do_help_void(void);
|
||||
void do_help(void);
|
||||
|
||||
/* Most functions in history.c. */
|
||||
#ifdef ENABLE_HISTORIES
|
||||
void history_init(void);
|
||||
void history_reset(const linestruct *h);
|
||||
void update_history(linestruct **h, const char *s);
|
||||
void history_reset(const linestruct *list);
|
||||
void update_history(linestruct **item, const char *text);
|
||||
char *get_history_older(linestruct **h);
|
||||
char *get_history_newer(linestruct **h);
|
||||
void get_history_older_void(void);
|
||||
@@ -360,7 +352,7 @@ bool have_statedir(void);
|
||||
void load_history(void);
|
||||
void save_history(void);
|
||||
void load_poshistory(void);
|
||||
void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos);
|
||||
void update_poshistory(void);
|
||||
bool has_old_position(const char *file, ssize_t *line, ssize_t *column);
|
||||
#endif
|
||||
|
||||
@@ -372,15 +364,15 @@ void do_page_down(void);
|
||||
#ifdef ENABLE_JUSTIFY
|
||||
void do_para_begin(linestruct **line);
|
||||
void do_para_end(linestruct **line);
|
||||
void do_para_begin_void(void);
|
||||
void do_para_end_void(void);
|
||||
void to_para_begin(void);
|
||||
void to_para_end(void);
|
||||
#endif
|
||||
void do_prev_block(void);
|
||||
void do_next_block(void);
|
||||
void to_prev_block(void);
|
||||
void to_next_block(void);
|
||||
void do_prev_word(bool allow_punct);
|
||||
bool do_next_word(bool after_ends, bool allow_punct);
|
||||
void do_prev_word_void(void);
|
||||
void do_next_word_void(void);
|
||||
void to_prev_word(void);
|
||||
void to_next_word(void);
|
||||
void do_home(void);
|
||||
void do_end(void);
|
||||
void do_up(void);
|
||||
@@ -388,6 +380,7 @@ void do_down(void);
|
||||
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
|
||||
void do_scroll_up(void);
|
||||
void do_scroll_down(void);
|
||||
void do_center(void);
|
||||
#endif
|
||||
void do_left(void);
|
||||
void do_right(void);
|
||||
@@ -395,28 +388,21 @@ void do_right(void);
|
||||
/* Most functions in nano.c. */
|
||||
linestruct *make_new_node(linestruct *prevnode);
|
||||
void splice_node(linestruct *afterthis, linestruct *newnode);
|
||||
void unlink_node(linestruct *fileptr);
|
||||
void delete_node(linestruct *fileptr);
|
||||
void unlink_node(linestruct *line);
|
||||
void delete_node(linestruct *line);
|
||||
linestruct *copy_buffer(const linestruct *src);
|
||||
void free_lines(linestruct *src);
|
||||
void renumber_from(linestruct *line);
|
||||
void partition_buffer(linestruct *top, size_t top_x,
|
||||
linestruct *bot, size_t bot_x);
|
||||
void unpartition_buffer(void);
|
||||
void extract(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x);
|
||||
void ingraft_buffer(linestruct *somebuffer);
|
||||
void copy_from_buffer(linestruct *somebuffer);
|
||||
void print_view_warning(void);
|
||||
bool in_restricted_mode(void);
|
||||
#ifndef ENABLE_HELP
|
||||
void say_there_is_no_help(void);
|
||||
#endif
|
||||
void finish(void);
|
||||
void die(const char *msg, ...);
|
||||
void emergency_save(const char *die_filename, struct stat *die_stat);
|
||||
void window_init(void);
|
||||
void do_exit(void);
|
||||
void close_and_go(void);
|
||||
void do_exit(void);
|
||||
void die(const char *msg, ...);
|
||||
void window_init(void);
|
||||
void install_handler_for_Ctrl_C(void);
|
||||
void restore_handler_for_Ctrl_C(void);
|
||||
void reconnect_and_store_state(void);
|
||||
@@ -426,11 +412,12 @@ RETSIGTYPE handle_crash(int signal);
|
||||
#endif
|
||||
RETSIGTYPE do_suspend(int signal);
|
||||
RETSIGTYPE do_continue(int signal);
|
||||
#if !defined(NANO_TINY) || defined(ENABLE_SPELLER)
|
||||
#if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined(ENABLE_COLOR)
|
||||
void block_sigwinch(bool blockit);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
RETSIGTYPE handle_sigwinch(int signal);
|
||||
void compute_the_extra_rows_per_line_from(linestruct *fromline);
|
||||
void regenerate_screen(void);
|
||||
void do_toggle(int flag);
|
||||
#endif
|
||||
@@ -444,28 +431,13 @@ void confirm_margin(void);
|
||||
#endif
|
||||
void unbound_key(int code);
|
||||
bool okay_for_view(const keystruct *shortcut);
|
||||
void do_output(char *output, size_t output_len, bool allow_cntrls);
|
||||
void inject(char *burst, size_t count);
|
||||
|
||||
/* Most functions in prompt.c. */
|
||||
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);
|
||||
void do_statusbar_right(void);
|
||||
void do_statusbar_backspace(void);
|
||||
void do_statusbar_delete(void);
|
||||
void do_statusbar_cut_text(void);
|
||||
void do_statusbar_uncut_text(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_statusbar_prev_word(void);
|
||||
void do_statusbar_next_word(void);
|
||||
#endif
|
||||
void do_statusbar_verbatim_input(void);
|
||||
size_t get_statusbar_page_start(size_t start_col, size_t column);
|
||||
size_t get_statusbar_page_start(size_t base, size_t column);
|
||||
void put_cursor_at_end_of_answer(void);
|
||||
void add_or_remove_pipe_symbol_from_answer(void);
|
||||
int do_prompt(bool allow_tabs, bool allow_files,
|
||||
int menu, const char *curranswer, linestruct **history_list,
|
||||
int do_prompt(int menu, const char *provided, linestruct **history_list,
|
||||
void (*refresh_func)(void), const char *msg, ...);
|
||||
int do_yesno_prompt(bool all, const char *msg);
|
||||
|
||||
@@ -489,7 +461,6 @@ bool regexp_init(const char *regexp);
|
||||
void tidy_up_after_search(void);
|
||||
int findnextstr(const char *needle, bool whole_word_only, int modus,
|
||||
size_t *match_len, bool skipone, const linestruct *begin, size_t begin_x);
|
||||
void do_search(void);
|
||||
void do_search_forward(void);
|
||||
void do_search_backward(void);
|
||||
void do_findprevious(void);
|
||||
@@ -499,13 +470,16 @@ void go_looking(void);
|
||||
ssize_t do_replace_loop(const char *needle, bool whole_word_only,
|
||||
const linestruct *real_current, size_t *real_current_x);
|
||||
void do_replace(void);
|
||||
void ask_for_replacement(void);
|
||||
void ask_for_and_do_replacements(void);
|
||||
void goto_line_posx(ssize_t line, size_t pos_x);
|
||||
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
||||
void do_gotolinecolumn(ssize_t line, ssize_t column, bool retain_answer,
|
||||
bool interactive);
|
||||
void do_gotolinecolumn_void(void);
|
||||
#ifndef NANO_TINY
|
||||
void do_find_bracket(void);
|
||||
void put_or_lift_anchor(void);
|
||||
void to_prev_anchor(void);
|
||||
void to_next_anchor(void);
|
||||
#endif
|
||||
|
||||
/* Most functions in text.c. */
|
||||
@@ -524,9 +498,7 @@ void do_undo(void);
|
||||
void do_redo(void);
|
||||
void do_enter(void);
|
||||
#ifndef NANO_TINY
|
||||
RETSIGTYPE cancel_command(int signal);
|
||||
bool execute_command(const char *command);
|
||||
void discard_until(const undostruct *thisitem, openfilestruct *thefile, bool keep);
|
||||
void discard_until(const undostruct *thisitem);
|
||||
void add_undo(undo_type action, const char *message);
|
||||
void update_multiline_undo(ssize_t lineno, char *indentation);
|
||||
void update_undo(undo_type action);
|
||||
@@ -535,15 +507,15 @@ void update_undo(undo_type action);
|
||||
bool do_wrap(void);
|
||||
#endif
|
||||
#if defined(ENABLE_HELP) || defined(ENABLED_WRAPORJUSTIFY)
|
||||
ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl);
|
||||
ssize_t break_line(const char *textstart, ssize_t goal, bool snap_at_nl);
|
||||
#endif
|
||||
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
|
||||
#if !defined(NANO_TINY) || defined(ENABLED_WRAPORJUSTIFY)
|
||||
size_t indent_length(const char *line);
|
||||
#endif
|
||||
#ifdef ENABLE_JUSTIFY
|
||||
size_t quote_length(const char *line);
|
||||
bool begpar(const linestruct *const foo, int depth);
|
||||
bool inpar(const linestruct *const foo);
|
||||
bool begpar(const linestruct *const line, int depth);
|
||||
bool inpar(const linestruct *const line);
|
||||
void do_justify(bool full_justify);
|
||||
void do_justify_void(void);
|
||||
void do_full_justify(void);
|
||||
@@ -568,10 +540,10 @@ char *concatenate(const char *path, const char *name);
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
int digits(ssize_t n);
|
||||
#endif
|
||||
bool parse_num(const char *str, ssize_t *val);
|
||||
bool parse_num(const char *str, ssize_t *result);
|
||||
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column);
|
||||
void unsunder(char *string, size_t length);
|
||||
void sunder(char *string);
|
||||
void recode_NUL_to_LF(char *string, size_t length);
|
||||
void recode_LF_to_NUL(char *string);
|
||||
#if !defined(ENABLE_TINY) || defined(ENABLE_TABCOMP) || defined(ENABLE_BROWSER)
|
||||
void free_chararray(char **array, size_t len);
|
||||
#endif
|
||||
@@ -582,7 +554,7 @@ const char *strstrwrapper(const char *haystack, const char *needle,
|
||||
const char *start);
|
||||
void *nmalloc(size_t howmuch);
|
||||
void *nrealloc(void *ptr, size_t howmuch);
|
||||
char *measured_copy(const char *src, size_t n);
|
||||
char *measured_copy(const char *string, size_t count);
|
||||
char *mallocstrcpy(char *dest, const char *src);
|
||||
char *copy_of(const char *string);
|
||||
char *free_and_assign(char *dest, char *src);
|
||||
@@ -596,34 +568,27 @@ void new_magicline(void);
|
||||
void remove_magicline(void);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
void get_region(const linestruct **top, size_t *top_x,
|
||||
const linestruct **bot, size_t *bot_x, bool *right_side_up);
|
||||
void get_range(const linestruct **top, const linestruct **bot);
|
||||
bool mark_is_before_cursor(void);
|
||||
void get_region(linestruct **top, size_t *top_x, linestruct **bot, size_t *bot_x);
|
||||
void get_range(linestruct **top, linestruct **bot);
|
||||
#endif
|
||||
size_t get_totsize(const linestruct *begin, const linestruct *end);
|
||||
size_t number_of_characters_in(const linestruct *begin, const linestruct *end);
|
||||
#ifndef NANO_TINY
|
||||
linestruct *line_from_number(ssize_t lineno);
|
||||
linestruct *line_from_number(ssize_t number);
|
||||
#endif
|
||||
|
||||
/* Most functions in winio.c. */
|
||||
void record_macro(void);
|
||||
void run_macro(void);
|
||||
size_t get_key_buffer_len(void);
|
||||
void put_back(int keycode);
|
||||
void unget_kbinput(int kbinput, bool metakey);
|
||||
#ifdef ENABLE_NANORC
|
||||
void implant(const char *string);
|
||||
#endif
|
||||
int get_kbinput(WINDOW *win, bool showcursor);
|
||||
int parse_kbinput(WINDOW *win);
|
||||
int arrow_from_abcd(int kbinput);
|
||||
int parse_escape_sequence(WINDOW *win, int kbinput);
|
||||
int get_byte_kbinput(int kbinput);
|
||||
int get_control_kbinput(int kbinput);
|
||||
int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
|
||||
int *parse_verbatim_kbinput(WINDOW *win, size_t *count);
|
||||
int get_kbinput(WINDOW *win, bool showcursor);
|
||||
char *get_verbatim_kbinput(WINDOW *win, size_t *count);
|
||||
#ifdef ENABLE_MOUSE
|
||||
int get_mouseinput(int *mouse_row, int *mouse_col, bool allow_shortcuts);
|
||||
int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts);
|
||||
#endif
|
||||
void blank_edit(void);
|
||||
void blank_statusbar(void);
|
||||
@@ -635,13 +600,13 @@ char *display_string(const char *buf, size_t column, size_t span,
|
||||
void titlebar(const char *path);
|
||||
void statusline(message_type importance, const char *msg, ...);
|
||||
void statusbar(const char *msg);
|
||||
void warn_and_shortly_pause(const char *msg);
|
||||
void warn_and_briefly_pause(const char *msg);
|
||||
void bottombars(int menu);
|
||||
void post_one_key(const char *keystroke, const char *tag, int width);
|
||||
void place_the_cursor(void);
|
||||
int update_line(linestruct *fileptr, size_t index);
|
||||
int update_line(linestruct *line, size_t index);
|
||||
#ifndef NANO_TINY
|
||||
int update_softwrapped_line(linestruct *fileptr);
|
||||
int update_softwrapped_line(linestruct *line);
|
||||
#endif
|
||||
bool line_needs_update(const size_t old_column, const size_t new_column);
|
||||
int go_back_chunks(int nrows, linestruct **line, size_t *leftedge);
|
||||
@@ -654,17 +619,16 @@ size_t get_softwrap_breakpoint(const char *text, size_t leftedge,
|
||||
size_t get_chunk_and_edge(size_t column, linestruct *line, size_t *leftedge);
|
||||
size_t chunk_for(size_t column, linestruct *line);
|
||||
size_t leftedge_for(size_t column, linestruct *line);
|
||||
size_t number_of_chunks_in(linestruct *line);
|
||||
size_t extra_chunks_in(linestruct *line);
|
||||
void ensure_firstcolumn_is_aligned(void);
|
||||
#endif
|
||||
size_t actual_last_column(size_t leftedge, size_t column);
|
||||
void edit_redraw(linestruct *old_current, update_type manner);
|
||||
void edit_refresh(void);
|
||||
void adjust_viewport(update_type location);
|
||||
void total_redraw(void);
|
||||
void total_refresh(void);
|
||||
void do_cursorpos(bool force);
|
||||
void do_cursorpos_void(void);
|
||||
void adjust_viewport(update_type manner);
|
||||
void full_refresh(void);
|
||||
void draw_all_subwindows(void);
|
||||
void report_cursor_position(void);
|
||||
void spotlight(size_t from_col, size_t to_col);
|
||||
#ifndef NANO_TINY
|
||||
void spotlight_softwrapped(size_t from_col, size_t to_col);
|
||||
@@ -683,10 +647,13 @@ void backwards_void(void);
|
||||
void flip_replace(void);
|
||||
void flip_goto(void);
|
||||
#ifdef ENABLE_BROWSER
|
||||
void to_files_void(void);
|
||||
void goto_dir_void(void);
|
||||
void to_files(void);
|
||||
void to_first_file(void);
|
||||
void to_last_file(void);
|
||||
void goto_dir(void);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
void do_nothing(void);
|
||||
void do_toggle_void(void);
|
||||
void dos_format_void(void);
|
||||
void mac_format_void(void);
|
||||
911
src/rcfile.c
911
src/rcfile.c
File diff suppressed because it is too large
Load Diff
225
src/search.c
225
src/search.c
@@ -1,8 +1,8 @@
|
||||
/**************************************************************************
|
||||
* search.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2015-2018 Benno Schulenberg *
|
||||
* Copyright (C) 1999-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2015-2019 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
@@ -19,7 +19,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -69,14 +69,10 @@ void tidy_up_after_search(void)
|
||||
/* Prepare the prompt and ask the user what to search for. Keep looping
|
||||
* as long as the user presses a toggle, and only take action and exit
|
||||
* when <Enter> is pressed or a non-toggle shortcut was executed. */
|
||||
void search_init(bool replacing, bool keep_the_answer)
|
||||
void search_init(bool replacing, bool retain_answer)
|
||||
{
|
||||
char *thedefault;
|
||||
/* What will be searched for when the user typed nothing. */
|
||||
|
||||
/* When starting a new search, clear the current answer. */
|
||||
if (!keep_the_answer)
|
||||
answer = mallocstrcpy(answer, "");
|
||||
/* What will be searched for when the user types just <Enter>. */
|
||||
|
||||
/* If something was searched for earlier, include it in the prompt. */
|
||||
if (*last_search != '\0') {
|
||||
@@ -93,9 +89,9 @@ void search_init(bool replacing, bool keep_the_answer)
|
||||
while (TRUE) {
|
||||
functionptrtype func;
|
||||
/* Ask the user what to search for (or replace). */
|
||||
int response = do_prompt(FALSE, FALSE,
|
||||
int response = do_prompt(
|
||||
inhelp ? MFINDINHELP : (replacing ? MREPLACE : MWHEREIS),
|
||||
answer, &search_history, edit_refresh,
|
||||
retain_answer ? answer : "", &search_history, edit_refresh,
|
||||
/* TRANSLATORS: This is the main search prompt. */
|
||||
"%s%s%s%s%s%s", _("Search"),
|
||||
/* TRANSLATORS: The next four modify the search prompt. */
|
||||
@@ -125,15 +121,13 @@ void search_init(bool replacing, bool keep_the_answer)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* When not doing a regular-expression search, just search;
|
||||
* otherwise compile the search string, and only search when
|
||||
* the expression is valid. */
|
||||
if (!ISSET(USE_REGEXP) || regexp_init(last_search)) {
|
||||
if (replacing)
|
||||
ask_for_replacement();
|
||||
else
|
||||
go_looking();
|
||||
}
|
||||
if (ISSET(USE_REGEXP) && !regexp_init(last_search))
|
||||
break;
|
||||
|
||||
if (replacing)
|
||||
ask_for_and_do_replacements();
|
||||
else
|
||||
go_looking();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -309,33 +303,27 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
|
||||
if (match_len != NULL)
|
||||
*match_len = found_len;
|
||||
|
||||
/* Wipe the "Searching..." message and unset the suppression flag. */
|
||||
/* Wipe the "Searching..." message and unsuppress cursor-position display. */
|
||||
if (feedback > 0) {
|
||||
wipe_statusbar();
|
||||
suppress_cursorpos = FALSE;
|
||||
lastmessage = VACUUM;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Ask what to search for and then go looking for it. */
|
||||
void do_search(void)
|
||||
{
|
||||
search_init(FALSE, FALSE);
|
||||
}
|
||||
|
||||
/* Search forward for a string. */
|
||||
/* Ask for a string and then search forward for it. */
|
||||
void do_search_forward(void)
|
||||
{
|
||||
UNSET(BACKWARDS_SEARCH);
|
||||
do_search();
|
||||
search_init(FALSE, FALSE);
|
||||
}
|
||||
|
||||
/* Search backwards for a string. */
|
||||
/* Ask for a string and then search backwards for it. */
|
||||
void do_search_backward(void)
|
||||
{
|
||||
SET(BACKWARDS_SEARCH);
|
||||
do_search();
|
||||
search_init(FALSE, FALSE);
|
||||
}
|
||||
|
||||
/* Search for the last string without prompting. */
|
||||
@@ -398,7 +386,7 @@ void go_looking(void)
|
||||
linestruct *was_current = openfile->current;
|
||||
size_t was_current_x = openfile->current_x;
|
||||
|
||||
//#define TIMEIT 12
|
||||
//#define TIMEIT 12
|
||||
#ifdef TIMEIT
|
||||
#include <time.h>
|
||||
clock_t start = clock();
|
||||
@@ -500,6 +488,18 @@ char *replace_line(const char *needle)
|
||||
return copy;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
/* Reset the multiline coloring info and then recalculate it. */
|
||||
void wipe_and_recalculate_colorinfo(void)
|
||||
{
|
||||
for (linestruct *line = openfile->filetop; line != NULL; line = line->next)
|
||||
for (short index = 0; index < openfile->syntax->nmultis; index++)
|
||||
line->multidata[index] = -1;
|
||||
|
||||
precalc_multicolorinfo();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Step through each occurrence of the search string and prompt the user
|
||||
* before replacing it. We seek for needle, and replace it with answer.
|
||||
* The parameters real_current and real_current_x are needed in order to
|
||||
@@ -518,14 +518,11 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
|
||||
linestruct *was_mark = openfile->mark;
|
||||
linestruct *top, *bot;
|
||||
size_t top_x, bot_x;
|
||||
bool right_side_up = FALSE;
|
||||
/* TRUE if (mark_begin, mark_begin_x) is the top of the mark,
|
||||
* FALSE if (current, current_x) is. */
|
||||
bool right_side_up = (openfile->mark && mark_is_before_cursor());
|
||||
|
||||
/* If the mark is on, frame the region, and turn the mark off. */
|
||||
if (openfile->mark) {
|
||||
get_region((const linestruct **)&top, &top_x,
|
||||
(const linestruct **)&bot, &bot_x, &right_side_up);
|
||||
get_region(&top, &top_x, &bot, &bot_x);
|
||||
openfile->mark = NULL;
|
||||
modus = INREGION;
|
||||
|
||||
@@ -647,17 +644,17 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
|
||||
free(openfile->current->data);
|
||||
openfile->current->data = copy;
|
||||
|
||||
if (!replaceall) {
|
||||
#ifdef ENABLE_COLOR
|
||||
/* When doing syntax coloring, the replacement might require
|
||||
* a change of colors, so refresh the whole edit window. */
|
||||
if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX))
|
||||
edit_refresh();
|
||||
else
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP))
|
||||
openfile->current->extrarows = extra_chunks_in(openfile->current);
|
||||
#endif
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
}
|
||||
#ifdef ENABLE_COLOR
|
||||
/* Check whether the replacement requires a change in the coloring. */
|
||||
check_the_multis(openfile->current);
|
||||
|
||||
if (refresh_needed && !replaceall)
|
||||
wipe_and_recalculate_colorinfo();
|
||||
#endif
|
||||
set_modified();
|
||||
as_an_at = TRUE;
|
||||
numreplaced++;
|
||||
@@ -666,10 +663,12 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
|
||||
|
||||
if (numreplaced == -1)
|
||||
not_found_msg(needle);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
else if (numreplaced > 0)
|
||||
refresh_needed = TRUE;
|
||||
if (refresh_needed)
|
||||
wipe_and_recalculate_colorinfo();
|
||||
#endif
|
||||
|
||||
#ifndef NANO_TINY
|
||||
openfile->mark = was_mark;
|
||||
#endif
|
||||
@@ -693,18 +692,20 @@ void do_replace(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Ask the user what the already given search string should be replaced with. */
|
||||
void ask_for_replacement(void)
|
||||
/* Ask the user what to replace the search string with, and do the replacements. */
|
||||
void ask_for_and_do_replacements(void)
|
||||
{
|
||||
linestruct *edittop_save, *begin;
|
||||
size_t firstcolumn_save, begin_x;
|
||||
linestruct *was_edittop = openfile->edittop;
|
||||
size_t was_firstcolumn = openfile->firstcolumn;
|
||||
linestruct *beginline = openfile->current;
|
||||
size_t begin_x = openfile->current_x;
|
||||
ssize_t numreplaced;
|
||||
int response = do_prompt(FALSE, FALSE, MREPLACEWITH, "",
|
||||
int response = do_prompt(MREPLACEWITH, "", &replace_history,
|
||||
/* TRANSLATORS: This is a prompt. */
|
||||
&replace_history, edit_refresh, _("Replace with"));
|
||||
edit_refresh, _("Replace with"));
|
||||
|
||||
#ifdef ENABLE_HISTORIES
|
||||
/* If the replace string is not "", add it to the replace history list. */
|
||||
/* When not "", add the replace string to the replace history list. */
|
||||
if (response == 0)
|
||||
update_history(&replace_history, answer);
|
||||
#endif
|
||||
@@ -716,18 +717,12 @@ void ask_for_replacement(void)
|
||||
} else if (response > 0)
|
||||
return;
|
||||
|
||||
/* Save where we are. */
|
||||
edittop_save = openfile->edittop;
|
||||
firstcolumn_save = openfile->firstcolumn;
|
||||
begin = openfile->current;
|
||||
begin_x = openfile->current_x;
|
||||
|
||||
numreplaced = do_replace_loop(last_search, FALSE, begin, &begin_x);
|
||||
numreplaced = do_replace_loop(last_search, FALSE, beginline, &begin_x);
|
||||
|
||||
/* Restore where we were. */
|
||||
openfile->edittop = edittop_save;
|
||||
openfile->firstcolumn = firstcolumn_save;
|
||||
openfile->current = begin;
|
||||
openfile->edittop = was_edittop;
|
||||
openfile->firstcolumn = was_firstcolumn;
|
||||
openfile->current = beginline;
|
||||
openfile->current_x = begin_x;
|
||||
refresh_needed = TRUE;
|
||||
|
||||
@@ -752,15 +747,14 @@ void goto_line_posx(ssize_t line, size_t pos_x)
|
||||
/* Go to the specified line and column, or ask for them if interactive
|
||||
* is TRUE. In the latter case also update the screen afterwards.
|
||||
* Note that both the line and column number should be one-based. */
|
||||
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
||||
void do_gotolinecolumn(ssize_t line, ssize_t column, bool retain_answer,
|
||||
bool interactive)
|
||||
{
|
||||
if (interactive) {
|
||||
/* Ask for the line and column. */
|
||||
int response = do_prompt(FALSE, FALSE, MGOTOLINE,
|
||||
use_answer ? answer : "", NULL, edit_refresh,
|
||||
int response = do_prompt(MGOTOLINE, retain_answer ? answer : "", NULL,
|
||||
/* TRANSLATORS: This is a prompt. */
|
||||
_("Enter line number, column number"));
|
||||
edit_refresh, _("Enter line number, column number"));
|
||||
|
||||
/* If the user cancelled or gave a blank answer, get out. */
|
||||
if (response < 0) {
|
||||
@@ -770,7 +764,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
||||
|
||||
if (func_from_key(&response) == flip_goto) {
|
||||
UNSET(BACKWARDS_SEARCH);
|
||||
/* Retain what the user typed so far and switch to searching. */
|
||||
/* Switch to searching but retain what the user typed so far. */
|
||||
search_init(FALSE, TRUE);
|
||||
return;
|
||||
}
|
||||
@@ -865,8 +859,8 @@ bool find_a_bracket(bool reverse, const char *bracket_pair)
|
||||
linestruct *line = openfile->current;
|
||||
const char *pointer, *found;
|
||||
|
||||
/* Step away from the current bracket, either backwards or forwards. */
|
||||
if (reverse) {
|
||||
/* First step away from the current bracket. */
|
||||
if (openfile->current_x == 0) {
|
||||
line = line->prev;
|
||||
if (line == NULL)
|
||||
@@ -874,31 +868,23 @@ bool find_a_bracket(bool reverse, const char *bracket_pair)
|
||||
pointer = line->data + strlen(line->data);
|
||||
} else
|
||||
pointer = line->data + step_left(line->data, openfile->current_x);
|
||||
} else
|
||||
|
||||
/* Now seek for any of the two brackets we are interested in. */
|
||||
while (!(found = mbrevstrpbrk(line->data, bracket_pair, pointer))) {
|
||||
line = line->prev;
|
||||
if (line == NULL)
|
||||
return FALSE;
|
||||
pointer = line->data + strlen(line->data);
|
||||
}
|
||||
} else {
|
||||
pointer = line->data + step_right(line->data, openfile->current_x);
|
||||
|
||||
/* Now seek for any of the two brackets, either backwards or forwards. */
|
||||
while (TRUE) {
|
||||
if (reverse)
|
||||
found = mbrevstrpbrk(line->data, bracket_pair, pointer);
|
||||
else
|
||||
found = mbstrpbrk(pointer, bracket_pair);
|
||||
|
||||
if (found)
|
||||
break;
|
||||
|
||||
if (reverse)
|
||||
line = line->prev;
|
||||
else
|
||||
while (!(found = mbstrpbrk(pointer, bracket_pair))) {
|
||||
line = line->next;
|
||||
|
||||
/* If we've reached the start or end of the buffer, get out. */
|
||||
if (line == NULL)
|
||||
return FALSE;
|
||||
|
||||
pointer = line->data;
|
||||
if (reverse)
|
||||
pointer += strlen(line->data);
|
||||
if (line == NULL)
|
||||
return FALSE;
|
||||
pointer = line->data;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the current position to the found bracket. */
|
||||
@@ -986,4 +972,55 @@ void do_find_bracket(void)
|
||||
openfile->current = was_current;
|
||||
openfile->current_x = was_current_x;
|
||||
}
|
||||
|
||||
/* Place an anchor at the current line when none exists, otherwise remove it. */
|
||||
void put_or_lift_anchor(void)
|
||||
{
|
||||
openfile->current->has_anchor = !openfile->current->has_anchor;
|
||||
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
|
||||
if (openfile->current->has_anchor)
|
||||
statusbar(_("Placed anchor"));
|
||||
else
|
||||
statusbar(_("Removed anchor"));
|
||||
}
|
||||
|
||||
/* Make the given line the current line, or report the anchoredness. */
|
||||
void go_to_and_confirm(linestruct *line)
|
||||
{
|
||||
linestruct *was_current = openfile->current;
|
||||
|
||||
if (line != openfile->current) {
|
||||
openfile->current = line;
|
||||
openfile->current_x = 0;
|
||||
edit_redraw(was_current, CENTERING);
|
||||
statusbar(_("Jumped to anchor"));
|
||||
} else if (openfile->current->has_anchor)
|
||||
statusbar(_("This is the only anchor"));
|
||||
else
|
||||
statusbar(_("There are no anchors"));
|
||||
}
|
||||
|
||||
/* Jump to the first anchor before the current line; wrap around at the top. */
|
||||
void to_prev_anchor(void)
|
||||
{
|
||||
linestruct *line = openfile->current;
|
||||
|
||||
do { line = (line->prev) ? line->prev : openfile->filebot;
|
||||
} while (!line->has_anchor && line != openfile->current);
|
||||
|
||||
go_to_and_confirm(line);
|
||||
}
|
||||
|
||||
/* Jump to the first anchor after the current line; wrap around at the bottom. */
|
||||
void to_next_anchor(void)
|
||||
{
|
||||
linestruct *line = openfile->current;
|
||||
|
||||
do { line = (line->next) ? line->next : openfile->filetop;
|
||||
} while (!line->has_anchor && line != openfile->current);
|
||||
|
||||
go_to_and_confirm(line);
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
1852
src/text.c
1852
src/text.c
File diff suppressed because it is too large
Load Diff
66
src/utils.c
66
src/utils.c
@@ -1,8 +1,8 @@
|
||||
/**************************************************************************
|
||||
* utils.c -- This file is part of GNU nano. *
|
||||
* *
|
||||
* Copyright (C) 1999-2011, 2013-2019 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2016-2017 Benno Schulenberg *
|
||||
* Copyright (C) 1999-2011, 2013-2020 Free Software Foundation, Inc. *
|
||||
* Copyright (C) 2016, 2017, 2019 Benno Schulenberg *
|
||||
* *
|
||||
* GNU nano is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published *
|
||||
@@ -19,7 +19,7 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "proto.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_PWD_H
|
||||
@@ -38,7 +38,7 @@ void get_homedir(void)
|
||||
#ifdef HAVE_PWD_H
|
||||
/* When HOME isn't set, or when we're root, get the home directory
|
||||
* from the password file instead. */
|
||||
if (homenv == NULL || geteuid() == 0) {
|
||||
if (homenv == NULL || geteuid() == ROOT_UID) {
|
||||
const struct passwd *userage = getpwuid(geteuid());
|
||||
|
||||
if (userage != NULL)
|
||||
@@ -160,7 +160,7 @@ bool parse_line_column(const char *str, ssize_t *line, ssize_t *column)
|
||||
}
|
||||
|
||||
/* In the given string, recode each embedded NUL as a newline. */
|
||||
void unsunder(char *string, size_t length)
|
||||
void recode_NUL_to_LF(char *string, size_t length)
|
||||
{
|
||||
while (length > 0) {
|
||||
if (*string == '\0')
|
||||
@@ -171,7 +171,7 @@ void unsunder(char *string, size_t length)
|
||||
}
|
||||
|
||||
/* In the given string, recode each embedded newline as a NUL. */
|
||||
void sunder(char *string)
|
||||
void recode_LF_to_NUL(char *string)
|
||||
{
|
||||
while (*string != '\0') {
|
||||
if (*string == '\n')
|
||||
@@ -209,8 +209,8 @@ bool is_separate_word(size_t position, size_t length, const char *buf)
|
||||
/* 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)));
|
||||
return ((position == 0 || !is_alpha_char(before)) &&
|
||||
(buf[word_end] == '\0' || !is_alpha_char(after)));
|
||||
}
|
||||
#endif /* ENABLE_SPELLER */
|
||||
|
||||
@@ -324,12 +324,14 @@ char *mallocstrcpy(char *dest, const char *src)
|
||||
return dest;
|
||||
}
|
||||
|
||||
/* Return an allocated copy of the first count characters of the given string. */
|
||||
/* Return an allocated copy of the first count characters
|
||||
* of the given string, and NUL-terminate the copy. */
|
||||
char *measured_copy(const char *string, size_t count)
|
||||
{
|
||||
char *thecopy = charalloc(count);
|
||||
char *thecopy = charalloc(count + 1);
|
||||
|
||||
strncpy(thecopy, string, count);
|
||||
thecopy[count] = '\0';
|
||||
|
||||
return thecopy;
|
||||
}
|
||||
@@ -337,7 +339,7 @@ char *measured_copy(const char *string, size_t count)
|
||||
/* Return an allocated copy of the given string. */
|
||||
char *copy_of(const char *string)
|
||||
{
|
||||
return measured_copy(string, strlen(string) + 1);
|
||||
return measured_copy(string, strlen(string));
|
||||
}
|
||||
|
||||
/* Free the string at dest and return the string at src. */
|
||||
@@ -448,35 +450,35 @@ void remove_magicline(void)
|
||||
#endif
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Return in (top, top_x) and (bot, bot_x) the start and end "coordinates"
|
||||
* of the marked region. If right_side_up isn't NULL, set it to TRUE when
|
||||
* the mark is at the top of the marked region, and to FALSE otherwise. */
|
||||
void get_region(const linestruct **top, size_t *top_x,
|
||||
const linestruct **bot, size_t *bot_x, bool *right_side_up)
|
||||
/* Return TRUE when the mark is before or at the cursor, and FALSE otherwise. */
|
||||
bool mark_is_before_cursor(void)
|
||||
{
|
||||
if (openfile->mark->lineno < openfile->current->lineno ||
|
||||
(openfile->mark == openfile->current &&
|
||||
openfile->mark_x < openfile->current_x)) {
|
||||
return (openfile->mark->lineno < openfile->current->lineno ||
|
||||
(openfile->mark == openfile->current &&
|
||||
openfile->mark_x <= openfile->current_x));
|
||||
}
|
||||
|
||||
/* Return in (top, top_x) and (bot, bot_x) the start and end "coordinates"
|
||||
* of the marked region. */
|
||||
void get_region(linestruct **top, size_t *top_x, linestruct **bot, size_t *bot_x)
|
||||
{
|
||||
if (mark_is_before_cursor()) {
|
||||
*top = openfile->mark;
|
||||
*top_x = openfile->mark_x;
|
||||
*bot = openfile->current;
|
||||
*bot_x = openfile->current_x;
|
||||
if (right_side_up != NULL)
|
||||
*right_side_up = TRUE;
|
||||
} else {
|
||||
*bot = openfile->mark;
|
||||
*bot_x = openfile->mark_x;
|
||||
*top = openfile->current;
|
||||
*top_x = openfile->current_x;
|
||||
if (right_side_up != NULL)
|
||||
*right_side_up = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the set of lines to work on -- either just the current line, or the
|
||||
* first to last lines of the marked region. When the cursor (or mark) is
|
||||
* at the start of the last line of the region, exclude that line. */
|
||||
void get_range(const linestruct **top, const linestruct **bot)
|
||||
void get_range(linestruct **top, linestruct **bot)
|
||||
{
|
||||
if (!openfile->mark) {
|
||||
*top = openfile->current;
|
||||
@@ -484,7 +486,7 @@ void get_range(const linestruct **top, const linestruct **bot)
|
||||
} else {
|
||||
size_t top_x, bot_x;
|
||||
|
||||
get_region(top, &top_x, bot, &bot_x, NULL);
|
||||
get_region(top, &top_x, bot, &bot_x);
|
||||
|
||||
if (bot_x == 0 && *bot != *top && !also_the_last)
|
||||
*bot = (*bot)->prev;
|
||||
@@ -510,19 +512,15 @@ linestruct *line_from_number(ssize_t number)
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* Count the number of characters from begin to end, and return it. */
|
||||
size_t get_totsize(const linestruct *begin, const linestruct *end)
|
||||
size_t number_of_characters_in(const linestruct *begin, const linestruct *end)
|
||||
{
|
||||
const linestruct *line;
|
||||
size_t totsize = 0;
|
||||
size_t count = 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;
|
||||
count += 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;
|
||||
/* Do not count the final newline. */
|
||||
return (count - 1);
|
||||
}
|
||||
|
||||
2264
src/winio.c
2264
src/winio.c
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,9 @@ pkgdata_DATA = asm.nanorc \
|
||||
cmake.nanorc \
|
||||
c.nanorc \
|
||||
css.nanorc \
|
||||
debian.nanorc \
|
||||
default.nanorc \
|
||||
elisp.nanorc \
|
||||
fortran.nanorc \
|
||||
gentoo.nanorc \
|
||||
email.nanorc \
|
||||
go.nanorc \
|
||||
groff.nanorc \
|
||||
guile.nanorc \
|
||||
@@ -20,8 +18,7 @@ pkgdata_DATA = asm.nanorc \
|
||||
lua.nanorc \
|
||||
makefile.nanorc \
|
||||
man.nanorc \
|
||||
mgp.nanorc \
|
||||
mutt.nanorc \
|
||||
markdown.nanorc \
|
||||
nanohelp.nanorc \
|
||||
nanorc.nanorc \
|
||||
nftables.nanorc \
|
||||
@@ -31,16 +28,23 @@ pkgdata_DATA = asm.nanorc \
|
||||
perl.nanorc \
|
||||
php.nanorc \
|
||||
po.nanorc \
|
||||
postgresql.nanorc \
|
||||
pov.nanorc \
|
||||
python.nanorc \
|
||||
ruby.nanorc \
|
||||
rust.nanorc \
|
||||
sh.nanorc \
|
||||
spec.nanorc \
|
||||
sql.nanorc \
|
||||
tcl.nanorc \
|
||||
tex.nanorc \
|
||||
texinfo.nanorc \
|
||||
xml.nanorc
|
||||
|
||||
EXTRA_DIST = $(pkgdata_DATA)
|
||||
nobase_pkgdata_DATA = \
|
||||
extra/ada.nanorc \
|
||||
extra/debian.nanorc \
|
||||
extra/fortran.nanorc \
|
||||
extra/gentoo.nanorc \
|
||||
extra/haskell.nanorc \
|
||||
extra/povray.nanorc \
|
||||
extra/spec.nanorc
|
||||
|
||||
EXTRA_DIST = $(pkgdata_DATA) $(nobase_pkgdata_DATA)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for assembler.
|
||||
## Syntax highlighting for assembler.
|
||||
|
||||
syntax asm "\.(S|s|asm)$"
|
||||
magic "assembler source"
|
||||
@@ -13,9 +13,6 @@ color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|
|
||||
|
||||
# Strings.
|
||||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||
# Multiline strings. This regex is VERY resource intensive,
|
||||
# and sometimes colours things that shouldn't be coloured.
|
||||
###color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
# Comments.
|
||||
color brightblue "//.*"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
## Here is an example for Autoconf.
|
||||
## Syntax highlighting for Autoconf.
|
||||
|
||||
syntax autoconf "\.(ac|m4)$"
|
||||
comment "#"
|
||||
|
||||
# Keywords:
|
||||
color yellow "\<(if|test|then|elif|else|fi|for|in|do|done)\>"
|
||||
color yellow "(=|!=|&&|\|\|)"
|
||||
color yellow "=|!=|&&|\|\|"
|
||||
|
||||
# Macros:
|
||||
color cyan "\<[[:upper:]_[:digit:]]+\>"
|
||||
@@ -14,7 +14,7 @@ color cyan "\<[[:upper:]_[:digit:]]+\>"
|
||||
color red "\<[-_.0-9]+\>"
|
||||
|
||||
# Strings:
|
||||
color red "\"[^"]*\"" "\'[^']*\'"
|
||||
color red ""[^"]*"" "'[^']*'"
|
||||
|
||||
# Backticks:
|
||||
color green "`[^`]*`"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for awk.
|
||||
## Syntax highlighting for AWK scripts.
|
||||
|
||||
syntax awk "\.awk$"
|
||||
header "^#!.*awk"
|
||||
@@ -14,7 +14,7 @@ color red "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>"
|
||||
# Function declarations and special patterns.
|
||||
color brightgreen "\<(function|extension|BEGIN|END)\>"
|
||||
# Operators.
|
||||
color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)"
|
||||
color green "\{|\}|\(|\)|\;|\[|\]|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|"
|
||||
# Flow control.
|
||||
color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>"
|
||||
color brightyellow "\<(break|continue|return)\>"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for C/C++.
|
||||
## Syntax highlighting for C and C++ files.
|
||||
|
||||
syntax c "\.([ch](pp|xx)?|C|cc|c\+\+|cu|H|hh|ii?)$"
|
||||
header "-\*-.*\<C(\+\+)?((;|\s).*)?-\*-"
|
||||
@@ -24,9 +24,6 @@ color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidd
|
||||
# Strings. In general you will want your strings and comments to come last,
|
||||
# because highlighting rules are applied in the order they are read in.
|
||||
color brightyellow ""([^"]|\\")*"" "#[[:space:]]*include[[:space:]]+<[^[:blank:]=]*>"
|
||||
# Multiline strings. This regex is VERY resource intensive,
|
||||
# and sometimes colours things that shouldn't be coloured.
|
||||
###color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
# Preprocessor directives.
|
||||
color brightcyan start="^[[:space:]]*#[[:space:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\\])$"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Colouring for Changelogs.
|
||||
## Syntax highlighting for Changelogs.
|
||||
|
||||
syntax changelog "Change[Ll]og[^/]*$"
|
||||
|
||||
@@ -12,7 +12,7 @@ color yellow "<[^>]*@[^>]*>"
|
||||
# Command-line options.
|
||||
color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+"
|
||||
# Bug and patch numbers.
|
||||
color cyan "(BZ|bug|patch) #[0-9]+" "PR [[:alnum:]]+/[0-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,4 +1,4 @@
|
||||
## Here is an example for CSS files.
|
||||
## Syntax highlighting for CSS files.
|
||||
|
||||
syntax css "\.css$"
|
||||
comment "/*|*/"
|
||||
@@ -6,6 +6,6 @@ comment "/*|*/"
|
||||
color brightred "."
|
||||
color brightyellow start="\{" end="\}"
|
||||
color brightwhite start=":" end="([;^\{]|$)"
|
||||
color brightblue ":active|:focus|:hover|:link|:visited|:link|:after|:before|$"
|
||||
color brightblue start="\/\*" end="\\*/"
|
||||
color brightblue ":active|:focus|:hover|:link|:visited|:link|:after|:before"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
color green ";|:|\{|\}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## An example of a default syntax. The default syntax is used for
|
||||
## This is an example of a default syntax. The default syntax is used for
|
||||
## files that do not match any other syntax.
|
||||
|
||||
syntax default
|
||||
@@ -18,3 +18,6 @@ color magenta "<[[:alnum:].%_+-]+@[[:alnum:].-]+\.[[:alpha:]]{2,}>"
|
||||
|
||||
# Bracketed captions in certain config files.
|
||||
color brightgreen "^\[[^][]+\]$"
|
||||
|
||||
# Control codes.
|
||||
color latte "[[:cntrl:]]"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for Emacs Lisp.
|
||||
## Syntax highlighting for Emacs Lisp.
|
||||
|
||||
syntax elisp "\.el$"
|
||||
magic "Lisp/Scheme program"
|
||||
@@ -27,7 +27,7 @@ color brightred "\<(t|nil)\>"
|
||||
# Keywords
|
||||
color blue ":(\w|[?-])+"
|
||||
# Strings
|
||||
color yellow start="^[[:blank:]]+\"" end="[^\]\""
|
||||
color yellow start="^[[:blank:]]+"" end="[^\]""
|
||||
color yellow ""(\\.|[^"])*""
|
||||
# Comments
|
||||
color cyan "(^|[[:space:]]);.*"
|
||||
|
||||
17
syntax/email.nanorc
Normal file
17
syntax/email.nanorc
Normal file
@@ -0,0 +1,17 @@
|
||||
## Syntax highlighting for emails.
|
||||
|
||||
syntax email "\.eml$"
|
||||
|
||||
# Quoted lines.
|
||||
color green "^>.*"
|
||||
color cyan "^> ?>.*"
|
||||
color yellow "^> ?> ?>.*"
|
||||
|
||||
# Email addresses.
|
||||
color brightmagenta "<[^@]+@[^@]+>"
|
||||
|
||||
# URLs.
|
||||
color brightblue "(https?|ftp)://\S+\.\S+[^\s.)]"
|
||||
|
||||
# Signatures, even quoted ones.
|
||||
color yellow start="^>* ?-- $" end="^>* ?$"
|
||||
39
syntax/extra/ada.nanorc
Normal file
39
syntax/extra/ada.nanorc
Normal file
@@ -0,0 +1,39 @@
|
||||
## Syntax highlighting for Ada.
|
||||
|
||||
## Original author: Andreas K. Foerster
|
||||
## License: GPL version 3 or newer
|
||||
|
||||
## Language reference: http://www.ada-auth.org/standards/12rm/html/RM-TTL.html
|
||||
|
||||
syntax ada "\.ad[abcs]$"
|
||||
comment "--"
|
||||
|
||||
# This linter command leaves an ALI file in the working directory.
|
||||
linter gcc -c -gnatc
|
||||
|
||||
# Reserved Words (RM 2.9)
|
||||
icolor yellow "\<(abort|abs|abstract|accept|access|aliased|all|and|array|at)\>"
|
||||
icolor yellow "\<(begin|body|case|constant|declare|delay|delta|do)\>"
|
||||
icolor yellow "\<(else|elsif|end|entry|exception|exit|for|function|generic|goto)\>"
|
||||
icolor yellow "\<(if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding)\>"
|
||||
icolor yellow "\<(package|pragma|private|procedure|protected|raise|range|record|rem|renames)\>"
|
||||
icolor yellow "\<(requeue|return|reverse|select|separate|some|subtype|synchronized)\>"
|
||||
icolor yellow "\<(tagged|task|terminate|then|type|until|use|when|while|with|xor)\>"
|
||||
|
||||
# Separators / Operators
|
||||
color magenta "'|&|\*|\+|\-|\.|\,|\/|:|;|\(|\)|<|>|\||="
|
||||
|
||||
# Attributes
|
||||
color cyan "'[[:alnum:]]+"
|
||||
|
||||
# Numbers (RM 2.4)
|
||||
color green "\<[0-9][0-9A-Fa-f_#.+-]*"
|
||||
|
||||
# Characters / Strings
|
||||
color red "'.'" ""[^"]*""
|
||||
|
||||
# Comments
|
||||
color brightblue "--.*"
|
||||
|
||||
# Trailing whitespace
|
||||
color ,blue "[[:space:]]+$"
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for apt's sources.list.
|
||||
## Syntax highlighting for apt's sources.list.
|
||||
|
||||
syntax sources.list "sources\.list(\.d/.*\.list)?(~|\.old|\.save)?$"
|
||||
comment "#"
|
||||
@@ -1,6 +1,6 @@
|
||||
## Here is an example for Fortran 90/95.
|
||||
## Syntax highlighting for Fortran 90/95.
|
||||
|
||||
syntax fortran "\.(f|f90|f95)$"
|
||||
syntax fortran "\.(f|for|f90|f95)$"
|
||||
comment "!"
|
||||
|
||||
color red "\<[0-9]+\>"
|
||||
@@ -1,5 +1,5 @@
|
||||
## Here is an example for Gentoo ebuilds/eclasses,
|
||||
## and (further down) one for Portage control files.
|
||||
## Syntax highlighting for Gentoo ebuilds/eclasses,
|
||||
## and (further down) for Portage control files.
|
||||
|
||||
syntax ebuild "\.e(build|class|blit)$"
|
||||
comment "#"
|
||||
40
syntax/extra/haskell.nanorc
Normal file
40
syntax/extra/haskell.nanorc
Normal file
@@ -0,0 +1,40 @@
|
||||
## Syntax highlighting for Haskell files.
|
||||
|
||||
## Original author: Alex Taber
|
||||
## License: GPL version 3
|
||||
|
||||
syntax "haskell" "\.hs$"
|
||||
comment "--"
|
||||
|
||||
# Keywords
|
||||
color red "\<(as|case|of|class|data|default|deriving|do|forall|foreign|hiding|if|then|else|import|infix(l|r)?|instance|let|in|mdo|module|newtype|qualified|type|where)\>"
|
||||
|
||||
# Various symbols
|
||||
color cyan "\||@|!|:|_|~|=|\\|;|\(\)|,|\[|\]|\{|\}"
|
||||
|
||||
# Operators
|
||||
color magenta "==|/=|&&|\|\||<|>|<=|>="
|
||||
|
||||
# More symbols
|
||||
color cyan "->|<-|=>"
|
||||
color magenta "\.|\$"
|
||||
|
||||
# Data constructors
|
||||
color magenta "\<(True|False|Nothing|Just|Left|Right|LT|EQ|GT)\>"
|
||||
# Data classes
|
||||
color magenta "\<(Bounded|Data|Enum|Eq|Floating|Fractional|Functor|Integral|Monad|MonadPlus|Num|Ord|Read|Real|RealFloat|RealFrac|Show|Typeable)\>"
|
||||
|
||||
# Special keyword
|
||||
color brightred "undefined"
|
||||
|
||||
# Strings
|
||||
color yellow ""([^\"]|\\.)*""
|
||||
# Characters
|
||||
color brightyellow "'([^\']|\\.)'"
|
||||
|
||||
# Comments
|
||||
color green "--.*"
|
||||
color green start="\{-" end="-\}"
|
||||
|
||||
# Trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for POV-Ray.
|
||||
## Syntax highlighting for POV-Ray files.
|
||||
|
||||
syntax pov "\.(pov|POV|povray|POVRAY)$"
|
||||
comment "//"
|
||||
@@ -8,7 +8,7 @@ color brightyellow "\<(sphere|cylinder|translate|matrix|rotate|scale)\>"
|
||||
color brightyellow "\<(orthographic|location|up|right|direction|clipped_by)\>"
|
||||
color brightyellow "\<(fog_type|fog_offset|fog_alt|rgb|distance|transform)\>"
|
||||
color brightred "\<(background|camera|fog|light_source|object|texture)\>"
|
||||
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||
color green "\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|"
|
||||
color brightmagenta "\<(union|group|subgroup)\>"
|
||||
|
||||
# Comments.
|
||||
41
syntax/extra/spec.nanorc
Normal file
41
syntax/extra/spec.nanorc
Normal file
@@ -0,0 +1,41 @@
|
||||
## Syntax highlighting for RPM spec files.
|
||||
|
||||
syntax spec "\.spec(\.[^/]+)?$"
|
||||
comment "#"
|
||||
|
||||
# Main tags.
|
||||
color brightblue "\<(Name|Version|Release|Summary|Group|URL|Url|Epoch|Icon|Serial)[[:space:]]*:"
|
||||
color brightblue "\<(BuildArch(itectures)?|Exclusive(Arch|OS)|Exclude(Arch|OS))[[:space:]]*:"
|
||||
color brightblue "\<(Provides|Requires(\(.*\))?|Obsoletes|Conflicts|Recommends|Suggests|Supplements|Enhances|PreReq)[[:space:]]*:"
|
||||
color brightblue "\<(BuildRoot|BuildRequires|BuildConflicts|Prefix|RemovePathPostfixes)[[:space:]]*:"
|
||||
color brightblue "\<(AutoReq|AutoProv|AutoReqProv)[[:space:]]*:"
|
||||
color brightblue "\<(License|Copyright|Distribution|Vendor|Packager)[[:space:]]*:"
|
||||
color brightblue "\<((Source|Patch)[0-9]*|Nosource|Nopatch)[[:space:]]*:"
|
||||
# Architectures.
|
||||
color brightred "\<(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppciseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x?|noarch)\>"
|
||||
# Architecture and OS conditionals.
|
||||
color brightred "%(ifarch|elifarch|ifnarch|ifos|elifos|ifnos)\>"
|
||||
# %* strings.
|
||||
color green "%([A-Z_a-z_0-9_]*)"
|
||||
color magenta "%_([A-Z_a-z_0-9_]*)"
|
||||
color yellow start="%__" end="\ "
|
||||
color magenta start="%\{" end="\}"
|
||||
color yellow start="%\{__" end="\}"
|
||||
# Sections.
|
||||
color red "^%((prep|build|install|check|clean)$|(description|files|package|changelog)\>)"
|
||||
color red "^%((pre|post)(trans|un)?|trigger(prein|in|un|postun)?)\>"
|
||||
color red "^%(trans)?filetrigger(in|un|postun)\>"
|
||||
color red "^%(sourcelist|patchlist|generate_buildrequires|verifyscript)\>"
|
||||
# Conditionals and defines.
|
||||
color brightred "%(if|elif|else|endif|define|global|undefine)\>"
|
||||
|
||||
# Comments.
|
||||
color cyan "(#|%dnl[[:space:]]).*"
|
||||
# Special case: "# norootforbuild" is handled as main tag.
|
||||
color brightblue "^# norootforbuild"
|
||||
# For %changelog entries: first the author, then just the date.
|
||||
color yellow "^\* .+>"
|
||||
color brightyellow "^\* [[:alnum:] ]+ [0-9]{4} "
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for Go.
|
||||
## Syntax highlighting for Go.
|
||||
|
||||
syntax go "\.go$"
|
||||
comment "//"
|
||||
@@ -7,7 +7,8 @@ formatter gofmt -w
|
||||
|
||||
# Types.
|
||||
color green "\<(bool|u?int(8|16|32|64)?|float(32|64)|complex(64|128)|byte|rune|uintptr|string|error)\>"
|
||||
color green "\<((<-[[:space:]]*)chan|chan[[:space:]]*<-|const|func|interface|map|struct|type|var)\>"
|
||||
color green "\<(chan|const|func|interface|map|struct|type|var)\>"
|
||||
color green "<-[[:space:]]*chan\>|\<chan[[:space:]]*<-"
|
||||
|
||||
# Predefined functions.
|
||||
color blue "\<(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\>"
|
||||
@@ -20,7 +21,6 @@ color magenta "\<(break|continue|fallthrough|goto|return)\>"
|
||||
|
||||
# Declarations.
|
||||
color brightcyan "\<(package|import)\>"
|
||||
color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+"
|
||||
|
||||
# Literals.
|
||||
color red "\<([1-9][0-9]*|0[0-7]*|0[xX][0-9A-Fa-f]+)\>"
|
||||
@@ -39,5 +39,8 @@ color red start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
color brightblue "//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
# Special comments.
|
||||
color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for groff.
|
||||
## Syntax highlighting for groff.
|
||||
|
||||
syntax groff "(/tmac\.[^/]+$|\.(m[ems]|rof|tmac)$)"
|
||||
comment ".\""
|
||||
@@ -8,17 +8,17 @@ color cyan "^\.(ds|nr) [^[:space:]]*"
|
||||
# Single-character escapes
|
||||
color brightmagenta "\\."
|
||||
# The argument of \f or \s in the same color
|
||||
color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]"
|
||||
color brightmagenta "\\f(.|\(..)" "\\s(\+|\-)?[0-9]"
|
||||
# Newlines
|
||||
color cyan "(\\|\\\\)n(.|\(..)"
|
||||
color cyan start="(\\|\\\\)n\[" end="]"
|
||||
color cyan "\\(\\)?n(.|\(..)"
|
||||
color cyan start="\\(\\)?n\[" end="]"
|
||||
# Requests
|
||||
color brightgreen "^\.[[:space:]]*[^[:space:]]*"
|
||||
# Comments
|
||||
color yellow "^\.\\".*"
|
||||
# Strings
|
||||
color green "(\\|\\\\)\*(.|\(..)"
|
||||
color green start="(\\|\\\\)\*\[" end="]"
|
||||
color green "\\(\\)?\*(.|\(..)"
|
||||
color green start="\\(\\)?\*\[" end="]"
|
||||
# Characters
|
||||
color brightred "\\\(.."
|
||||
color brightred start="\\\[" end="]"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for Guile Scheme.
|
||||
## Syntax highlighting for Guile Scheme.
|
||||
|
||||
syntax guile "\.scm$"
|
||||
header "^#!.*guile"
|
||||
@@ -18,7 +18,7 @@ color brightred "(#t|#f)\>"
|
||||
# Keywords
|
||||
color blue "#?:(\w|[?-])+"
|
||||
# Strings
|
||||
color yellow start="^[[:blank:]]+\"" end="[^\]\""
|
||||
color yellow start="^[[:blank:]]+"" end="[^\]""
|
||||
color yellow ""(\\.|[^"])*""
|
||||
# Comments
|
||||
color cyan "(^|[[:space:]]);.*"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for HTML.
|
||||
## Syntax highlighting for HTML.
|
||||
|
||||
syntax html "\.html?$"
|
||||
magic "HTML document"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Here is an example for Java.
|
||||
## Syntax highlighting for Java.
|
||||
|
||||
syntax java "\.java$"
|
||||
magic "Java "
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
## Syntax highlighting for JSON files.
|
||||
|
||||
# See: http://www.json.org/
|
||||
# Original author: Aapo Rantalainen
|
||||
# License: GPLv3 or newer
|
||||
## Original author: Aapo Rantalainen
|
||||
## License: GPL version 3 or newer
|
||||
|
||||
syntax json "\.json$"
|
||||
# No comments are permitted in JSON.
|
||||
@@ -11,16 +10,16 @@ comment ""
|
||||
# Numbers (used as value).
|
||||
color green ":[[:space:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?"
|
||||
# Values (well, any string).
|
||||
color brightmagenta "\".+\""
|
||||
color brightmagenta "".+""
|
||||
# Hex numbers (used as value).
|
||||
color green ":[[:space:]]*\"#[0-9abcdefABCDEF]+\""
|
||||
color green ":[[:space:]]*"#[0-9abcdefABCDEF]+""
|
||||
# Escapes.
|
||||
color green "\\\\" "\\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})"
|
||||
color green "\\\\" "\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})"
|
||||
# Special words.
|
||||
color green "(true|false|null)"
|
||||
color green "\<(true|false|null)\>"
|
||||
|
||||
# Names (very unlikely to contain a quote).
|
||||
color brightblue "\"[^"]+\"[[:space:]]*:"
|
||||
color brightblue ""[^"]+"[[:space:]]*:"
|
||||
|
||||
# Brackets, braces, and separators.
|
||||
color brightblue "\[" "\]"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user