Compare commits

...

84 Commits

Author SHA1 Message Date
Chris Allegretta
423cbfd743 off by one in toggle help code and set up for 0.9.17 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@203 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 16:21:29 +00:00
Chris Allegretta
5577aec4e8 5 newlines instead of 4 on suspend and po update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@202 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 03:53:04 +00:00
Chris Allegretta
18f8be0058 Implemented suspend code to work with Meta-Z
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@201 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 03:20:38 +00:00
Chris Allegretta
f8163dc2e7 Added space to autoindent toggle string
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@200 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-03 01:06:40 +00:00
Chris Allegretta
f0f63a82fb Changed awkward messages for no help and no wrap mode toggles
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@199 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 18:44:21 +00:00
Chris Allegretta
a547fd1e0e Removed commented out wrap code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@198 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 17:38:44 +00:00
Chris Allegretta
6306a11ad6 update_line(): Added check for binary data >= 1 and <= 26, and use ^+letter ot display it
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@197 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:55:41 +00:00
Chris Allegretta
9541f2a1d3 credit to Mini edit team for Meta idea
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@196 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:31:32 +00:00
Chris Allegretta
d56bd79daf Fixed typos and updated PO files
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@195 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:27:10 +00:00
Chris Allegretta
e49f123cc0 Moved the toggle Meta keystrokes to the first column. Updated documentation and help code for Meta keys rather than 'alt keys'
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@194 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:20:39 +00:00
Chris Allegretta
4c780be883 Added small message when using --enable-tiny and toggle keys
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@193 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 17:59:18 +00:00
Chris Allegretta
220e7fb132 Oops, fixed the VERSION back to -cvs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@192 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 13:37:49 +00:00
Chris Allegretta
756f220a26 New toggles for flags via Meta
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@191 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 13:32:47 +00:00
Chris Allegretta
cf7c9936ad Updated BUGS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@190 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-30 13:57:36 +00:00
Chris Allegretta
9babaf3b38 findnextstr() - Fixed check for string that only occurs on the same line failing
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@189 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-30 13:49:33 +00:00
Chris Allegretta
340d6e50c2 Made wrapping code less ambitious
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@188 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-29 03:55:29 +00:00
Chris Allegretta
dabc3cb0df Off by one error fix (Rocco Corsi)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@187 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-25 01:44:12 +00:00
Chris Allegretta
e10debd14b Updates by Ben Roberts
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@186 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-22 01:26:42 +00:00
Chris Allegretta
f1d33d30ce Get rid of lack of update when searching andmark is set
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@185 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-19 03:53:39 +00:00
Chris Allegretta
8c81d23a7e Doc updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@184 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-16 02:52:44 +00:00
Chris Allegretta
8d458043d1 cvs branch for 0.9.16
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@183 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 22:11:20 +00:00
Chris Allegretta
5286ccbaf9 0.9.16 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@181 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 22:09:38 +00:00
Chris Allegretta
ba96f7afac Doc updates for 0.9.16 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@180 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 21:38:28 +00:00
Chris Allegretta
a2efc36799 One more time, configure.in slang check
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@179 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 03:26:33 +00:00
Chris Allegretta
e5935973f9 New (and again revised =) slang test code (Albert Chin-A-Young)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@178 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 22:00:30 +00:00
Chris Allegretta
13415991e8 Added Id to Makefile.am
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@177 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 16:59:04 +00:00
Chris Allegretta
b7ea9d45bb New libm test for slang
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@176 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 01:49:55 +00:00
Chris Allegretta
0286ba436e Whoops, must let check for blowing away cutbuffer get run before exit on cutting magic line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@175 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 14:58:26 +00:00
Chris Allegretta
c86f714a15 No more cutting the macic line, added check_statblank() to cut and uncut
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@174 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 14:39:32 +00:00
Chris Allegretta
9b45ff54ac Okay, it's not going to work for Makefile.am
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@173 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:25:43 +00:00
Chris Allegretta
2b78429248 More RCS schtuff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:22:40 +00:00
Chris Allegretta
c87a411624 More RCS schtuff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@171 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:16:24 +00:00
Chris Allegretta
141c1274c4 Testing RCS headers
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-06 21:13:46 +00:00
Chris Allegretta
11b0011b1f Testing RCS headers
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@169 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-06 21:13:45 +00:00
Chris Allegretta
b4dc9e0944 New slang test code (Albert Chin-A-Young)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@168 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 22:49:30 +00:00
Chris Allegretta
81b1eea10f Patch to handle
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@167 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 16:09:07 +00:00
Chris Allegretta
7dc14e81d7 Fixed getting locked into cutbuffer on cutting first line of file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@166 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 16:03:19 +00:00
Chris Allegretta
4dbcc3cd9e Changed tabsize long arg to actually accept an argument *sigh*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@165 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 15:44:29 +00:00
Chris Allegretta
1f2a072e33 0.9.15 sync
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@163 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 04:13:43 +00:00
Chris Allegretta
0bf4e146a0 Update of ChangeLog and NEWS for 0.9.15 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@162 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 02:42:04 +00:00
Chris Allegretta
bbd96ea838 Updated man pages for universal -T option
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@161 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 02:05:44 +00:00
Chris Allegretta
5027a18c2c Regenerated Makefile.in with automake -i *shrug*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@160 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 00:42:16 +00:00
Chris Allegretta
99bf73fe66 Removed now useless usrtabsize variable (Christian Weisgerber)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@159 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 00:22:08 +00:00
Chris Allegretta
d7c31c1123 Bug update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@158 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-03 23:01:12 +00:00
Chris Allegretta
6d690a39dc New tabsize code, Im very excited
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@157 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-03 22:51:21 +00:00
Chris Allegretta
ed02216378 Added recursive loop check
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@156 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-03 16:54:11 +00:00
Chris Allegretta
55d5455abd More BUGS fixed
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@155 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-01 04:26:55 +00:00
Chris Allegretta
5d8f6250de BUGS update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@154 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-31 13:52:20 +00:00
Chris Allegretta
7a6f0d9868 Finally fixed slang check message, or lack of
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@153 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-31 13:00:24 +00:00
Chris Allegretta
145a0450ea Fixed silly page_up_center prototype
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@152 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-31 12:51:00 +00:00
Chris Allegretta
da721be17a Bug fixes for do_enter and do_backspace
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@151 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-31 01:26:42 +00:00
Chris Allegretta
234a34d273 Chris goes berzerk on no sleep
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@150 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-29 04:33:38 +00:00
Chris Allegretta
84ff479b24 Updated html man page
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@149 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 17:29:22 +00:00
Jordi Mallach
3206ab4fe0 Added a reference to -k, --cut option. Need a nano.1.html update!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@148 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 16:55:47 +00:00
Chris Allegretta
f5d7a8b4fd Back out edit_refresh->edit_update until page up/down problems are fixed
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@147 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 15:33:03 +00:00
Chris Allegretta
d069ac02d1 More bugs, YAY
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@146 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 14:34:48 +00:00
Chris Allegretta
d63d11be58 Sigh, cancel that
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@145 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 14:09:29 +00:00
Chris Allegretta
1a471392c5 Another page_down tweak
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@144 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 14:08:01 +00:00
Chris Allegretta
f6a6b5aa86 Fix for page down onto EOF
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@143 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 12:24:43 +00:00
Chris Allegretta
95b0b5249a edit_refresh()->edit_update() redundancy
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@142 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 02:58:06 +00:00
Chris Allegretta
29d9025381 Got to love typos
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@141 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 01:48:43 +00:00
Chris Allegretta
6925bbd360 Added null_at()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@140 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 01:41:29 +00:00
Chris Allegretta
18bd029981 Bugfixes and cruft cleanout take 1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@139 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 01:18:10 +00:00
Chris Allegretta
7975ed86a7 New cvs code, data abstraction is good
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@138 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 00:58:35 +00:00
Chris Allegretta
a1a55c79c8 official 0.9.14 sync
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@136 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 00:36:03 +00:00
Chris Allegretta
2ece167f56 Revised germal translation by floki@bigfoot.com
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@135 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 15:25:52 +00:00
Chris Allegretta
0e5faca531 Added documentation for all the -k cut changes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@134 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 13:32:46 +00:00
Chris Allegretta
939fdbd64d Last minute touches on -k code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@133 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 13:03:31 +00:00
Chris Allegretta
293849eb69 This should finish the -k functionality. Would someone be kind enough to test this against Pico and send me a comparison?
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@132 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 05:09:22 +00:00
Chris Allegretta
1013e14a87 Updated BUGS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@131 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 04:31:52 +00:00
Chris Allegretta
63aa0f7f16 More -k fixes, almost works perfectly ;-)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@130 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 04:09:23 +00:00
Chris Allegretta
cf037ba969 0.9.14-pre1 sync
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@128 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-25 03:38:15 +00:00
Chris Allegretta
45dfda97d8 slightly better cut to end behavior, still doesn't preserve cutbuffer w/multi line cuts
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@127 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-25 03:20:07 +00:00
Robert Siemborski
c9b1dba4a3 continued existance of do_justify bug documented (#31)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@126 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-25 02:19:07 +00:00
Robert Siemborski
a417ddca91 some random totsize-related bugfixes. (do_justify & do_wrap)
shouldn't break anything (famous last words)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@125 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 23:18:48 +00:00
Chris Allegretta
461b2a9dfe More -t and exit fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@124 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 22:05:18 +00:00
Chris Allegretta
962c3c9c21 Fix for bug #30, I hope it doesn't break anything else
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@123 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 21:52:17 +00:00
Chris Allegretta
05597197f3 doc updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@122 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 21:16:12 +00:00
Chris Allegretta
f4e75e1256 Fixed bug #31
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@121 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 18:28:30 +00:00
Chris Allegretta
d8346ffb84 Fix -k sets TEMP_OPT
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@120 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 15:16:02 +00:00
Chris Allegretta
90d6895e94 anchor fix in FAQ
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@119 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 02:55:49 +00:00
Chris Allegretta
f1171c3c0e Marked cut to end of line as done
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@118 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-23 21:56:01 +00:00
Chris Allegretta
723845c0cc Changed to CVS version #
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@117 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-23 18:15:28 +00:00
Chris Allegretta
1d7110d657 Oops, screwed up ChangeLog for 0.9.13
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@116 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-23 16:59:07 +00:00
43 changed files with 2993 additions and 2162 deletions

View File

@@ -224,3 +224,4 @@ distribution.
If December 1997 seems to be old, you may fetch a more recent copy
of this `ABOUT-NLS' file on most GNU archive sites.
$Id$

View File

@@ -1,3 +1,4 @@
$Id$
This file lists people who have made significant contribution to the nano
editor. Please see the ChangeLog for specific changes by author.
-------------------------------------------------------------------------

35
BUGS
View File

@@ -32,7 +32,29 @@
is made to the buffer, and a write is attempted, nano will not give you
a dialog about not being able to write the file, and it will not let the
user exit (29, discovered by Joshua Jensen) [FIXED]
- Using nano -k, marked text is not cut properly. (31) [FIXED]
- Invoking -t or -k has the effect of invoking both option. (32) [FIXED]
- totsize becomes incorrect after word-wrapping (25) [FIXED]
- Wrapping a line with autoindent mode sometimes causes a segfault (19)[FIXED]
- When inserting files, the display sometimes fails to display properly
until a pageup/down occurs (22)[FIXED]
- In search/replace code there is too much refreshing in bottomwin (26)
[FIXED]
- Using nano -t, user can not exit until a filename is given via ^O. (30)
[FIXED]
- Using -k cut text is not pasted properly. (34) [FIXED].
- Using -k pasted text is not updated properly if it goes beyond editbot. (35)
[FIXED]
- Doing a cut with -k can screw up the filestruct, fault is in cutting
code. (36) [FIXED]
- Hitting enter on the magic line makes new lines, but they are not
written out to disk when saved..... (37). [FIXED]
- Page up and page down do not work the same way as Pico (# of lines). (38)
[FIXED]
- When doing a search and the marker is set, the screen does not always
properly update the inverted text (39). [FIXED]
- Searches for a string that only exist on one line multiple times will
fail after finding the last occurance (discovered by Ken Tyler) (40). [FIXED]
** Open BUGS **
- Marked cutting sometimes leaves a newline in the file unintelligently,
@@ -42,11 +64,10 @@
- Spelling support is not elegant like pico's integration of the 'spell'
program. Nano only uses ispell (for now) (12)
- Cutting a file with marked text and both marker ends on the same line
causes a random segfault (16)
- Wrapping a line with autoindent mode sometimes causes a segfault (19).
- When inserting files, the display sometimes fails to display properly
until a pageup/down occurs (22).
- totsize becomes incorrect after word-wrapping (25)
- In search/replace code there is too much refreshing in bottomwin (26)
causes a random segfault (16) [FIXED?]
- In replace, there is no way to accept the default replace string. (27)
- totsize problems still abound in do_justify (33)
- Alt-Z is current broken to toggle suspend. I guess I still don't know
signals very well =-) (41).
$Id$

143
ChangeLog
View File

@@ -1,4 +1,143 @@
nano-0.9.12 - 07/07/2000
nano-0.9.17 - 09/04/2000
- General
- New shortcuts to toggle certain options that are normally only
flags via Alt/Meta. See Alt-C,E,I,K,M,P,X,Z. New struct called
toggles in nano.h, toggle_init(), toggle_init_one() in global.c
called from shortcut_init(), and do_toggle in nano.c. Also
moved the signal code into a separate function in nano.c called
signal_init(). Moved "struct sigaction act"into a static in
nano.c.
- Changed from Alt-key symbol (@) which is completely nonstandard
to the *nix "Meta" symbol (M-). Changed help_init to show
the M-key usage and the help text to explain keys whcih generate
Meta. Moved the toggle Meta keystrokes to the first column
instead of the third as they are the primary keystrokes for the
functions. Thanks Mini editor team :->
- Changed last_search and last_replace vars to statically
allocated (hence nulled) and moved to search.c (Matt Kraai).
- global.c:
toggle_init()
- Changed "No auto wrap" and "No help mode" to "Auto wrap" and
"Help mode". See the change to do_toggle() below.
- nano.c:
do_mouse()
- Patch for handling lines w/tabs and mouse better (Ben Roberts).
do_wrap()
- Made wrapping code less ambitious.
do_toggle()
- Added checks for no help and no wrap mode, and print opposite
enable/disable message.
do_suspend(), do_cont():
- New functions, handle suspend signal in a Pico-like manner and
work with Meta-Z.
- winio.c:
total_refresh()
- Added edit_refresh() call to actually update the screen if messy.
edit_refresh_clearok()
- New function, does a total update for edit refresh, needed to fix
lack of reversed text on searching with MARK_ISSET.
onekey()
- Off by one error fix (Rocco Corsi).
update_line()
- Added check for binary data >= 1 and <= 26, and use ^+letter
to display it. Should fix editing text files with binary
data in them. Placing of the cursor seems to be a bit screwed
though...
- search.c:
search_abort()
- Now calls edit_refresh_clearok when MARK_ISSET to handle screen
ugliness bug (reported by Ken Tyler).
findnextstr():
- Added reset for placewewant (Ben Roberts).
- Fixed check for string that only occurs on the same line failing
(discovered by Ken Tyler).
nano-0.9.16 - 08/09/2000
- cut.c:
do_cut_text()
- Fixed getting locked into cutbuffer on cutting first line of file.
- Added check_statblank().
- Check for fileptr == filebot, if so return, we shouldn't bother
cutting the magic line.
do_uncut_text()
- Added check_statblank().
- nano.c:
main()
- Changed tabsize long arg to actually accept an argument *sigh*.
- po/Makefile.in.in:
- Patch to handle $DESTDIR (orig by Dan Harnett contributed by
Christian Weisgerber)
- configure.in:
- New (and severally revised =) slang test code (Albert Chin-A-Young)
nano-0.9.15 - 08/03/2000
- Changed edit_update call to take arguments TOP, CENTER or BOTTOM.
Affects many many functions. Removed functions edit_update_top and
edit_update_bot.
- Added global variable tabsize, we no longer screw with the curses
library in order to implement -T (suggested by Christian Weisgerber).
- configure.in:
- Finally fixed check for slang to report "no" if not called
with --with-slang or --without-slang
- nano.c:
splice_node()
- New function, abstracts linking in nodes. Fixes bug #36.
null_at()
- New function, nulls a string at a given index and realigns it.
delete_buffer()
- Removed, same as free_filestruct().
do_backspace()
- Now calls page_up_center instead of page_up (as it should?)
do_enter()
- Fixed typo (?) in check for inptr->next. Caused lots of
grief for editing lines at filebot.
main()
- Removed now useless usrtabsize variable (Christian Weisgerber).
- search.c:
replace_abort()
- redundant, now just calls search abort until it does something
different.
- winio.c:
edit_refresh()
- Added check for current line "running" off the screen.
Hopefully this will not cause any recursive lockups.
(Who am I kidding, of course it will!)
- Added check to stop infinite loop calling edit_update.
edit_update()
- Rewritten, hopefully this will remove a lot of the
scrolling the cursor back and forth needlessly.
- move.c:
page_down()
- do an edit_update() at last case. Made function more like
Pico's version, only move down to two lines before editbot.
page_up()
- Made function more like Pico's version, only move down to two
lines after edittop.
nano-0.9.14 - 07/27/2000
- nano.h:
- Set CUT_TO_END to a different bit than TEMP_OPT. Fixes bug #32.
- cut.c:
do_cut_text()
- Added check for MARK_ISSET when using CUT_TO_END. Fixes bug #31.
- Simplified check for freeing cutbuffer. Added checks for doing
multiple cuts with -k, now sets marked_cut to 2 for later
processing by do_uncut_text().
do_uncut_text()
- Added handler for uncutting with -k cuts.
- files.c:
write_file()
- Removed (redundant) check for writing out files with -t.
do_writeout()
- Changed check for filename to filename[0]. Added some code,
overall fixes bug #30 =-)
- nano.c:
do_justify() & do_wrap():
- totsize-related fixes (Rob)
- de.po
- Revised translations by floki@bigfoot.com
nano-0.9.13 - 07/23/2000
- Implemented Pico's -k mode. New flag CUT_TO_END, option (-k, --cut),
affects do_cut_text in cut.c. Not available with SMALL_NANO because it
depends on the marker code which is not available with that setting.
@@ -817,3 +956,5 @@ nano 0.7.6 - 01/15/2000
0.2 Read in data to buffer, bound keystrokes to stub functions,
initial cursor movement on screen. Initial autoconf support.
0.1 Initial program setup w/ncurses
$Id$

View File

@@ -180,3 +180,5 @@ operates.
script, and exit.
`configure' also accepts some other, not widely useful, options.
$Id$

View File

@@ -1,3 +1,4 @@
## $Id$
bin_PROGRAMS = nano
nano_SOURCES = cut.c \
files.c \

34
NEWS
View File

@@ -1,3 +1,35 @@
09/04/2000 - Nano 0.9.17, the Labor Day release, is released after a
quiet spell (almost an entire month since last release!)
New features include better (not yet perfect) binary
display support and toggle support for most of the program
flags (M-c, M-i, M-z, M-x, M-p, M-w, M-m, M-k and M-e for
-c, -i, -x, -p, -w, -k, and -R).
08/09/2000 - Nano 0.9.16, after some struggling, is release. This release
should fix a few of the holes that 0.9.15 dug. The
"cutting text on the first line" bug is fixed, as is the
"cutting text on the last line" bug. Nice symmetry there
huh? Also the --tabsize argument should now work as well
as by using -T.
08/03/2000 - Nano 0.9.15 is the "I cant think of a release description"
release. There are the usual gala of display bugfixes,
a for the the nasty bug in -k mode that could create a
loop in the file being edited, and some other code
cleanup. Also, the -T option should now work regardless
of the curses library used. Yay.
07/27/2000 - Nano 0.9.14 is officially the "13 is so unlucky it should
be skipped as a version number" release. One typo
caused unending problems (calling nano with either -t or
-k caused both flags to be used). The -k code is also now
closer in functionality to Pico's -k mode, please
note that this code is not finished yet. Working on this
code has made me realize that there is not enough
abstraction in the code, and I will be working on that
for the next release. Until then, have fun with this
version.
07/23/2000 - Nano 0.9.13 has a few new bits and bobs, most notably the
-k option from Pico (cut to end of line). The majority
of changes in this release are bugfixes however, including
@@ -232,3 +264,5 @@
http://faculty.plattsburgh.edu/astyanax/nano. Please
update your bookmarks, tell your friends, and all that
jazz.
$Id$

2
README
View File

@@ -80,3 +80,5 @@ Current Status
can guess, I'm not much of an emacs fan ;)
Chris Allegretta (chrisa@asty.org)
$Id$

5
TODO
View File

@@ -10,10 +10,13 @@ Current Version:
center line [DONE]
- Rewrite edit_refresh, if at all possible [DONE]
- Implement justify function [DONE]
- Cut to end of line
- Cut to end of line [DONE]
- Unjustify command (^U after ^J)
For Next Version:
- Undo/Redo key?
- single line scroll up/down?
- Color syntax highlighting? (certainly seems like there's a demand for it.)
- .nanorc ?????
$Id$

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Define this if you have the wresize function in your ncurses-type library */
#undef HAVE_WRESIZE
@@ -22,5 +24,3 @@
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this if you have a behaving TABSIZE global in your curses lib */
#undef HAVE_TABSIZE

View File

@@ -76,9 +76,6 @@
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this if you have a behaving TABSIZE global in your curses lib */
#undef HAVE_TABSIZE
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT

512
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
# $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(nano.c)
AM_INIT_AUTOMAKE(nano, 0.9.13)
AM_INIT_AUTOMAKE(nano, 0.9.16-cvs)
AM_CONFIG_HEADER(config.h:config.h.in)
ALL_LINGUAS="es de fr it id fi"
@@ -25,44 +26,75 @@ CURSES_LIB_NAME=""
AC_ARG_WITH(slang,
[ --with-slang[=DIR] Use the slang library instead of curses],
[ case "$with_slang" in
yes)
AC_MSG_RESULT(yes)
AC_CHECK_HEADER(slcurses.h,
AC_CHECK_LIB(slang, SLcurses_newwin,
[AC_DEFINE(USE_SLANG) slang_support=yes
CURSES_LIB="-lslang" CURSES_LIB_NAME=slang]),
AC_MSG_ERROR([
*** The header file slcurses.h was not found. If you wish to use
*** slang support this header file is required. Please either
*** install a version of slang that includes the slcurses.h file or
*** do not call the configure script with --with-slang
]))
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
# Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
# alternate readline path
_ldflags=${LDFLAGS}
_cppflags=${CPPFLAGS}
# Add additional search path
LDFLAGS="-L$with_slang/lib $LDFLAGS"
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
if test "$with_slang" != "yes"; then
# Add additional search path
LDFLAGS="-L$with_slang/lib $LDFLAGS"
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
fi
AC_CHECK_HEADER(slcurses.h,
AC_CHECK_LIB(slang, SLcurses_newwin,
[AC_DEFINE(USE_SLANG) slang_support=yes
CURSES_LIB="-L${with_slang}/lib -lslang"
CURSES_LIB_NAME=slang],
AC_MSG_ERROR([
*** The slang library was not found or the version you have installed
*** is incorrect.
])),
AC_MSG_CHECKING(for SLtt_initialize in -lslang)
_libs=$LIBS
LIBS="$LIBS -lslang"
AC_TRY_RUN([
#include <stdio.h>
#include <slcurses.h>
int main () { SLtt_initialize (NULL); return 0; }],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG)
slang_support=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang"
else
CURSES_LIB="-lslang"
fi
CURSES_LIB_NAME=slang], [
AC_MSG_RESULT(no)
# We might need the term library
for termlib in ncurses curses termcap terminfo termlib; do
AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
test -n "$tcap" && break
done
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap)
LIBS="$LIBS $tcap"
AC_TRY_RUN([
#include <stdio.h>
#include <slcurses.h>
int main () { SLtt_initialize (NULL); return 0; }],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG)
slang_support=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
else
CURSES_LIB="-lslang $tcap"
fi
CURSES_LIB_NAME=slang], [
AC_MSG_RESULT(no)
# We might need the math library
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap -lm)
LIBS="$LIBS -lm"
AC_TRY_RUN([
#include <stdio.h>
#include <slcurses.h>
int main () { SLtt_initialize (NULL); return 0; }],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG)
slang_support=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
else
CURSES_LIB="-lslang $tcap -lm"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)])])]),
AC_MSG_ERROR([
*** The header file slcurses.h was not found. If you wish to use
*** slang support this header file is required. Please either
@@ -70,9 +102,13 @@ AC_ARG_WITH(slang,
*** do not call the configure script with --with-slang
]))
LDFLAGS=${_ldflags}
test "${_libs+set}" = "set" && LIBS=$_libs
if test "$with_slang" != "yes"; then
LDFLAGS=${_ldflags}
fi
;;
esac])
esac], AC_MSG_RESULT(no))
dnl Checks for functions
AC_CHECK_FUNCS(snprintf vsnprintf)
@@ -101,9 +137,7 @@ dnl Checks for libraries.
if eval "test x$CURSES_LIB_NAME = x"
then
AC_CHECK_HEADERS(curses.h ncurses.h)
AC_CHECK_LIB(ncurses, tgetent,[CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses
dnl Only ncurses seems to have a working TABSIZE function.
AC_DEFINE(HAVE_TABSIZE)])
AC_CHECK_LIB(ncurses, tgetent,CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses)
fi
if eval "test x$CURSES_LIB_NAME = x"

91
cut.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* cut.c *
* *
@@ -97,8 +98,7 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
free(top->data);
top->data = tmpstr;
bot->data[bot_x] = 0;
align(&bot->data);
null_at(bot->data, bot_x);
next = bot->next;
/* We explicitly don't decrement totlines here because we don't snarf
@@ -123,8 +123,8 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
filebot = top;
}
}
if (top->lineno < edittop->lineno)
edit_update(top);
if (top->lineno < edittop->lineno)
edit_update(top, CENTER);
}
#endif
@@ -133,26 +133,46 @@ int do_cut_text(void)
filestruct *tmp, *fileptr = current;
#ifndef NANO_SMALL
char *tmpstr;
int newsize;
int newsize, cuttingtoend = 0;
#endif
check_statblank();
if (fileptr == NULL || fileptr->data == NULL)
return 0;
tmp = fileptr->next;
if (!ISSET(KEEP_CUTBUFFER) || ISSET(MARK_ISSET)) {
if (!ISSET(KEEP_CUTBUFFER)) {
free_filestruct(cutbuffer);
cutbuffer = NULL;
#ifdef DEBUG
fprintf(stderr, _("Blew away cutbuffer =)\n"));
#endif
}
/* Must let cutbuffer get blown away first before we do this... */
if (fileptr == filebot)
return 0;
#ifndef NANO_SMALL
if (ISSET(CUT_TO_END)) {
SET(MARK_ISSET);
mark_beginbuf = current;
mark_beginx = strlen(current->data);
if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) {
if (current_x == strlen(current->data))
{
do_delete();
SET(KEEP_CUTBUFFER);
marked_cut = 2;
return 1;
}
else
{
SET(MARK_ISSET);
SET(KEEP_CUTBUFFER);
mark_beginx = strlen(current->data);
mark_beginbuf = current;
cuttingtoend = 1;
}
}
if (ISSET(MARK_ISSET)) {
if (current->lineno == mark_beginbuf->lineno) {
@@ -188,9 +208,14 @@ int do_cut_text(void)
placewewant = xplustabs();
UNSET(MARK_ISSET);
marked_cut = 1;
set_modified();
edit_update(current);
if (cuttingtoend)
edit_refresh();
else
edit_update(current, CENTER);
return 1;
#else
if (0) {
@@ -205,8 +230,8 @@ int do_cut_text(void)
totsize--; /* get the newline */
totlines--;
fileptr->prev = NULL;
edit_update(fileage);
current = fileptr;
edit_update(fileage, CENTER);
} else {
add_to_cutbuffer(fileptr);
fileage = make_new_node(NULL);
@@ -223,18 +248,8 @@ int do_cut_text(void)
current = fileptr->next;
totlines--;
totsize--; /* get the newline */
} else {
/* we're deleteing the last line
and replacing it with a dummy line,
so totlines is the same */
tmp = fileptr->prev;
tmp->next = make_new_node(tmp);
tmp = tmp->next;
tmp->data = nmalloc(1);
strcpy(tmp->data, "");
current = tmp;
filebot = tmp;
}
} /* No longer an else here, because we never get here anymore...
No need to cut the magic line, as it's empty */
add_to_cutbuffer(fileptr);
}
@@ -266,6 +281,7 @@ int do_uncut_text(void)
int i;
wrap_reset();
check_statblank();
if (cutbuffer == NULL || fileptr == NULL)
return 0; /* AIEEEEEEEEEEEE */
@@ -277,7 +293,7 @@ int do_uncut_text(void)
/* Hook newbuf into fileptr */
#ifndef NANO_SMALL
if (marked_cut == 1) {
if (marked_cut) {
/* If there's only one line in the cutbuffer */
if (cutbuffer->next == NULL) {
tmpstr =
@@ -293,7 +309,6 @@ int do_uncut_text(void)
placewewant = xplustabs();
update_cursor();
renumber(current);
} else { /* yuck -- no kidding! */
tmp = current->next;
/* New beginning */
@@ -336,13 +351,27 @@ int do_uncut_text(void)
i = editbot->lineno;
renumber(current);
current = newend;
if (i <= newend->lineno)
edit_update(current);
edit_update(current, CENTER);
}
/* If marked cut == 2, that means that we're doing a cut to end
and we don't want anything else on the line, so we have to
screw up all the work we just did and separate the line. There
must be a better way to do this, but not at 1AM on a work night. */
if (marked_cut == 2 && current_x != strlen(current->data)) {
tmp = make_new_node(current);
tmp->data = nmalloc(strlen(&current->data[current_x]) + 1);
strcpy(tmp->data, &current->data[current_x]);
splice_node(current, tmp, current->next);
null_at(current->data, current_x);
current = current->next;
current_x = 0;
placewewant = 0;
}
renumber(current->prev);
dump_buffer(fileage);
dump_buffer(cutbuffer);
set_modified();
@@ -375,8 +404,8 @@ int do_uncut_text(void)
i = editbot->lineno;
renumber(newbuf);
if (i < newend->lineno)
edit_update(fileptr);
if (i < newend->lineno)
edit_update(fileptr, CENTER);
dump_buffer_reverse(fileptr);

View File

@@ -71,7 +71,7 @@ for my language!</a></font>
for &lt;x> in my language.&nbsp;&nbsp; How can I fix it?</a></font></blockquote>
<h2>
<font color="#330000"><a href="#7">6. Advocacy and Licensing</a></font></h2>
<font color="#330000"><a href="#6">6. Advocacy and Licensing</a></font></h2>
<blockquote><font color="#330000"><a href="#6.1">6.1. Why should I use
nano instead of Pico?</a></font>
@@ -183,7 +183,7 @@ nano was developed).</font></blockquote>
of nano?</font></h2>
<blockquote><font color="#330000">The current version of nano *should*
be 0.9.13.&nbsp; Of course you should always check the nano hompage to
be 0.9.16.&nbsp; Of course you should always check the nano hompage to
see what the latest and greatest version is.</font></blockquote>
<h2>
@@ -300,7 +300,7 @@ isn't hard.&nbsp; Unpack the nano source with a command like:</font>
<p><b><font color="#330000">tar -zxvf nano-x.y.z.tar.gz</font></b>
<p><font color="#330000">If you get error messages about the -z option,
try this:</font>
<p><b><font color="#330000">gunzip -d nano-x.y.z.tar.gz | tar xvf -</font></b>
<p><b><font color="#330000">gzip -dc nano-x.y.z.tar.gz | tar xvf -</font></b>
<p><font color="#330000">(again, where x.y.z is the version number in question).&nbsp;
Then you need to run configure with any options you might want (if any).</font>
<p><font color="#330000">The average case is this:</font>
@@ -473,7 +473,7 @@ also licensed under the GPL.</font></blockquote>
their license?</font></h2>
<blockquote><font color="#330000">You're really not asking the right person
here.&nbsp; I (Chris) waited along time to see if UW would change their
here.&nbsp; I (Chris) waited a long time to see if UW would change their
license because of the amount of high quality software being released and
developed under the GPL without being taken advantage of by malicious corporate
entities or other baddies, but no such luck so far.</font></blockquote>
@@ -541,6 +541,7 @@ and you should know the answer.</font></blockquote>
<a NAME="8"></a>8. ChangeLog</h1>
<blockquote>06/31/2000 - Initial framework.</blockquote>
<P>
$Id$
</body>
</html>

37
files.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* files.c *
* *
@@ -261,7 +262,7 @@ int do_insertfile(void)
/* If we've gone off the bottom, recenter, otherwise just redraw */
if (current->lineno > editbot->lineno)
edit_update(current);
edit_update(current, CENTER);
else
edit_refresh();
@@ -307,20 +308,7 @@ int write_file(char *name, int tmp)
/* Open the file and truncate it. Trust the symlink. */
if ((ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(st.st_mode)) && !tmp) {
/*
* If TEMP_OPT == 1, check to see if we can append to the file
* first, i.e. to see if we can at least write to the file (stops
* people from getting "locked in" to editor when write fails
*/
if (ISSET(TEMP_OPT)) {
if ((fd = open(name, O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP |
S_IWGRP | S_IROTH | S_IWOTH)) == -1) {
UNSET(TEMP_OPT);
return do_writeout(1);
}
else
close(fd);
}
if ((fd = open(name, O_WRONLY | O_CREAT | O_TRUNC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH |
S_IWOTH)) == -1) {
@@ -456,10 +444,21 @@ int do_writeout(int exiting)
strncpy(answer, filename, 132);
if ((exiting) && (ISSET(TEMP_OPT)) && (filename)) {
i = write_file(answer, 0);
display_main_list();
return i;
if ((exiting) && (ISSET(TEMP_OPT))) {
if (filename[0])
{
i = write_file(answer, 0);
display_main_list();
return i;
}
else
{
UNSET(TEMP_OPT);
do_exit();
/* They cancelled, abort quit */
return -1;
}
}
while (1) {

View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* global.c *
* *
@@ -38,7 +39,7 @@ int center_x = 0, center_y = 0; /* Center of screen */
WINDOW *edit; /* The file portion of the editor */
WINDOW *topwin; /* Top line of screen */
WINDOW *bottomwin; /* Bottom buffer */
char *filename; /* Name of the file */
char filename[PATH_MAX]; /* Name of the file */
int editwinrows = 0; /* How many rows long is the edit
window? */
filestruct *current; /* Current buffer pointer */
@@ -53,13 +54,15 @@ filestruct *editbot = NULL; /* Same for the bottom */
filestruct *filebot = NULL; /* Last node in the file struct */
filestruct *cutbuffer = NULL; /* A place to store cut text */
char *answer; /* Answer str to many questions */
char answer[132]; /* Answer str to many questions */
int totlines = 0; /* Total number of lines in the file */
int totsize = 0; /* Total number of bytes in the file */
int placewewant = 0; /* The collum we'd like the cursor
to jump to when we go to the
next or previous line */
int tabsize = 8; /* Our internal tabsize variable */
char *hblank; /* A horizontal blank line */
char *help_text; /* The text in the help window */
@@ -75,6 +78,7 @@ shortcut goto_list[GOTO_LIST_LEN];
shortcut writefile_list[WRITEFILE_LIST_LEN];
shortcut help_list[HELP_LIST_LEN];
shortcut spell_list[SPELL_LIST_LEN];
toggle toggles[TOGGLE_LEN];
/* Regular expressions */
@@ -96,6 +100,52 @@ void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
s->func = func;
}
/* Initialize the toggles in the same manner */
void toggle_init_one(toggle * t, int val, char *desc, int flag)
{
t->val = val;
t->desc = desc;
t->flag = flag;
}
void toggle_init(void)
{
#ifndef NANO_SMALL
char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
*toggle_nohelp_msg, *toggle_picomode_msg, *toggle_mouse_msg,
*toggle_cuttoend_msg, *toggle_regexp_msg, *toggle_wrap_msg;
toggle_const_msg = _("Constant cursor position");
toggle_autoindent_msg = _("Auto indent");
toggle_suspend_msg = _("Suspend");
toggle_nohelp_msg = _("Help mode");
toggle_picomode_msg = _("Pico messages");
toggle_mouse_msg = _("Mouse support");
toggle_cuttoend_msg = _("Cut to end");
toggle_regexp_msg = _("Regular expressions");
toggle_wrap_msg = _("Auto wrap");
toggle_init_one(&toggles[0], TOGGLE_CONST_KEY, toggle_const_msg,
CONSTUPDATE);
toggle_init_one(&toggles[1], TOGGLE_AUTOINDENT_KEY, toggle_autoindent_msg,
AUTOINDENT);
toggle_init_one(&toggles[2], TOGGLE_SUSPEND_KEY, toggle_suspend_msg,
SUSPEND);
toggle_init_one(&toggles[3], TOGGLE_NOHELP_KEY, toggle_nohelp_msg,
NO_HELP);
toggle_init_one(&toggles[4], TOGGLE_PICOMODE_KEY, toggle_picomode_msg,
PICO_MSGS);
toggle_init_one(&toggles[5], TOGGLE_WRAP_KEY, toggle_wrap_msg,
NO_WRAP);
toggle_init_one(&toggles[6], TOGGLE_MOUSE_KEY, toggle_mouse_msg,
USE_MOUSE);
toggle_init_one(&toggles[7], TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg,
CUT_TO_END);
toggle_init_one(&toggles[8], TOGGLE_REGEXP_KEY, toggle_regexp_msg,
USE_REGEXP);
#endif
}
void shortcut_init(void)
{
char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg = "",
@@ -147,7 +197,6 @@ void shortcut_init(void)
nano_cancel_msg = _("Cancel the current function");
#endif
if (ISSET(PICO_MSGS))
sc_init_one(&main_list[0], NANO_HELP_KEY, _("Get Help"),
nano_help_msg, 0, 0, 0, VIEW, do_help);
@@ -337,4 +386,5 @@ void shortcut_init(void)
sc_init_one(&spell_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
toggle_init();
}

31
move.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* move.c *
* *
@@ -35,12 +36,12 @@
void page_down_center(void)
{
if (editbot != filebot) {
edit_update(editbot->next);
edit_update(editbot->next, CENTER);
center_cursor();
} else {
while (current != filebot)
current = current->next;
edit_update(current);
edit_update(current, CENTER);
}
update_cursor();
}
@@ -54,15 +55,22 @@ int page_down(void)
if (current == filebot)
return 0;
if (editbot != filebot) {
if (editbot != filebot || edittop == fileage) {
current_y = 0;
current = editbot;
edit_update_top(current);
} else
current = editbot;
if (current->prev != NULL)
current = current->prev;
if (current->prev != NULL)
current = current->prev;
edit_update(current, TOP);
} else {
while (current != filebot) {
current = current->next;
current_y++;
}
edit_update(edittop, TOP);
}
update_cursor();
UNSET(KEEP_CUTBUFFER);
@@ -121,7 +129,7 @@ int do_down(void)
void page_up_center(void)
{
if (edittop != fileage) {
edit_update(edittop);
edit_update(edittop, CENTER);
center_cursor();
} else
current_y = 0;
@@ -132,6 +140,7 @@ void page_up_center(void)
int page_up(void)
{
filestruct *fileptr = edittop;
wrap_reset();
current_x = 0;
placewewant = 0;
@@ -140,7 +149,13 @@ int page_up(void)
return 0;
current_y = 0;
edit_update_bot(edittop);
if (fileptr->next != NULL)
fileptr = fileptr->next;
if (fileptr->next != NULL)
fileptr = fileptr->next;
current = edittop;
edit_update(fileptr, BOTTOM);
update_cursor();
UNSET(KEEP_CUTBUFFER);

7
nano.1
View File

@@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH NANO 1 "January 4, 2000"
.TH NANO 1 "July 28, 2000"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -40,7 +40,7 @@ number".
.SH OPTIONS
.TP
.B \-T (\-\-tabsize)
Set the size (width) of a tab, if supported by your curses library.
Set the size (width) of a tab.
.TP
.B \-R (\-\-regexp)
Enable regular expression matching for search strings, as well as
@@ -55,6 +55,9 @@ Display a summary of commandline options.
.B \-c (\-\-const)
Constantly show the cursor position.
.TP
.B \-k (\-\-cut)
Enable cut from cursor to end of line with ^K.
.TP
.B \-i (\-\-autoindent)
Indent new lines to the previous line's indentation. Useful when editing
source code.

View File

@@ -3,7 +3,7 @@ Content-type: text/html
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
</HEAD><BODY>
<H1>NANO</H1>
Section: User Commands (1)<BR>Updated: January 4, 2000<BR><A HREF="#index">Index</A>
Section: User Commands (1)<BR>Updated: July 28, 2000<BR><A HREF="#index">Index</A>
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
@@ -59,7 +59,7 @@ number&quot;.
<DT><B>-T (--tabsize)</B>
<DD>
Set the size (width) of a tab, if supported by your curses library.
Set the size (width) of a tab.
<DT><B>-R (--regexp)</B>
<DD>
@@ -77,6 +77,10 @@ Display a summary of commandline options.
<DD>
Constantly show the cursor position.
<DT><B>-k (--cut)</B>
<DD>
Enable cut from cursor to end of line with ^K.
<DT><B>-i (--autoindent)</B>
<DD>
@@ -162,6 +166,6 @@ GNU/Linux system (but may be used by others).
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 04:20:00 GMT, July 07, 2000
Time: 17:29:02 GMT, July 28, 2000
</BODY>
</HTML>

412
nano.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* nano.c *
* *
@@ -58,13 +59,12 @@
#endif
/* Former globals, now static */
char *last_search = "\0"; /* Last string we searched for */
char *last_replace = "\0"; /* Last replacement string */
int fill = 0; /* Fill - where to wrap lines, basically */
static char *alt_speller; /* Alternative spell command */
struct termios oldterm; /* The user's original term settings */
static char *help_text_init = "";
/* Initial message, not including shortcuts */
static struct sigaction act; /* For all out fun signal handlers */
/* What we do when we're all set to exit */
RETSIGTYPE finish(int sigage)
@@ -147,10 +147,6 @@ void global_init(void)
for (i = 0; i <= COLS - 1; i++)
hblank[i] = ' ';
hblank[i] = 0;
last_search = nmalloc(132);
last_replace = nmalloc(132);
answer = nmalloc(132);
}
void init_help_msg(void)
@@ -170,9 +166,11 @@ void init_help_msg(void)
"The bottom two lines show the most commonly used shortcuts "
"in the editor.\n\n "
"The notation for shortcuts is as follows: Control-key "
"sequences are notated with a caret (^) symbol. Alt-key "
"sequences are notated with an at (@) symbol. The following "
"keystrokes are available in the main editor window. "
"sequences are notated with a caret (^) symbol and are entered "
"with the Control (Ctrl) key. Escape-key sequences are notated "
"with the Meta (M) symbol and can be entered using either the "
"Esc, Alt or Meta key depending on your keyboard setup. The "
"following keystrokes are available in the main editor window. "
"Optional keys are shown in parentheses:\n\n");
#endif
@@ -307,15 +305,20 @@ void align(char **strp)
*strp = nrealloc(*strp, strlen(*strp) + 1);
}
/* Null a string at a certain index and align it */
void null_at(char *data, int index)
{
data[index] = 0;
align(&data);
}
void usage(void)
{
#ifdef HAVE_GETOPT_LONG
printf(_("Usage: nano [GNU long option] [option] +LINE <file>\n\n"));
printf(_("Option Long option Meaning\n"));
#ifdef HAVE_TABSIZE
printf(_
(" -T --tabsize=[num] Set width of a tab to num\n"));
#endif
#ifdef _POSIX_VERSION
printf(_
(" -R --regexp Use regular expressions for search\n"));
@@ -362,9 +365,7 @@ void usage(void)
#else
printf(_("Usage: nano [option] +LINE <file>\n\n"));
printf(_("Option Meaning\n"));
#ifdef HAVE_TABSIZE
printf(_(" -T [num] Set width of a tab to num\n"));
#endif
printf(_(" -R Use regular expressions for search\n"));
printf(_(" -V Print version information and exit\n"));
printf(_(" -c Constantly show cursor position\n"));
@@ -417,6 +418,16 @@ filestruct *make_new_node(filestruct * prevnode)
return newnode;
}
/* Splice a node into an existing filestruct */
void splice_node(filestruct *begin, filestruct *new, filestruct *end)
{
new->next = end;
new->prev = begin;
begin->next = new;
if (end != NULL)
end->prev = new;
}
int do_mark()
{
#ifdef NANO_SMALL
@@ -510,15 +521,11 @@ int do_enter(filestruct * inptr)
}
*tmp = 0;
new->next = inptr->next;
new->prev = inptr;
inptr->next = new;
if (new->next != NULL)
new->next->prev = new;
else {
if (inptr->next == NULL) {
filebot = new;
editbot = new;
}
splice_node(inptr, new, inptr->next);
totsize++;
renumber(current);
@@ -532,7 +539,7 @@ int do_enter(filestruct * inptr)
* where we think the cursor is.
*/
if (current_y == editwinrows - 1) {
edit_update(current);
edit_update(current, CENTER);
reset_cursor();
} else {
current_y++;
@@ -588,7 +595,7 @@ void do_next_word(void)
current_x = i;
placewewant = xplustabs();
if (current->lineno >= editbot->lineno)
edit_update(current);
edit_update(current, CENTER);
}
@@ -633,8 +640,8 @@ void do_wrap(filestruct * inptr, char input_char)
}
if (inptr->data[i] == NANO_CONTROL_I) {
if (i_tabs % TABSIZE != 0);
i_tabs += TABSIZE - (i_tabs % TABSIZE);
if (i_tabs % tabsize != 0);
i_tabs += tabsize - (i_tabs % tabsize);
}
if (current_word_end_t > fill)
@@ -711,8 +718,7 @@ void do_wrap(filestruct * inptr, char input_char)
down = 1;
}
inptr->data = nrealloc(inptr->data, current_x + 1);
inptr->data[current_x] = 0;
null_at(inptr->data, current_x);
if (ISSET(MARK_ISSET) && (mark_beginbuf == inptr)) {
mark_beginbuf = temp;
@@ -759,9 +765,7 @@ void do_wrap(filestruct * inptr, char input_char)
if (isspace(input_char) && (current_x == current_word_start)) {
current_x = current_word_start;
inptr->data =
nrealloc(inptr->data, current_word_start + 1);
inptr->data[current_word_start] = 0;
null_at(inptr->data, current_word_start);
} else {
while (isspace(inptr->data[i])) {
@@ -812,18 +816,6 @@ void do_wrap(filestruct * inptr, char input_char)
free(temp->data);
free(temp);
/* The next line line may need to be wrapped as well. */
current_y = old_y + 1;
current_x = strlen(inptr->next->data);
while (current_x >= 0) {
if (isspace(inptr->next->data[current_x])
&& (current_x < fill)) break;
current_x--;
}
if (current_x >= 0)
check_wrap(inptr->next, ' ');
current_x = old_x;
current_y = old_y;
}
@@ -844,10 +836,12 @@ void do_wrap(filestruct * inptr, char input_char)
totlines++;
totsize++;
/* Everything about it makes me want this line here but it causes
* totsize to be high by one for some reason. Sigh. (Rob) */
/* totsize++; */
renumber(inptr);
edit_update_top(edittop);
edit_update(edittop, TOP);
/* Move the cursor to the new line if appropriate. */
@@ -860,7 +854,7 @@ void do_wrap(filestruct * inptr, char input_char)
do_right();
}
edit_update_top(edittop);
edit_update(edittop, TOP);
reset_cursor();
edit_refresh();
}
@@ -912,15 +906,6 @@ void do_early_abort(void)
blank_statusbar_refresh();
}
void delete_buffer(filestruct * inptr)
{
if (inptr != NULL) {
delete_buffer(inptr->next);
free(inptr->data);
free(inptr);
}
}
int do_backspace(void)
{
filestruct *previous, *tmp;
@@ -953,7 +938,7 @@ int do_backspace(void)
current = previous->next;
else
current = previous;
page_up();
page_up_center();
} else {
if (previous->next)
current = previous->next;
@@ -1110,7 +1095,7 @@ int do_spell(void)
free_filestruct(fileage);
global_init();
open_file(temp, 0, 1);
edit_update(fileage);
edit_update(fileage, CENTER);
set_modified();
exit_spell(temp, foo);
statusbar(_("Finished checking spelling"));
@@ -1155,6 +1140,7 @@ int do_exit(void)
void do_mouse(void)
{
MEVENT mevent;
int foo = 0, tab_found = 0;
if (getmouse(&mevent) == ERR)
return;
@@ -1197,6 +1183,23 @@ void do_mouse(void)
}
}
current_x = mevent.x;
placewewant = current_x;
while(foo < current_x) {
if(current->data[foo] == NANO_CONTROL_I) {
current_x -= tabsize - (foo % tabsize);
tab_found = 1;
} else if(current->data[foo] & 0x80)
;
else if(current->data[foo] < 32)
current_x--;
foo++;
}
/* This is where tab_found comes in. I can't figure out why,
* but without it any line with a tab will place the cursor
* one character behind. Whatever, this fixes it. */
if(tab_found == 1)
current_x++;
if (current_x > strlen(current->data))
current_x = strlen(current->data);
@@ -1214,6 +1217,29 @@ RETSIGTYPE handle_hup(int signal)
finish(1);
}
/* What do we do when we catch the suspend signal */
RETSIGTYPE do_suspend(int signal)
{
act.sa_handler = SIG_DFL;
sigemptyset(&act.sa_mask);
sigaction(SIGTSTP, &act, NULL);
endwin();
fprintf(stderr,"\n\n\n\n\nUse \"fg\" to return to nano\n");
raise(SIGTSTP);
}
/* Restore the suspend handler when we come back into the prog */
RETSIGTYPE do_cont(int signal)
{
act.sa_handler = do_suspend;
sigemptyset(&act.sa_mask);
sigaction(SIGTSTP, &act, NULL);
initscr();
total_refresh();
}
void handle_sigwinch(int s)
{
@@ -1271,7 +1297,7 @@ void handle_sigwinch(int s)
fix_editbot();
if (current_y > editwinrows - 1) {
edit_update(editbot);
edit_update(editbot, CENTER);
}
erase();
@@ -1284,6 +1310,52 @@ void handle_sigwinch(int s)
#endif
}
void signal_init(void)
{
/* Trap SIGINT and SIGQUIT cuz we want them to do useful things. */
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = SIG_IGN;
sigaction(SIGINT, &act, NULL);
if (!ISSET(SUSPEND)) {
sigaction(SIGTSTP, &act, NULL);
}
else
{
act.sa_handler = do_suspend;
sigaction(SIGTSTP, &act, NULL);
act.sa_handler = do_cont;
sigaction (SIGCONT, &act, NULL);
}
/* Trap SIGHUP cuz we want to write the file out. */
act.sa_handler = handle_hup;
sigaction(SIGHUP, &act, NULL);
act.sa_handler = handle_sigwinch;
sigaction(SIGWINCH, &act, NULL);
}
void mouse_init(void)
{
#ifndef NANO_SMALL
#ifdef NCURSES_MOUSE_VERSION
if (ISSET(USE_MOUSE)) {
mousemask(BUTTON1_RELEASED, NULL);
mouseinterval(50);
}
else {
mousemask(0, NULL);
}
#endif
#endif
}
int do_tab(void)
{
do_char('\t');
@@ -1399,56 +1471,61 @@ int do_justify(void)
unlink_node(tmpnode);
delete_node(tmpnode);
}
totsize -= strlen(current->data);
justify_format(current->data);
slen = strlen(current->data);
while ((strlenpt(current->data) > (fill))
&& !no_spaces(current->data)) {
int i = 0;
int len2 = 0;
filestruct *tmpline = nmalloc(sizeof(filestruct));
totsize += slen;
/* Start at fill , unless line isn't that long (but it appears at least
* fill long with tabs.
*/
if (slen > fill)
i = fill;
else
i = slen;
for (; i > 0; i--) {
if (isspace(current->data[i]) &&
((strlenpt(current->data) - strlen(current->data + i)) <=
fill)) break;
}
if (!i)
break;
if((strlenpt(current->data) > (fill))
&& !no_spaces(current->data)) {
do {
int i = 0;
int len2 = 0;
filestruct *tmpline = nmalloc(sizeof(filestruct));
current->data[i] = '\0';
/* Start at fill , unless line isn't that long (but it
* appears at least fill long with tabs.
*/
if (slen > fill)
i = fill;
else
i = slen;
for (; i > 0; i--) {
if (isspace(current->data[i]) &&
((strlenpt(current->data) - strlen(current->data +i)) <=
fill)) break;
}
if (!i)
break;
len2 = strlen(current->data + i + 1);
tmpline->data = nmalloc(len2 + 1);
current->data[i] = '\0';
/* Skip the white space in current. */
memcpy(tmpline->data, current->data + i + 1, len2);
tmpline->data[len2] = '\0';
len2 = strlen(current->data + i + 1);
tmpline->data = nmalloc(len2 + 1);
current->data = nrealloc(current->data, i + 1);
/* Skip the white space in current. */
memcpy(tmpline->data, current->data + i + 1, len2);
tmpline->data[len2] = '\0';
tmpline->prev = current;
tmpline->next = current->next;
if (current->next != NULL)
current->next->prev = tmpline;
current->data = nrealloc(current->data, i + 1);
current->next = tmpline;
current = tmpline;
slen -= i + 1;
current_y++;
tmpline->prev = current;
tmpline->next = current->next;
if (current->next != NULL)
current->next->prev = tmpline;
current->next = tmpline;
current = tmpline;
slen -= i + 1;
current_y++;
} while ((strlenpt(current->data) > (fill))
&& !no_spaces(current->data));
}
if (current->next)
current = current->next;
else
@@ -1463,13 +1540,12 @@ int do_justify(void)
if ((current_y < 0) || (current_y >= editwinrows - 1)
|| (initial_y <= 0)) {
edit_update(current);
edit_update(current, CENTER);
center_cursor();
} else {
fix_editbot();
}
edit_refresh();
statusbar("Justify Complete");
return 1;
@@ -1492,6 +1568,11 @@ void help_init(void)
if (main_list[i].help != NULL)
allocsize += strlen(main_list[i].help) + 15;
/* And for the toggle list, we also allocate space for extra text. */
for (i = 0; i <= TOGGLE_LEN - 1; i++)
if (toggles[i].desc != NULL)
allocsize += strlen(toggles[i].desc) + 30;
allocsize += strlen(help_text_init);
if (help_text != NULL)
@@ -1504,7 +1585,7 @@ void help_init(void)
strcpy(help_text, help_text_init);
/* Now add our shortcut info */
for (i = 0; i < MAIN_LIST_LEN; i++) {
for (i = 0; i < MAIN_LIST_LEN - 1; i++) {
sofar = snprintf(buf, BUFSIZ, "^%c ", main_list[i].val + 64);
if (main_list[i].misc1 > KEY_F0 && main_list[i].misc1 <= KEY_F(64))
@@ -1514,31 +1595,86 @@ void help_init(void)
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, " ");
if (main_list[i].altval > 0)
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(@%c) ",
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(M-%c) ",
main_list[i].altval - 32);
else
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, " ");
if (main_list[i].help != NULL)
snprintf(&buf[sofar], BUFSIZ - sofar, "%s", main_list[i].help);
strcat(help_text, buf);
strcat(help_text, "\n");
}
/* And the toggles... */
for (i = 0; i <= TOGGLE_LEN - 1; i++) {
sofar = snprintf(buf, BUFSIZ,
"M-%c ", toggles[i].val - 32 );
if (toggles[i].desc != NULL)
snprintf(&buf[sofar], BUFSIZ - sofar, "%s enable/disable",
toggles[i].desc);
strcat(help_text, buf);
strcat(help_text, "\n");
}
}
void do_toggle(int which)
{
#ifndef NANO_SMALL
char *enabled = "enabled";
char *disabled = "disabled";
if (ISSET(toggles[which].flag)) {
if (toggles[which].val == TOGGLE_NOHELP_KEY ||
toggles[which].val == TOGGLE_WRAP_KEY)
statusbar("%s %s", toggles[which].desc, enabled);
else
statusbar("%s %s", toggles[which].desc, disabled);
UNSET(toggles[which].flag);
} else {
if (toggles[which].val == TOGGLE_NOHELP_KEY ||
toggles[which].val == TOGGLE_WRAP_KEY)
statusbar("%s %s", toggles[which].desc, disabled);
else
statusbar("%s %s", toggles[which].desc, enabled);
SET(toggles[which].flag);
}
switch (toggles[which].val) {
case TOGGLE_PICOMODE_KEY:
shortcut_init();
display_main_list();
break;
case TOGGLE_SUSPEND_KEY:
signal_init();
break;
case TOGGLE_MOUSE_KEY:
mouse_init();
break;
case TOGGLE_NOHELP_KEY:
handle_sigwinch(1);
break;
}
SET(DISABLE_CURPOS);
#else
nano_small_msg();
#endif
}
int main(int argc, char *argv[])
{
int optchr;
int kbinput; /* Input from keyboard */
long startline = 0; /* Line to try and start at */
struct sigaction act; /* For our lovely signals */
int keyhandled = 0; /* Have we handled the keystroke yet? */
int tmpkey = 0, i;
#ifdef HAVE_TABSIZE
int usrtabsize = 0; /* User defined tab size */
#endif
char *argv0;
struct termios term;
@@ -1564,9 +1700,7 @@ int main(int argc, char *argv[])
{"mouse", 0, 0, 'm'},
{"pico", 0, 0, 'p'},
{"nofollow", 0, 0, 'l'},
#ifdef HAVE_TABSIZE
{"tabsize", 0, 0, 'T'},
#endif
{"tabsize", 1, 0, 'T'},
{0, 0, 0, 0}
};
#endif
@@ -1588,19 +1722,13 @@ int main(int argc, char *argv[])
#endif
switch (optchr) {
#ifdef HAVE_TABSIZE
case 'T':
usrtabsize = atoi(optarg);
if (usrtabsize <= 0) {
tabsize = atoi(optarg);
if (tabsize <= 0) {
usage(); /* To stop bogus data for tab width */
finish(1);
}
break;
#else
case 'T':
usage(); /* Oops! You dont really have that option */
finish(1);
#endif
#ifdef _POSIX_VERSION
case 'R':
SET(USE_REGEXP);
@@ -1623,6 +1751,10 @@ int main(int argc, char *argv[])
case 'k':
SET(CUT_TO_END);
break;
#else
case 'k':
usage(); /* Oops! You dont really have that option */
finish(1);
#endif
case 'l':
UNSET(FOLLOW_SYMLINKS);
@@ -1671,9 +1803,6 @@ int main(int argc, char *argv[])
|| (!argv0 && strstr(argv[0], "pico")))
SET(PICO_MSGS);
filename = nmalloc(PATH_MAX);
strcpy(filename, "");
/* See if there's a non-option in argv (first non-option is the
filename, if +LINE is not given) */
if (argc == 1 || argc <= optind)
@@ -1715,22 +1844,7 @@ int main(int argc, char *argv[])
shortcut_init();
init_help_msg();
help_init();
/* Trap SIGINT and SIGQUIT cuz we want them to do useful things. */
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = SIG_IGN;
sigaction(SIGINT, &act, NULL);
sigaction(SIGQUIT, &act, NULL);
if (!ISSET(SUSPEND))
sigaction(SIGTSTP, &act, NULL);
/* Trap SIGHUP cuz we want to write the file out. */
act.sa_handler = handle_hup;
sigaction(SIGHUP, &act, NULL);
act.sa_handler = handle_sigwinch;
sigaction(SIGWINCH, &act, NULL);
signal_init();
#ifdef DEBUG
fprintf(stderr, _("Main: set up windows\n"));
@@ -1740,14 +1854,7 @@ int main(int argc, char *argv[])
edit = newwin(editwinrows, COLS, 2, 0);
keypad(edit, TRUE);
#ifndef NANO_SMALL
#ifdef NCURSES_MOUSE_VERSION
if (ISSET(USE_MOUSE)) {
mousemask(BUTTON1_RELEASED, NULL);
mouseinterval(50);
}
#endif
#endif
mouse_init();
/* And the other windows */
topwin = newwin(2, COLS, 0, 0);
@@ -1773,12 +1880,7 @@ int main(int argc, char *argv[])
if (startline > 0)
do_gotoline(startline);
else
edit_update(fileage);
#ifdef HAVE_TABSIZE
if (usrtabsize > 0)
TABSIZE = usrtabsize;
#endif
edit_update(fileage, CENTER);
edit_refresh();
reset_cursor();
@@ -1846,9 +1948,19 @@ int main(int argc, char *argv[])
for (i = 0; i <= MAIN_LIST_LEN - 1; i++)
if (kbinput == main_list[i].altval ||
kbinput == main_list[i].altval - 32) {
kbinput = main_list[i].val;
break;
kbinput = main_list[i].val;
break;
}
#ifndef NANO_SMALL
/* And for toggle switches */
for (i = 0; i <= TOGGLE_LEN - 1 && !keyhandled; i++)
if (kbinput == toggles[i].val ||
kbinput == toggles[i].val - 32) {
do_toggle(i);
keyhandled = 1;
break;
}
#endif
#ifdef DEBUG
fprintf(stderr, _("I got Alt-%c! (%d)\n"), kbinput,
kbinput);
@@ -1858,7 +1970,7 @@ int main(int argc, char *argv[])
}
/* Look through the main shortcut list to see if we've hit a
shortcut key */
for (i = 0; i < MAIN_LIST_LEN; i++) {
for (i = 0; i < MAIN_LIST_LEN && !keyhandled; i++) {
if (kbinput == main_list[i].val ||
(main_list[i].misc1 && kbinput == main_list[i].misc1) ||
(main_list[i].misc2 && kbinput == main_list[i].misc2)) {
@@ -1899,8 +2011,12 @@ int main(int argc, char *argv[])
}
do_char(kbinput);
}
if (ISSET(CONSTUPDATE))
do_cursorpos();
if (ISSET(CONSTUPDATE)) {
if (ISSET(DISABLE_CURPOS))
UNSET(DISABLE_CURPOS);
else
do_cursorpos();
}
reset_cursor();
wrefresh(edit);

36
nano.h
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* nano.h *
* *
@@ -44,11 +45,6 @@
#include <curses.h>
#endif /* CURSES_H */
#ifndef HAVE_TABSIZE
static int TABSIZE = 8;
#endif
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
#endif
@@ -86,6 +82,14 @@ typedef struct shortcut {
char *help; /* Help file entry text */
} shortcut;
typedef struct toggle {
int val; /* Sequence to toggle the key. Should only need 1 */
char *desc; /* Description for when toggle is, uh, toggled,
e.g. "Pico Messages", we'll append Enabled or
Disabled */
int flag; /* What flag actually gets toggled */
} toggle;
/* Bitwise flags so we can save space (or more correctly, not waste it) */
#define MODIFIED (1<<0)
@@ -104,8 +108,9 @@ typedef struct shortcut {
#define USE_MOUSE (1<<13)
#define USE_REGEXP (1<<14)
#define REGEXP_COMPILED (1<<15)
#define CUT_TO_END (1<<16)
#define TEMP_OPT (1<<16)
#define CUT_TO_END (1<<17)
#define DISABLE_CURPOS (1<<18)
/* Control key sequences, chaning these would be very very bad */
@@ -221,6 +226,16 @@ know what you're doing */
#define NANO_ENTER_KEY NANO_CONTROL_M
#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
#define TOGGLE_CONST_KEY NANO_ALT_C
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
#define TOGGLE_NOHELP_KEY NANO_ALT_X
#define TOGGLE_PICOMODE_KEY NANO_ALT_P
#define TOGGLE_MOUSE_KEY NANO_ALT_M
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
#define TOGGLE_REGEXP_KEY NANO_ALT_E
#define TOGGLE_WRAP_KEY NANO_ALT_W
#define MAIN_LIST_LEN 26
#define MAIN_VISIBLE 12
#define WHEREIS_LIST_LEN 6
@@ -230,7 +245,16 @@ know what you're doing */
#define HELP_LIST_LEN 3
#define SPELL_LIST_LEN 3
#ifndef SMALL_NANO
#define TOGGLE_LEN 9
#else
#define TOGGLE_LEN 6
#endif
#define VIEW 1
#define NOVIEW 0
#define TOP 2
#define CENTER 1
#define BOTTOM 0
#endif

View File

@@ -0,0 +1 @@
$Id$

View File

@@ -1,3 +1,4 @@
# $Id$
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
@@ -111,9 +112,9 @@ install-data: install-data-@USE_NLS@
install-data-no: all
install-data-yes: all
if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $(datadir); \
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
else \
$(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
fi
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
@@ -125,27 +126,30 @@ install-data-yes: all
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
dir=$$destdir/$$lang/LC_MESSAGES; \
if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $$dir; \
$(MKINSTALLDIRS) $(DESTDIR)$$dir; \
else \
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$$dir; \
fi; \
if test -r $$cat; then \
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $$cat as" \
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
else \
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
$(INSTALL_DATA) $(srcdir)/$$cat \
$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $(srcdir)/$$cat as" \
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
fi; \
if test -r $$cat.m; then \
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
$(INSTALL_DATA) $$cat.m $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
echo "installing $$cat.m as" \
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
else \
if test -r $(srcdir)/$$cat.m ; then \
$(INSTALL_DATA) $(srcdir)/$$cat.m \
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
echo "installing $(srcdir)/$$cat as" \
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
else \
true; \
fi; \
@@ -153,12 +157,12 @@ install-data-yes: all
done
if test "$(PACKAGE)" = "gettext"; then \
if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $(gettextsrcdir); \
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
else \
$(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
fi; \
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
$(gettextsrcdir)/Makefile.in.in; \
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
else \
: ; \
fi

View File

@@ -1,3 +1,4 @@
# $Id$
# List of source files containing translatable strings.
# Package source files

View File

@@ -28,71 +28,80 @@ const struct _msg_ent _msg_tbl[] = {
{"File Name to write", 19},
{"filename is %s", 20},
{"File exists, OVERWRITE ?", 21},
{"Invoke the help menu", 22},
{"Write the current file to disk", 23},
{"Exit from nano", 24},
{"Goto a specific line number", 25},
{"Justify the current paragraph", 26},
{"Replace text within the editor", 27},
{"Insert another file into the current one", 28},
{"Search for text within the editor", 29},
{"Move to the previous screen", 30},
{"Move to the next screen", 31},
{"Cut the current line and store it in the cutbuffer", 32},
{"Uncut from the cutbuffer into the current line", 33},
{"Show the posititon of the cursor", 34},
{"Invoke the spell checker (if available)", 35},
{"Move up one line", 36},
{"Move down one line", 37},
{"Move forward one character", 38},
{"Move back one character", 39},
{"Move to the beginning of the current line", 40},
{"Move to the end of the current line", 41},
{"Go to the first line of the file", 42},
{"Go to the last line of the file", 43},
{"Refresh (redraw) the current screen", 44},
{"Mark text at the current cursor location", 45},
{"Delete the character under the cursor", 46},
{"Delete the character to the left of the cursor", 47},
{"Insert a tab character", 48},
{"Insert a carriage return at the cursor position", 49},
{"Make the current search or replace case (in)sensitive", 50},
{"Cancel the current function", 51},
{"Get Help", 52},
{"WriteOut", 53},
{"Exit", 54},
{"Goto Line", 55},
{"Justify", 56},
{"Replace", 57},
{"Read File", 58},
{"Where Is", 59},
{"Prev Page", 60},
{"Next Page", 61},
{"Cut Text", 62},
{"UnCut Txt", 63},
{"Cur Pos", 64},
{"To Spell", 65},
{"Up", 66},
{"Down", 67},
{"Forward", 68},
{"Back", 69},
{"Home", 70},
{"End", 71},
{"Refresh", 72},
{"Mark Text", 73},
{"Delete", 74},
{"Backspace", 75},
{"Tab", 76},
{"Enter", 77},
{"First Line", 78},
{"Last Line", 79},
{"Case Sens", 80},
{"Cancel", 81},
{"No Replace", 82},
{"Constant cursor position", 22},
{"Auto indent", 23},
{"Suspend", 24},
{"Help mode", 25},
{"Pico messages", 26},
{"Mouse support", 27},
{"Cut to end", 28},
{"Regular expressions", 29},
{"Auto wrap", 30},
{"Invoke the help menu", 31},
{"Write the current file to disk", 32},
{"Exit from nano", 33},
{"Goto a specific line number", 34},
{"Justify the current paragraph", 35},
{"Replace text within the editor", 36},
{"Insert another file into the current one", 37},
{"Search for text within the editor", 38},
{"Move to the previous screen", 39},
{"Move to the next screen", 40},
{"Cut the current line and store it in the cutbuffer", 41},
{"Uncut from the cutbuffer into the current line", 42},
{"Show the posititon of the cursor", 43},
{"Invoke the spell checker (if available)", 44},
{"Move up one line", 45},
{"Move down one line", 46},
{"Move forward one character", 47},
{"Move back one character", 48},
{"Move to the beginning of the current line", 49},
{"Move to the end of the current line", 50},
{"Go to the first line of the file", 51},
{"Go to the last line of the file", 52},
{"Refresh (redraw) the current screen", 53},
{"Mark text at the current cursor location", 54},
{"Delete the character under the cursor", 55},
{"Delete the character to the left of the cursor", 56},
{"Insert a tab character", 57},
{"Insert a carriage return at the cursor position", 58},
{"Make the current search or replace case (in)sensitive", 59},
{"Cancel the current function", 60},
{"Get Help", 61},
{"WriteOut", 62},
{"Exit", 63},
{"Goto Line", 64},
{"Justify", 65},
{"Replace", 66},
{"Read File", 67},
{"Where Is", 68},
{"Prev Page", 69},
{"Next Page", 70},
{"Cut Text", 71},
{"UnCut Txt", 72},
{"Cur Pos", 73},
{"To Spell", 74},
{"Up", 75},
{"Down", 76},
{"Forward", 77},
{"Back", 78},
{"Home", 79},
{"End", 80},
{"Refresh", 81},
{"Mark Text", 82},
{"Delete", 83},
{"Backspace", 84},
{"Tab", 85},
{"Enter", 86},
{"First Line", 87},
{"Last Line", 88},
{"Case Sens", 89},
{"Cancel", 90},
{"No Replace", 91},
{"\
\n\
Buffer written to 'nano.save'\n", 83},
{"Key illegal in VIEW mode", 84},
Buffer written to 'nano.save'\n", 92},
{"Key illegal in VIEW mode", 93},
{"\
nano help text\n\
\n\
@@ -105,114 +114,116 @@ bottom and shows important messages. The bottom two lines show the most \
commonly used shortcuts in the editor.\n\
\n\
The notation for shortcuts is as follows: Control-key sequences are notated \
with a caret (^) symbol. Alt-key sequences are notated with an at (@) \
symbol. The following keystrokes are available in the main editor window. \
Optional keys are shown in parentheses:\n\
\n", 85},
{"free_node(): free'd a node, YAY!\n", 86},
{"free_node(): free'd last node.\n", 87},
with a caret (^) symbol and are entered with the Control (Ctrl) key. \
Escape-key sequences are notated with the Meta (M) symbol and can be entered \
using either the Esc, Alt or Meta key depending on your keyboard setup. The \
following keystrokes are available in the main editor window. Optional keys \
are shown in parentheses:\n\
\n", 94},
{"free_node(): free'd a node, YAY!\n", 95},
{"free_node(): free'd last node.\n", 96},
{"\
Usage: nano [GNU long option] [option] +LINE <file>\n\
\n", 88},
{"Option\t\tLong option\t\tMeaning\n", 89},
{" -T \t\t--tabsize=[num]\t\tSet width of a tab to num\n", 90},
{" -R\t\t--regexp\t\tUse regular expressions for search\n", 91},
{" -V \t\t--version\t\tPrint version information and exit\n", 92},
{" -c \t\t--const\t\t\tConstantly show cursor position\n", 93},
{" -h \t\t--help\t\t\tShow this message\n", 94},
{" -k \t\t--cut\t\t\tLet ^K cut from cursor to end of line\n", 95},
{" -i \t\t--autoindent\t\tAutomatically indent new lines\n", 96},
{" -l \t\t--nofollow\t\tDon't follow symbolic links, overwrite.\n", 97},
{" -m \t\t--mouse\t\t\tEnable mouse\n", 98},
\n", 97},
{"Option\t\tLong option\t\tMeaning\n", 98},
{" -T \t\t--tabsize=[num]\t\tSet width of a tab to num\n", 99},
{" -R\t\t--regexp\t\tUse regular expressions for search\n", 100},
{" -V \t\t--version\t\tPrint version information and exit\n", 101},
{" -c \t\t--const\t\t\tConstantly show cursor position\n", 102},
{" -h \t\t--help\t\t\tShow this message\n", 103},
{" -k \t\t--cut\t\t\tLet ^K cut from cursor to end of line\n", 104},
{" -i \t\t--autoindent\t\tAutomatically indent new lines\n", 105},
{" -l \t\t--nofollow\t\tDon't follow symbolic links, overwrite.\n", 106},
{" -m \t\t--mouse\t\t\tEnable mouse\n", 107},
{"\
-r [#cols] \t--fill=[#cols]\t\tSet fill cols to (wrap lines at) #cols\n", 99},
{" -p\t \t--pico\t\t\tMake bottom 2 lines more Pico-like\n", 100},
{" -s [prog] \t--speller=[prog]\tEnable alternate speller\n", 101},
{" -t \t\t--tempfile\t\tAuto save on exit, don't prompt\n", 102},
{" -v \t\t--view\t\t\tView (read only) mode\n", 103},
{" -w \t\t--nowrap\t\tDon't wrap long lines\n", 104},
{" -x \t\t--nohelp\t\tDon't show help window\n", 105},
{" -z \t\t--suspend\t\tEnable suspend\n", 106},
{" +LINE\t\t\t\t\tStart at line number LINE\n", 107},
-r [#cols] \t--fill=[#cols]\t\tSet fill cols to (wrap lines at) #cols\n", 108},
{" -p\t \t--pico\t\t\tMake bottom 2 lines more Pico-like\n", 109},
{" -s [prog] \t--speller=[prog]\tEnable alternate speller\n", 110},
{" -t \t\t--tempfile\t\tAuto save on exit, don't prompt\n", 111},
{" -v \t\t--view\t\t\tView (read only) mode\n", 112},
{" -w \t\t--nowrap\t\tDon't wrap long lines\n", 113},
{" -x \t\t--nohelp\t\tDon't show help window\n", 114},
{" -z \t\t--suspend\t\tEnable suspend\n", 115},
{" +LINE\t\t\t\t\tStart at line number LINE\n", 116},
{"\
Usage: nano [option] +LINE <file>\n\
\n", 108},
{"Option\t\tMeaning\n", 109},
{" -T [num]\tSet width of a tab to num\n", 110},
{" -R\t\tUse regular expressions for search\n", 111},
{" -V \t\tPrint version information and exit\n", 112},
{" -c \t\tConstantly show cursor position\n", 113},
{" -h \t\tShow this message\n", 114},
{" -k \t\tLet ^K cut from cursor to end of line\n", 115},
{" -i \t\tAutomatically indent new lines\n", 116},
{" -l \t\tDon't follow symbolic links, overwrite.\n", 117},
{" -m \t\tEnable mouse\n", 118},
{" -r [#cols] \tSet fill cols to (wrap lines at) #cols\n", 119},
{" -s [prog] \tEnable alternate speller\n", 120},
{" -p \t\tMake bottom 2 lines more Pico-like\n", 121},
{" -t \t\tAuto save on exit, don't prompt\n", 122},
{" -v \t\tView (read only) mode\n", 123},
{" -w \t\tDon't wrap long lines\n", 124},
{" -x \t\tDon't show help window\n", 125},
{" -z \t\tEnable suspend\n", 126},
{" +LINE\t\tStart at line number LINE\n", 127},
{" nano version %s by Chris Allegretta (compiled %s, %s)\n", 128},
{" Email: nano@asty.org\tWeb: http://www.asty.org/nano\n", 129},
{"Mark Set", 130},
{"Mark UNset", 131},
{"check_wrap called with inptr->data=\"%s\"\n", 132},
{"current->data now = \"%s\"\n", 133},
{"After, data = \"%s\"\n", 134},
{"Error deleting tempfile, ack!", 135},
{"Could not create a temporary filename: %s", 136},
{"Could not invoke spell program \"%s\"", 137},
{"Could not invoke \"ispell\"", 138},
{"Finished checking spelling", 139},
{"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? ", 140},
{"Cannot resize top win", 141},
{"Cannot move top win", 142},
{"Cannot resize edit win", 143},
{"Cannot move edit win", 144},
{"Cannot resize bottom win", 145},
{"Cannot move bottom win", 146},
{"Main: set up windows\n", 147},
{"Main: bottom win\n", 148},
{"Main: open file\n", 149},
{"I got Alt-[-%c! (%d)\n", 150},
{"I got Alt-%c! (%d)\n", 151},
{"Case Sensitive Regexp Search%s%s", 152},
{"Regexp Search%s%s", 153},
{"Case Sensitive Search%s%s", 154},
{"Search%s%s", 155},
{" (to replace)", 156},
{"Search Cancelled", 157},
{"Search Wrapped", 158},
{"Replaced %d occurences", 159},
{"Replaced 1 occurence", 160},
{"Replace Cancelled", 161},
{"Replace with [%s]", 162},
{"Replace with", 163},
{"Replace this instance?", 164},
{"Enter line number", 165},
{"Aborted", 166},
{"Come on, be reasonable", 167},
{"Only %d lines available, skipping to last line", 168},
{"actual_x_from_start for xplus=%d returned %d\n", 169},
{"input '%c' (%d)\n", 170},
{"New Buffer", 171},
{" File: ...", 172},
{"Modified", 173},
{"Moved to (%d, %d) in edit buffer\n", 174},
{"current->data = \"%s\"\n", 175},
{"I got \"%s\"\n", 176},
{"Yes", 177},
{"All", 178},
{"No", 179},
{"do_cursorpos: linepct = %f, bytepct = %f\n", 180},
{"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 181},
{"Dumping file buffer to stderr...\n", 182},
{"Dumping cutbuffer to stderr...\n", 183},
{"Dumping a buffer to stderr...\n", 184},
\n", 117},
{"Option\t\tMeaning\n", 118},
{" -T [num]\tSet width of a tab to num\n", 119},
{" -R\t\tUse regular expressions for search\n", 120},
{" -V \t\tPrint version information and exit\n", 121},
{" -c \t\tConstantly show cursor position\n", 122},
{" -h \t\tShow this message\n", 123},
{" -k \t\tLet ^K cut from cursor to end of line\n", 124},
{" -i \t\tAutomatically indent new lines\n", 125},
{" -l \t\tDon't follow symbolic links, overwrite.\n", 126},
{" -m \t\tEnable mouse\n", 127},
{" -r [#cols] \tSet fill cols to (wrap lines at) #cols\n", 128},
{" -s [prog] \tEnable alternate speller\n", 129},
{" -p \t\tMake bottom 2 lines more Pico-like\n", 130},
{" -t \t\tAuto save on exit, don't prompt\n", 131},
{" -v \t\tView (read only) mode\n", 132},
{" -w \t\tDon't wrap long lines\n", 133},
{" -x \t\tDon't show help window\n", 134},
{" -z \t\tEnable suspend\n", 135},
{" +LINE\t\tStart at line number LINE\n", 136},
{" nano version %s by Chris Allegretta (compiled %s, %s)\n", 137},
{" Email: nano@asty.org\tWeb: http://www.asty.org/nano\n", 138},
{"Mark Set", 139},
{"Mark UNset", 140},
{"check_wrap called with inptr->data=\"%s\"\n", 141},
{"current->data now = \"%s\"\n", 142},
{"After, data = \"%s\"\n", 143},
{"Error deleting tempfile, ack!", 144},
{"Could not create a temporary filename: %s", 145},
{"Could not invoke spell program \"%s\"", 146},
{"Could not invoke \"ispell\"", 147},
{"Finished checking spelling", 148},
{"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? ", 149},
{"Cannot resize top win", 150},
{"Cannot move top win", 151},
{"Cannot resize edit win", 152},
{"Cannot move edit win", 153},
{"Cannot resize bottom win", 154},
{"Cannot move bottom win", 155},
{"Main: set up windows\n", 156},
{"Main: bottom win\n", 157},
{"Main: open file\n", 158},
{"I got Alt-[-%c! (%d)\n", 159},
{"I got Alt-%c! (%d)\n", 160},
{"Case Sensitive Regexp Search%s%s", 161},
{"Regexp Search%s%s", 162},
{"Case Sensitive Search%s%s", 163},
{"Search%s%s", 164},
{" (to replace)", 165},
{"Search Cancelled", 166},
{"Search Wrapped", 167},
{"Replaced %d occurences", 168},
{"Replaced 1 occurence", 169},
{"Replace Cancelled", 170},
{"Replace with [%s]", 171},
{"Replace with", 172},
{"Replace this instance?", 173},
{"Enter line number", 174},
{"Aborted", 175},
{"Come on, be reasonable", 176},
{"Only %d lines available, skipping to last line", 177},
{"actual_x_from_start for xplus=%d returned %d\n", 178},
{"input '%c' (%d)\n", 179},
{"New Buffer", 180},
{" File: ...", 181},
{"Modified", 182},
{"Moved to (%d, %d) in edit buffer\n", 183},
{"current->data = \"%s\"\n", 184},
{"I got \"%s\"\n", 185},
{"Yes", 186},
{"All", 187},
{"No", 188},
{"do_cursorpos: linepct = %f, bytepct = %f\n", 189},
{"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 190},
{"Dumping file buffer to stderr...\n", 191},
{"Dumping cutbuffer to stderr...\n", 192},
{"Dumping a buffer to stderr...\n", 193},
};
int _msg_tbl_length = 184;
int _msg_tbl_length = 193;

BIN
po/de.gmo

Binary file not shown.

577
po/de.po

File diff suppressed because it is too large Load Diff

BIN
po/es.gmo

Binary file not shown.

415
po/es.po

File diff suppressed because it is too large Load Diff

BIN
po/fi.gmo

Binary file not shown.

414
po/fi.po

File diff suppressed because it is too large Load Diff

BIN
po/fr.gmo

Binary file not shown.

415
po/fr.po

File diff suppressed because it is too large Load Diff

BIN
po/id.gmo

Binary file not shown.

414
po/id.po

File diff suppressed because it is too large Load Diff

BIN
po/it.gmo

Binary file not shown.

418
po/it.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

16
proto.h
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* proto.h *
* *
@@ -29,10 +30,11 @@ extern int current_x, current_y, posible_max, totlines;
extern int placewewant;
extern int mark_beginx, samelinewrap;
extern int totsize, temp_opt;
extern int fill, flags;
extern int fill, flags,tabsize;
extern WINDOW *edit, *topwin, *bottomwin;
extern char *filename, *answer, *last_search, *last_replace;
extern char filename[PATH_MAX];
extern char answer[132];
extern char *hblank, *help_text;
extern struct stat fileinfo;
extern filestruct *current, *fileage, *edittop, *editbot, *filebot;
@@ -45,6 +47,7 @@ extern shortcut spell_list[SPELL_LIST_LEN];
extern int use_regexp, regexp_compiled;
extern regex_t search_regexp;
extern regmatch_t regmatches[10];
extern toggle toggles[TOGGLE_LEN];
/* Programs we want available */
@@ -79,10 +82,8 @@ void blank_bottombars(void);
void check_wrap(filestruct * inptr, char ch);
void dump_buffer(filestruct * inptr);
void align(char **strp);
void edit_refresh(void);
void edit_update(filestruct * fileptr);
void edit_update_top(filestruct * fileptr);
void edit_update_bot(filestruct * fileptr);
void edit_refresh(void), edit_refresh_clearok(void);
void edit_update(filestruct * fileptr, int topmidbot);
void update_cursor(void);
void delete_node(filestruct * fileptr);
void set_modified(void);
@@ -107,6 +108,9 @@ void *nrealloc(void *ptr, size_t howmuch);
void die(char *msg, ...);
void new_file(void);
void new_magicline(void);
void splice_node(filestruct *begin, filestruct *new, filestruct *end);
void null_at(char *data, int index);
void page_up_center(void);
int do_writeout_void(void), do_exit(void), do_gotoline_void(void);
int do_insertfile(void), do_search(void), page_up(void), page_down(void);

View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* search.c *
* *
@@ -33,6 +34,9 @@
#define _(string) (string)
#endif
static char last_search[132]; /* Last string we searched for */
static char last_replace[132]; /* Last replacement string */
/* Regular expression helper functions */
#ifdef _POSIX_VERSION
@@ -130,7 +134,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
char *searchstr, *found = NULL, *tmp;
int past_editbot = 0;
fileptr = current;
fileptr = begin;
searchstr = &current->data[current_x + 1];
/* Look for searchstr until EOF */
@@ -157,39 +161,35 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
current_x++;
if (past_editbot)
edit_update(current);
edit_update(current, CENTER);
placewewant = xplustabs();
reset_cursor();
} else { /* We're at EOF, go back to the top, once */
fileptr = fileage;
while (fileptr != current && fileptr != begin &&
while (fileptr != begin->next &&
(found = strstrwrapper(fileptr->data, needle)) == NULL)
fileptr = fileptr->next;
if (fileptr == begin) {
if (fileptr == begin->next) {
if (!quiet)
statusbar(_("\"%s\" not found"), needle);
return NULL;
}
if (fileptr != current) { /* We found something */
else { /* We found something */
current = fileptr;
current_x = 0;
for (tmp = fileptr->data; tmp != found; tmp++)
current_x++;
edit_update(current);
edit_update(current, CENTER);
reset_cursor();
if (!quiet)
statusbar(_("Search Wrapped"));
} else { /* Nada */
if (!quiet)
statusbar(_("\"%s\" not found"), needle);
return NULL;
}
}
}
return fileptr;
@@ -200,6 +200,8 @@ void search_abort(void)
UNSET(KEEP_CUTBUFFER);
display_main_list();
wrefresh(bottomwin);
if (ISSET(MARK_ISSET))
edit_refresh_clearok();
#ifdef _POSIX_VERSION
if (ISSET(REGEXP_COMPILED))
@@ -244,14 +246,10 @@ void print_replaced(int num)
void replace_abort(void)
{
UNSET(KEEP_CUTBUFFER);
display_main_list();
reset_cursor();
#ifdef _POSIX_VERSION
if (ISSET(REGEXP_COMPILED))
regexp_cleanup();
#endif
/* Identicle to search_abort, so we'll call it here. If it
does something different later, we can change it back. For now
it's just a waste to duplicat code */
search_abort();
}
#ifdef _POSIX_VERSION
@@ -491,7 +489,7 @@ int do_replace(void)
current = begin;
current_x = beginx;
renumber_all();
edit_update(current);
edit_update(current, CENTER);
print_replaced(numreplaced);
replace_abort();
return 1;
@@ -525,7 +523,7 @@ int do_gotoline(long defline)
if (!strcmp(answer, "$")) {
current = filebot;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
goto_abort();
return 1;
}
@@ -543,14 +541,14 @@ int do_gotoline(long defline)
filebot->lineno);
current = filebot;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
} else {
for (fileptr = fileage; fileptr != NULL && i < line; i++)
fileptr = fileptr->next;
current = fileptr;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
}
goto_abort();

View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* utils.c *
* *

98
winio.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* winio.c *
* *
@@ -48,7 +49,7 @@ int do_first_line(void)
current = fileage;
placewewant = 0;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
return 1;
}
@@ -57,7 +58,7 @@ int do_last_line(void)
current = filebot;
placewewant = 0;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
return 1;
}
@@ -73,9 +74,9 @@ int xpt(filestruct * fileptr, int index)
tabs++;
if (fileptr->data[i] == NANO_CONTROL_I) {
if (tabs % TABSIZE == 0);
if (tabs % tabsize == 0);
else
tabs += TABSIZE - (tabs % TABSIZE);
tabs += tabsize - (tabs % tabsize);
} else if (fileptr->data[i] & 0x80)
/* Make 8 bit chars only 1 collumn! */
;
@@ -106,10 +107,10 @@ int actual_x_from_start(filestruct * fileptr, int xplus, int start)
for (i = start; tot <= xplus && fileptr->data[i] != 0; i++, tot++)
if (fileptr->data[i] == NANO_CONTROL_I) {
if (tot % TABSIZE == 0)
if (tot % tabsize == 0)
tot++;
else
tot += TABSIZE - (tot % TABSIZE);
tot += tabsize - (tot % tabsize);
} else if (fileptr->data[i] & 0x80)
tot++; /* Make 8 bit chars only 1 column (again) */
else if (fileptr->data[i] < 32)
@@ -140,9 +141,9 @@ int strlenpt(char *buf)
tabs++;
if (buf[i] == NANO_CONTROL_I) {
if (tabs % TABSIZE == 0);
if (tabs % tabsize == 0);
else
tabs += TABSIZE - (tabs % TABSIZE);
tabs += tabsize - (tabs % tabsize);
} else if (buf[i] & 0x80)
/* Make 8 bit chars only 1 collumn! */
;
@@ -461,7 +462,7 @@ void onekey(char *keystroke, char *desc)
{
char description[80];
snprintf(description, 12, " %-11s", desc);
snprintf(description, 13, " %-11s", desc);
wattron(bottomwin, A_REVERSE);
waddstr(bottomwin, keystroke);
wattroff(bottomwin, A_REVERSE);
@@ -773,12 +774,17 @@ void update_line(filestruct * fileptr, int index)
virt_cur_x++;
if (i < mark_beginx)
virt_mark_beginx++;
} while (pos % TABSIZE);
} while (pos % tabsize);
/* must decrement once to account for tab-is-one-character */
if (i < current_x)
virt_cur_x--;
if (i < mark_beginx)
virt_mark_beginx--;
}
else if (realdata[i] >= 1 && realdata[i] <= 26) {
/* Treat control characters as ^letter */
fileptr->data[pos++] = '^';
fileptr->data[pos++] = realdata[i] + 64;
} else {
fileptr->data[pos++] = realdata[i];
}
@@ -822,7 +828,8 @@ void center_cursor(void)
/* Refresh the screen without changing the position of lines */
void edit_refresh(void)
{
int lines = 0, i = 0;
static int noloop = 0;
int lines = 0, i = 0, currentcheck = 0;
filestruct *temp, *hold = current;
if (current == NULL)
@@ -833,9 +840,21 @@ void edit_refresh(void)
while (lines <= editwinrows - 1 && lines <= totlines && temp != NULL) {
hold = temp;
update_line(temp, current_x);
if (temp == current)
currentcheck = 1;
temp = temp->next;
lines++;
}
/* If noloop == 1, then we already did an edit_update without finishing
this function. So we don't run edit_update again */
if (!currentcheck && !noloop) /* Then current has run off the screen... */
{
edit_update(current, CENTER);
noloop = 1;
}
else if (noloop)
noloop = 0;
if (lines <= editwinrows - 1)
while (lines <= editwinrows - 1) {
@@ -848,11 +867,21 @@ void edit_refresh(void)
editbot = temp;
}
/*
* Same as above, but touch the window first so everything is redrawn.
*/
void edit_refresh_clearok(void)
{
clearok(edit, TRUE);
edit_refresh();
clearok(edit, FALSE);
}
/*
* Nice generic routine to update the edit buffer given a pointer to the
* file struct =)
*/
void edit_update(filestruct * fileptr)
void edit_update(filestruct * fileptr, int topmidbot)
{
int i = 0;
filestruct *temp;
@@ -861,10 +890,14 @@ void edit_update(filestruct * fileptr)
return;
temp = fileptr;
while (i <= editwinrows / 2 && temp->prev != NULL) {
i++;
temp = temp->prev;
}
if (topmidbot == 2)
;
else if (topmidbot == 0)
for (i = 0; i <= editwinrows - 1 && temp->prev != NULL; i++)
temp = temp->prev;
else
for (i = 0; i <= editwinrows / 2 && temp->prev != NULL; i++)
temp = temp->prev;
edittop = temp;
fix_editbot();
@@ -872,37 +905,6 @@ void edit_update(filestruct * fileptr)
edit_refresh();
}
/* Now we want to update the screen using this struct as the top of the edit buffer */
void edit_update_top(filestruct * fileptr)
{
int i;
filestruct *temp = fileptr;
if (fileptr == NULL)
return;
i = 0;
while (i <= editwinrows / 2 && temp->next != NULL) {
i++;
temp = temp->next;
}
edit_update(temp);
}
/* And also for the bottom... */
void edit_update_bot(filestruct * fileptr)
{
int i;
filestruct *temp = fileptr;
i = 0;
while (i <= editwinrows / 2 - 1 && temp->prev != NULL) {
i++;
temp = temp->prev;
}
edit_update(temp);
}
/* This function updates current based on where current_y is, reset_cursor
does the opposite */
void update_cursor(void)
@@ -1087,7 +1089,7 @@ int total_refresh(void)
clearok(edit, FALSE);
clearok(topwin, FALSE);
clearok(bottomwin, FALSE);
edit_refresh();
return 1;
}